This repository was archived by the owner on Sep 11, 2026. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 16
chore: bump ESLint stack to v15 and migrate to flat config #317
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
467c775
chore: bump ESLint stack to v15 and migrate to flat config
cryptodev-2s cb576bc
chore: drop the unnecessary @types/eslint devDependency
cryptodev-2s 9b47a97
style: drop blank lines left behind by removed eslint directives
cryptodev-2s 66665c1
fix: keep the JsonRpcError assertion, it is load bearing for declarat…
cryptodev-2s f0063b3
test: use `as const` instead of `as Hex` in the hex tables
cryptodev-2s e99f95d
fix: drop the global uuid import-x ignore
cryptodev-2s 4fb3fb6
chore: enforce explicit return types and nullish coalescing
cryptodev-2s File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| import base, { createConfig } from '@metamask/eslint-config'; | ||
| import jest from '@metamask/eslint-config-jest'; | ||
| import nodejs from '@metamask/eslint-config-nodejs'; | ||
| import typescript from '@metamask/eslint-config-typescript'; | ||
| import path from 'node:path'; | ||
| import { fileURLToPath } from 'node:url'; | ||
|
|
||
| const tsconfigRootDir = path.dirname(fileURLToPath(import.meta.url)); | ||
|
|
||
| const config = createConfig([ | ||
| ...base, | ||
| { | ||
| ignores: ['coverage/**', 'dist/**', 'docs/**', '.yarn/**'], | ||
| }, | ||
| { | ||
| linterOptions: { | ||
| reportUnusedDisableDirectives: 'error', | ||
| }, | ||
| }, | ||
| { | ||
| rules: { | ||
| // Handled by Oxfmt. | ||
| 'prettier/prettier': 'off', | ||
| 'import-x/order': 'off', | ||
| }, | ||
| }, | ||
| { | ||
| files: ['**/*.{js,cjs,mjs}', '**/*.test.{js,ts}', '**/tests/**/*.{js,ts}'], | ||
| extends: [nodejs], | ||
| }, | ||
| { | ||
| files: ['**/*.{js,cjs}'], | ||
| languageOptions: { | ||
| sourceType: 'script', | ||
| ecmaVersion: 2020, | ||
| }, | ||
| }, | ||
| { | ||
| files: ['**/*.mjs'], | ||
| languageOptions: { | ||
| sourceType: 'module', | ||
| }, | ||
| }, | ||
| { | ||
| files: ['**/*.ts'], | ||
| extends: [typescript], | ||
| languageOptions: { | ||
| parserOptions: { | ||
| tsconfigRootDir, | ||
| }, | ||
| }, | ||
| }, | ||
| { | ||
| files: ['**/*.test.{js,ts}', '**/tests/**/*.{js,ts}'], | ||
| extends: [jest], | ||
| }, | ||
| // Project-wide rule overrides. These go after every `extends` so they win. | ||
| { | ||
| rules: { | ||
| // TODO: Re-enable these rules. | ||
| // They were not enforced under the legacy eslint-config v12, and fixing | ||
| // roughly 150 JSDoc blocks is out of scope for a config migration. | ||
| // `require-jsdoc` in particular must stay off while suppressed: its | ||
| // autofixer inserts empty `/** */` blocks and mangles surrounding code. | ||
| // Core disables it for the same reason. | ||
| 'jsdoc/require-jsdoc': 'off', | ||
| 'jsdoc/require-param-description': 'off', | ||
| 'jsdoc/require-returns': 'off', | ||
| 'jsdoc/tag-lines': 'off', | ||
| }, | ||
| }, | ||
| { | ||
| files: ['**/*.test-d.ts'], | ||
| rules: { | ||
| // In `tsd` type tests the assertions carry the meaning of the test, so | ||
| // the autofixer actively destroys them. Stripping `as any` from | ||
| // `expectAssignable<Json>(null as any)`, for instance, deletes the very | ||
| // thing that assertion exists to prove. | ||
| '@typescript-eslint/no-unnecessary-type-assertion': 'off', | ||
| }, | ||
| }, | ||
| { | ||
| files: ['**/*.test.{js,ts}'], | ||
| rules: { | ||
| // These tests deliberately reach for `crypto` and `crypto.webcrypto`, | ||
| // and polyfill the global when running on Node 18. Flagging them as | ||
| // unsupported defeats the purpose of the polyfill they are testing. | ||
| 'n/no-unsupported-features/node-builtins': 'off', | ||
| }, | ||
| }, | ||
| ]); | ||
|
|
||
| export default config; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably okay, but I need to double-check this is the right thing to do here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The real reason is described here 8555d3c