-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update to latest eslint * update node version * prettier formatting * update config, tests * fix lint * restore ts * changeset * update workflows, imports * update lock * update readme, restore peer deps * fix lint * more detailed changeset * cleanup * fix config example * Apply suggestions from code review Co-authored-by: Anna Vo <[email protected]> * pr feedback * pr feedback --------- Co-authored-by: Anna Vo <[email protected]>
- Loading branch information
Showing
23 changed files
with
1,573 additions
and
2,384 deletions.
There are no files selected for viewing
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,10 @@ | ||
--- | ||
'eslint-config-widen': major | ||
'eslint-plugin-widen': major | ||
--- | ||
|
||
Update to eslint 9, apps will need to be on eslint 9+ alongside this update. | ||
They will also need to convert their .eslintrc and .eslintignore into the new | ||
format of eslint.config.mjs. Here is a migration guide that goes over the basics | ||
https://eslint.org/docs/latest/use/configure/migration-guide. For general usage | ||
and a sample eslint.config.mjs see the updated readme in this repo. |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { FlatCompat } from '@eslint/eslintrc' | ||
import js from '@eslint/js' | ||
import typescriptEslint from '@typescript-eslint/eslint-plugin' | ||
import tsParser from '@typescript-eslint/parser' | ||
import globals from 'globals' | ||
import path from 'node:path' | ||
import { fileURLToPath } from 'node:url' | ||
|
||
const __filename = fileURLToPath(import.meta.url) | ||
const __dirname = path.dirname(__filename) | ||
|
||
//TODO: cleanup compat https://acquia.atlassian.net/browse/FE-1172 | ||
const compat = new FlatCompat({ | ||
allConfig: js.configs.all, | ||
baseDirectory: __dirname, | ||
recommendedConfig: js.configs.recommended, | ||
}) | ||
|
||
export default [ | ||
{ | ||
ignores: ['**/lib/'], | ||
}, | ||
...compat.extends( | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:sort/recommended', | ||
), | ||
{ | ||
languageOptions: { | ||
globals: { | ||
...globals.jest, | ||
...globals.node, | ||
}, | ||
|
||
parser: tsParser, | ||
}, | ||
|
||
plugins: { | ||
'@typescript-eslint': typescriptEslint, | ||
}, | ||
|
||
rules: { | ||
'@typescript-eslint/no-non-null-assertion': 'off', | ||
}, | ||
}, | ||
] |
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
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,97 @@ | ||
import js from '@eslint/js' | ||
import sort from 'eslint-plugin-sort' | ||
import widen from 'eslint-plugin-widen' | ||
import globals from 'globals' | ||
import babelParser from '@babel/eslint-parser' | ||
|
||
export default [ | ||
{ | ||
languageOptions: { | ||
globals: { | ||
...globals.browser, | ||
...globals.es6, | ||
...globals.jest, | ||
...globals.node, | ||
}, | ||
parser: babelParser, | ||
parserOptions: { | ||
requireConfigFile: false, | ||
}, | ||
}, | ||
plugins: { | ||
sort, | ||
widen, | ||
}, | ||
rules: { | ||
'default-param-last': 'error', | ||
'dot-notation': 'error', | ||
eqeqeq: [ | ||
'error', | ||
'always', | ||
{ | ||
null: 'ignore', | ||
}, | ||
], | ||
'no-console': ['error', { allow: ['error'] }], | ||
'no-dupe-args': 'error', | ||
'no-duplicate-imports': 'error', | ||
'no-else-return': 'error', | ||
'no-empty': ['error', { allowEmptyCatch: true }], | ||
'no-extra-bind': 'error', | ||
'no-param-reassign': 'error', | ||
'no-return-await': 'error', | ||
'no-template-curly-in-string': 'error', | ||
'no-unneeded-ternary': 'error', | ||
'no-unused-expressions': 'off', | ||
'no-unused-vars': [ | ||
'error', | ||
{ | ||
ignoreRestSiblings: true, | ||
varsIgnorePattern: '^_', | ||
}, | ||
], | ||
'no-useless-computed-key': 'error', | ||
'no-var': 'error', | ||
'object-shorthand': 'error', | ||
'prefer-const': [ | ||
'error', | ||
{ | ||
destructuring: 'all', | ||
}, | ||
], | ||
'require-await': 'error', | ||
'sort/exports': [ | ||
'warn', | ||
{ | ||
groups: [ | ||
{ order: 6, type: 'default' }, | ||
{ order: 5, type: 'sourceless' }, | ||
{ order: 2, regex: '^@widen\\/' }, | ||
{ order: 4, regex: '^\\.+' }, | ||
{ order: 1, type: 'dependency' }, | ||
{ order: 3, type: 'other' }, | ||
], | ||
}, | ||
], | ||
'sort/imports': [ | ||
'warn', | ||
{ | ||
groups: [ | ||
{ order: 1, type: 'side-effect' }, | ||
{ order: 3, regex: '^@widen\\/' }, | ||
{ order: 5, regex: '^\\.+' }, | ||
{ order: 2, type: 'dependency' }, | ||
{ order: 4, type: 'other' }, | ||
], | ||
}, | ||
], | ||
}, | ||
}, | ||
js.configs.recommended, | ||
{ | ||
files: ['**/*.js', '**/*.mjs'], | ||
rules: { | ||
'prettier/prettier': 'error', // Assuming you have `eslint-plugin-prettier` setup | ||
}, | ||
}, | ||
] |
Oops, something went wrong.