X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=.eslintrc.js;h=80dcda2b7212d88878c7f2f65b426896e9a02a99;hb=4c15652154b608102bae65165dfa151f91569151;hp=fd8a538debf25f98ba377117efa8caf9fd582e72;hpb=ca6c7d70082311f3cc503090cf507ce36582b9b6;p=poolifier.git diff --git a/.eslintrc.js b/.eslintrc.js index fd8a538d..80dcda2b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -4,24 +4,21 @@ 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', 'jsdoc', 'spellcheck'], + plugins: ['promise', 'spellcheck'], extends: [ 'eslint:recommended', 'plugin:import/recommended', - 'plugin:jsdoc/recommended', 'plugin:promise/recommended' ], rules: { - 'no-void': 'off', - 'sort-imports': [ 'warn', { @@ -34,6 +31,7 @@ module.exports = defineConfig({ 'warn', { skipWords: [ + 'Benoit', 'benny', 'browserslist', 'builtins', @@ -43,29 +41,39 @@ module.exports = defineConfig({ 'cpu', 'cpus', 'ctx', + 'deprecations', + 'dequeue', 'ecma', + 'enqueue', 'enum', + 'errored', + 'esm', 'fibonacci', 'fs', 'inheritDoc', 'jsdoc', 'microjob', + 'mjs', 'num', 'os', 'piscina', + 'pnpm', 'poolifier', 'poolify', 'readonly', + 'resize', 'serializable', 'sinon', 'threadjs', 'threadwork', 'tsconfig', + 'tsdoc', 'typedoc', 'unlink', 'unregister', 'utf8', - 'workerpool' + 'workerpool', + 'wwr' ], skipIfMatch: ['^@.*', '^plugin:.*'] } @@ -74,74 +82,39 @@ module.exports = defineConfig({ overrides: [ { files: ['**/*.ts'], + plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'], parser: '@typescript-eslint/parser', parserOptions: { - project: './tsconfig.json' + project: './tsconfig.eslint.json' }, - plugins: ['@typescript-eslint'], 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', - - 'jsdoc/match-description': [ - 'warn', - { - contexts: ['any'], - tags: { - param: true, - returns: true - } - } - ], - 'jsdoc/no-types': 'error', - 'jsdoc/require-jsdoc': [ - 'warn', - { - contexts: [ - 'ClassDeclaration', - 'ClassProperty:not([accessibility=/(private|protected)/])', - 'ExportNamedDeclaration:has(VariableDeclaration)', - 'FunctionExpression', - 'MethodDefinition:not([accessibility=/(private|protected)/]) > FunctionExpression', - 'TSEnumDeclaration', - 'TSInterfaceDeclaration', - 'TSMethodSignature', - // 'TSPropertySignature', - 'TSTypeAliasDeclaration' - ] - } - ], - 'jsdoc/require-param-type': 'off', - 'jsdoc/require-returns-type': 'off' + 'tsdoc/syntax': 'warn' } }, { files: ['examples/typescript/**/*.ts'], rules: { 'import/no-unresolved': 'off', - 'jsdoc/require-jsdoc': 'off', '@typescript-eslint/no-unsafe-argument': 'off', '@typescript-eslint/no-unsafe-call': 'off', '@typescript-eslint/no-unsafe-assignment': 'off' } }, { - files: ['**/*.js'], - extends: ['plugin:n/recommended', 'standard'] + files: ['**/*.js', '**/*.mjs'], + plugins: ['jsdoc'], + extends: ['plugin:n/recommended', 'plugin:jsdoc/recommended', 'standard'] }, { files: ['tests/**/*.js'], @@ -174,10 +147,5 @@ module.exports = defineConfig({ 'jsdoc/require-jsdoc': 'off' } } - ], - settings: { - jsdoc: { - mode: 'typescript' - } - } + ] })