-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING: Bump ESLint to
^9.11.1
, bump related ESLint dependencies,…
… and rewrite configs to use flat configs (#370) * Update main ESLint config to flat config format * Bump all related ESLint dependencies * Convert base config to flat config format * Convert browser config to flat config format * Convert CommonJS config to flat config format * Convert Jest config to flat config format * Convert Mocha config to flat config format * Convert Node.js config to flat config format * Convert TypeScript config to flat config format * Replace `jest/no-if` with `jest/no-conditional-in-test` * Add dependency on @metamask/eslint-config-jest to root package * Add name and files to all configs * Update validate-config script * Update snapshots * Normalize snapshots * Fix lint errors * Update formatting of package.jsons * Update configs to use helper * Fix config validation script when using Node.js 18 * Update all READMEs * Set type to module for all packages * Use jsdoc error config for TypeScript * Set module and moduleResolution to Node16 * Remove Jest types * Remove import attributes in favour of `require` * Disable `@typescript-eslint/no-duplicate-type-constituents` * Fix tests * Disable `no-implicit-globals` * Disable `@typescript-eslint/no-redundant-type-constituents`
- Loading branch information
Showing
57 changed files
with
2,606 additions
and
2,407 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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 |
---|---|---|
@@ -1,9 +1,12 @@ | ||
// All of these are defaults except singleQuote and endOfLine, but we specify them | ||
// for explicitness | ||
module.exports = { | ||
// All of these are defaults except singleQuote and endOfLine, but we specify | ||
// them for explicitness | ||
const config = { | ||
endOfLine: 'auto', | ||
quoteProps: 'as-needed', | ||
singleQuote: true, | ||
tabWidth: 2, | ||
trailingComma: 'all', | ||
plugins: ['prettier-plugin-packagejson'], | ||
}; | ||
|
||
export default config; |
This file contains 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,64 @@ | ||
// @ts-check | ||
|
||
import base 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'; | ||
// eslint-disable-next-line import-x/no-unresolved | ||
import tseslint from 'typescript-eslint'; | ||
|
||
const config = tseslint.config( | ||
{ | ||
ignores: ['.yarn/'], | ||
}, | ||
|
||
...base, | ||
...nodejs, | ||
|
||
{ | ||
files: [ | ||
'**/*.ts', | ||
'**/*.tsx', | ||
'**/*.mts', | ||
'**/*.cts', | ||
'**/*.mtsx', | ||
'**/*.ctsx', | ||
], | ||
extends: typescript, | ||
}, | ||
|
||
{ | ||
files: ['**/*.test.mjs'], | ||
extends: jest, | ||
rules: { | ||
'no-shadow': [ | ||
'error', | ||
{ | ||
allow: ['describe', 'it', 'expect'], | ||
}, | ||
], | ||
}, | ||
}, | ||
|
||
{ | ||
name: 'main', | ||
files: ['**/*.js', '**/*.mjs'], | ||
|
||
languageOptions: { | ||
sourceType: 'module', | ||
}, | ||
|
||
rules: { | ||
'import-x/no-dynamic-require': 'off', | ||
'import-x/no-nodejs-modules': 'off', | ||
'jsdoc/check-tag-names': 'off', | ||
'jsdoc/no-types': 'off', | ||
'n/global-require': 'off', | ||
'n/no-process-exit': 'off', | ||
'n/no-sync': 'off', | ||
'n/no-unpublished-require': 'off', | ||
}, | ||
}, | ||
); | ||
|
||
export default config; |
This file contains 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 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 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.