-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade and fix eslint config (#2879)
Previously, `npm install; npm run lint` would fail. Now it succeeds. This involved a couple changes: 1. switch from eslint legacy to flat config 2. bump some plugins, including removing some straggling references to the unmaintained `eslint-plugin-node` in favor of its sucessor `eslint-plugin-n` and removing `eslint-plugin-import`, which is unused and incompatible with eslint 9. 3. Use the recommended config for `typescript-eslint`. 4. Turn off the rule `@typescript-eslint/no-require-imports`, which currently fails on parts of the codebase. --------- Co-authored-by: Francis Gulotta <[email protected]>
- Loading branch information
Showing
18 changed files
with
77 additions
and
13,803 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import nodePlugin from 'eslint-plugin-n' | ||
import mocha from 'eslint-plugin-mocha' | ||
import globals from 'globals' | ||
import js from '@eslint/js' | ||
import eslintConfigPrettier from 'eslint-config-prettier' | ||
import eslint from '@eslint/js' | ||
import typescriptEslint from 'typescript-eslint' | ||
|
||
export default [ | ||
{ | ||
ignores: ['packages/*/node_modules', '**/docs', 'packages/*/dist/*'], | ||
}, | ||
js.configs.recommended, | ||
nodePlugin.configs['flat/recommended-script'], | ||
mocha.configs['flat'].recommended, | ||
...typescriptEslint.configs.recommended, | ||
eslintConfigPrettier, | ||
{ | ||
languageOptions: { | ||
globals: { | ||
...globals.node, | ||
...globals.mocha, | ||
assert: false, | ||
makeTestFeature: false, | ||
shouldReject: false, | ||
}, | ||
ecmaVersion: 12, | ||
sourceType: 'commonjs', | ||
}, | ||
|
||
rules: { | ||
'no-extra-semi': 'off', | ||
'@typescript-eslint/no-extra-semi': 'off', | ||
'n/no-process-exit': 'off', | ||
'no-var': 'error', | ||
|
||
'n/no-extraneous-import': [ | ||
'error', | ||
{ | ||
allowModules: ['sinon', 'chai'], | ||
}, | ||
], | ||
|
||
'n/no-missing-import': 'off', | ||
'n/no-missing-require': 'off', | ||
'n/no-unpublished-import': 'off', | ||
'n/no-unpublished-require': 'off', | ||
'n/no-unsupported-features/es-builtins': 'error', | ||
'n/no-unsupported-features/es-syntax': 'off', | ||
'n/no-unsupported-features/node-builtins': 'error', | ||
'n/hashbang': 'off', | ||
'object-shorthand': 'error', | ||
'prefer-arrow-callback': 'error', | ||
'prefer-const': 'error', | ||
'prefer-template': 'error', | ||
'mocha/no-exclusive-tests': 'error', | ||
'mocha/no-hooks-for-single-case': 'off', | ||
'mocha/no-mocha-arrows': 'off', | ||
'mocha/no-pending-tests': 'error', | ||
'mocha/no-setup-in-describe': 'off', | ||
strict: ['error', 'never'], | ||
'valid-jsdoc': 'off', | ||
'@typescript-eslint/no-var-requires': 'off', | ||
'@typescript-eslint/no-empty-function': 'off', | ||
'@typescript-eslint/no-require-imports': 'off', | ||
}, | ||
}, | ||
] |
Oops, something went wrong.