X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=.eslintrc.js;h=4d8c7ffd0ddd57278e18605e916fb20076accb3a;hb=dc32abbbbd36504ce933a0403cc245899c25a828;hp=7448b400d0814fad77f4338920cccba9799afce0;hpb=c3eb346ba7a74c06cb386de7bdb1043362913db8;p=poolifier.git diff --git a/.eslintrc.js b/.eslintrc.js index 7448b400..4d8c7ffd 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,15 +1,14 @@ -// @ts-check const { defineConfig } = require('eslint-define-config') module.exports = defineConfig({ root: true, env: { - es2021: true, + es2022: true, node: true, mocha: true }, parserOptions: { - ecmaVersion: 2021, + ecmaVersion: 2022, sourceType: 'module' }, plugins: ['promise', 'spellcheck'], @@ -18,21 +17,27 @@ module.exports = defineConfig({ 'plugin:import/recommended', 'plugin:promise/recommended' ], + settings: { + 'import/resolver': { + typescript: { + project: './tsconfig.eslint.json' + } + } + }, rules: { - 'no-void': 'off', - 'sort-imports': [ - 'warn', + 'error', { - ignoreMemberSort: true, ignoreDeclarationSort: true } ], + 'import/order': 'error', 'spellcheck/spell-checker': [ 'warn', { skipWords: [ + 'Benoit', 'benny', 'browserslist', 'builtins', @@ -42,19 +47,30 @@ module.exports = defineConfig({ 'cpu', 'cpus', 'ctx', + 'deprecations', + 'dequeue', + 'dequeued', 'ecma', + 'elu', + 'enqueue', 'enum', + 'errored', + 'esm', 'fibonacci', 'fs', 'inheritDoc', 'jsdoc', 'microjob', + 'mjs', 'num', 'os', + 'perf', 'piscina', + 'pnpm', 'poolifier', 'poolify', 'readonly', + 'resize', 'serializable', 'sinon', 'threadjs', @@ -65,7 +81,8 @@ module.exports = defineConfig({ 'unlink', 'unregister', 'utf8', - 'workerpool' + 'workerpool', + 'wwr' ], skipIfMatch: ['^@.*', '^plugin:.*'] } @@ -77,42 +94,35 @@ module.exports = defineConfig({ plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'], parser: '@typescript-eslint/parser', parserOptions: { - project: './tsconfig.json' + project: './tsconfig.eslint.json' }, extends: [ 'plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended', 'plugin:@typescript-eslint/recommended-requiring-type-checking', - 'standard-with-typescript', - 'plugin:import/typescript' + 'plugin:import/typescript', + 'standard-with-typescript' ], rules: { - // We have some intentionally empty functions - '@typescript-eslint/no-empty-function': 'off', - '@typescript-eslint/no-inferrable-types': [ 'error', { ignoreProperties: true } ], - - 'no-useless-constructor': 'off', - - 'tsdoc/syntax': 'error' + 'tsdoc/syntax': 'warn' } }, { files: ['examples/typescript/**/*.ts'], rules: { - 'import/no-unresolved': 'off', '@typescript-eslint/no-unsafe-argument': 'off', '@typescript-eslint/no-unsafe-call': 'off', '@typescript-eslint/no-unsafe-assignment': 'off' } }, { - files: ['**/*.js'], + files: ['**/*.js', '**/*.mjs'], plugins: ['jsdoc'], - extends: ['plugin:n/recommended', 'standard', 'plugin:jsdoc/recommended'] + extends: ['plugin:n/recommended', 'plugin:jsdoc/recommended', 'standard'] }, { files: ['tests/**/*.js'],