Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 3 additions & 15 deletions .github/workflows/lint-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ jobs:
exit 1
fi

lint-eslint:
name: Lint (lint:eslint)
lint-oxlint:
name: Lint (lint:oxlint)
runs-on: ubuntu-latest
if: needs.prepare.outputs.changed-paths != '[]'
needs: prepare
Expand All @@ -126,19 +126,7 @@ jobs:
persist-credentials: false
node-version: ${{ matrix.node-version }}
- name: Lint
run: |
if [[ "$CHANGED_PATHS" == "full" ]]; then
echo "Running ESLint on all packages."
echo ""
yarn lint:eslint
else
echo "Running ESLint on:"
echo "$CHANGED_PATHS" | jq -r '"- " + .[]'
echo ""
echo "$CHANGED_PATHS" | jq -r '.[]' | xargs yarn lint:eslint
fi
env:
CHANGED_PATHS: ${{ needs.prepare.outputs.changed-paths }}
run: yarn lint:oxlint
- name: Require clean working directory
shell: bash
run: |
Expand Down
87 changes: 87 additions & 0 deletions oxlint.config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
import base, { createConfig } from '@metamask/oxlint-config';
import jest from '@metamask/oxlint-config-jest';
import nodejs from '@metamask/oxlint-config-nodejs';
import typescript from '@metamask/oxlint-config-typescript';

export default createConfig({
ignorePatterns: ['.yarn'],
extends: [base],

options: {
typeAware: true,
},

rules: {
'eslint/id-length': 'off',
'eslint/no-import-assign': 'off',
'eslint/no-negated-condition': 'off',
'eslint/no-new': 'off',
'eslint/no-param-reassign': 'off',
'eslint/no-shadow': 'off',
'eslint/no-throw-literal': 'off',
'eslint/no-unmodified-loop-condition': 'off',
'eslint/no-unneeded-ternary': 'off',
'eslint/no-unused-vars': 'off',
'eslint/no-unsafe-optional-chaining': 'off',
'eslint/prefer-promise-reject-errors': 'off',
'eslint/radix': 'off',
'import/extensions': 'off',
'import/no-unassigned-import': 'off',
'import/unambiguous': 'off',
'jsdoc/check-tag-names': 'off',
'jsdoc/require-param': 'off',
'jsdoc/require-param-description': 'off',
'jsdoc/require-returns': 'off',
},

overrides: [
{
files: ['**/*.ts', '**/*.mts', '**/*.cts'],
extends: [typescript],
rules: {
'eslint/no-unused-vars': 'off',
'typescript/explicit-function-return-type': 'off',
'typescript/promise-function-async': 'off',
},
},

{
files: [
'.github/**',
'yarn.config.cjs',
'packages/bitcoin-regtest-up/**',
'packages/local-node-utils/**',
'packages/foundryup/**',
'packages/java-tron-up/**',
'packages/messenger-cli/**',
'packages/platform-api-docs/**',
'packages/wallet-cli/**',
'**/scripts/**',
],
extends: [nodejs],
rules: {
'node/no-sync': 'off',
'node/no-process-env': 'off',
},
},

{
files: [
'packages/*/jest.config.js',
'packages/*/jest.config.e2e.js',
'packages/*/jest.environment.js',
'**/*.test.ts',
'**/test/**',
'**/tests/**',
],
extends: [nodejs, jest],
rules: {
'jest/no-commented-out-tests': 'off',
'jest/require-top-level-describe': 'off',
'node/global-require': 'off',
'node/no-sync': 'off',
'node/no-process-env': 'off',
},
},
],
});
29 changes: 9 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
"docs:platform-api:build": "yarn workspace @metamask/platform-api-docs cli ../.. --build --project-label Core",
"docs:platform-api:dev": "yarn workspace @metamask/platform-api-docs cli ../.. --dev --project-label Core",
"docs:platform-api:serve": "yarn workspace @metamask/platform-api-docs cli ../.. --serve --project-label Core",
"lint": "yarn lint:tsc && yarn lint:eslint && echo && yarn lint:misc --check && yarn constraints && yarn lint:dependencies && yarn lint:teams && yarn messenger-action-types:check && yarn readme-content:check && yarn lint:tsconfigs:all && yarn codeowners:check",
"lint": "yarn lint:tsc && yarn lint:oxlint && echo && yarn lint:misc --check && yarn constraints && yarn lint:dependencies && yarn lint:teams && yarn messenger-action-types:check && yarn readme-content:check && yarn lint:tsconfigs:all && yarn codeowners:check",
"lint:dependencies": "knip --config knip.config.mts --dependencies && yarn dedupe --check",
"lint:dependencies:fix": "knip --config knip.config.mts --dependencies && yarn dedupe",
"lint:eslint": "yarn build:only-clean && NODE_OPTIONS='--max-old-space-size=10240' yarn eslint",
"lint:fix": "yarn lint:eslint --fix --prune-suppressions && echo && yarn lint:misc --write && yarn constraints --fix && yarn lint:dependencies:fix && yarn messenger-action-types:generate && yarn readme-content:update && yarn codeowners:generate",
"lint:fix": "yarn lint:oxlint --fix --prune-suppressions && echo && yarn lint:misc --write && yarn constraints --fix && yarn lint:dependencies:fix && yarn messenger-action-types:generate && yarn readme-content:update && yarn codeowners:generate",
"lint:misc": "oxfmt --ignore-path .gitignore",
"lint:misc:check": "yarn lint:misc --check",
"lint:oxlint": "oxlint",
"lint:teams": "tsx scripts/lint-teams-json.ts",
"lint:tsc": "tsc --build tsconfig.lint.json",
"lint:tsconfigs": "tsx scripts/lint-tsconfigs/lint-tsconfigs.mts",
Expand Down Expand Up @@ -66,39 +66,28 @@
"@lavamoat/preinstall-always-fail": "^2.1.0",
"@metamask/auto-changelog": "^6.1.0",
"@metamask/create-release-branch": "^4.2.2",
"@metamask/eslint-config": "^15.0.0",
"@metamask/eslint-config-jest": "^15.0.0",
"@metamask/eslint-config-nodejs": "^15.0.0",
"@metamask/eslint-config-typescript": "^15.0.0",
"@metamask/eth-block-tracker": "^15.0.1",
"@metamask/eth-json-rpc-provider": "^6.0.1",
"@metamask/json-rpc-engine": "^10.5.0",
"@metamask/network-controller": "^36.0.0",
"@metamask/oxlint-config": "npm:@metamask-previews/oxlint-config@0.0.0-preview-81699dd",
"@metamask/oxlint-config-jest": "npm:@metamask-previews/oxlint-config-jest@0.0.0-preview-81699dd",
"@metamask/oxlint-config-nodejs": "npm:@metamask-previews/oxlint-config-nodejs@0.0.0-preview-81699dd",
"@metamask/oxlint-config-typescript": "npm:@metamask-previews/oxlint-config-typescript@0.0.0-preview-81699dd",
"@metamask/skills": "^0.1.0",
"@metamask/utils": "^11.12.0",
"@ts-bridge/cli": "^0.6.4",
"@types/jest": "^30.0.0",
"@types/lodash": "^4.14.191",
"@types/node": "^16.18.54",
"@types/semver": "^7",
"@typescript-eslint/eslint-plugin": "^8.48.0",
"@typescript-eslint/parser": "^8.48.0",
"@yarnpkg/cli": "^4.17.1",
"@yarnpkg/core": "^4.9.0",
"@yarnpkg/fslib": "^3.1.5",
"@yarnpkg/parsers": "^3.0.3",
"@yarnpkg/types": "^4.0.0",
"bats": "^1.13.0",
"comment-json": "^4.5.1",
"eslint": "^9.39.1",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-import-x": "^4.3.0",
"eslint-plugin-jest": "^28.8.3",
"eslint-plugin-jsdoc": "^50.2.4",
"eslint-plugin-n": "^17.10.3",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-promise": "^7.1.0",
"execa": "^5.0.0",
"isomorphic-fetch": "^3.0.0",
"jest": "^30.4.2",
Expand All @@ -107,13 +96,14 @@
"lodash": "^4.17.21",
"nock": "^13.3.1",
"oxfmt": "^0.44.0",
"oxlint": "^1.81.0",
"oxlint-tsgolint": "^7.0.2001",
"prettier": "^3.3.3",
"rimraf": "^5.0.5",
"semver": "^7.6.3",
"simple-git-hooks": "^2.8.0",
"tsx": "^4.20.5",
"typescript": "~5.3.3",
"typescript-eslint": "^8.48.0",
"uuid": "^8.3.2",
"yargs": "^17.7.2"
},
Expand All @@ -136,7 +126,6 @@
"@keystonehq/bc-ur-registry-eth>hdkey>secp256k1": true,
"@lavamoat/preinstall-always-fail": false,
"babel-runtime>core-js": false,
"eslint-plugin-import-x>unrs-resolver": false,
"simple-git-hooks": false,
"tsx>esbuild": false,
"jest>@jest/core>jest-resolve>unrs-resolver": false,
Expand Down
Loading
Loading