chore: v2.4.7
[poolifier.git] / .eslintrc.js
index c45d2501f2feb0959498a389337bd2a9cdb32bd4..ae288a7c0ae81acc761208fa7045df0dce0e5eef 100644 (file)
@@ -4,26 +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', 'prettierx', 'jsdoc', 'spellcheck'],
+  plugins: ['promise', 'spellcheck'],
   extends: [
-    'standard',
     'eslint:recommended',
     'plugin:import/recommended',
-    'plugin:jsdoc/recommended',
-    'plugin:promise/recommended',
-    'plugin:prettierx/standardx'
+    'plugin:promise/recommended'
   ],
   rules: {
-    'no-void': 'off',
-
     'sort-imports': [
       'warn',
       {
@@ -36,6 +31,8 @@ module.exports = defineConfig({
       'warn',
       {
         skipWords: [
+          'Benoit',
+          'benny',
           'browserslist',
           'builtins',
           'christopher',
@@ -44,24 +41,32 @@ module.exports = defineConfig({
           'cpu',
           'cpus',
           'ctx',
+          'deprecations',
+          'dequeue',
           'ecma',
+          'enqueue',
           'enum',
+          'esm',
           'fibonacci',
           'fs',
           'inheritDoc',
           'jsdoc',
           'microjob',
+          'mjs',
           'num',
           'os',
           'piscina',
+          'pnpm',
           'poolifier',
           'poolify',
           'readonly',
+          'resize',
           'serializable',
           'sinon',
           'threadjs',
           'threadwork',
           'tsconfig',
+          'tsdoc',
           'typedoc',
           'unlink',
           'unregister',
@@ -75,73 +80,39 @@ module.exports = defineConfig({
   overrides: [
     {
       files: ['**/*.ts'],
+      plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'],
       parser: '@typescript-eslint/parser',
       parserOptions: {
         project: './tsconfig.json'
       },
-      plugins: ['@typescript-eslint'],
       extends: [
         'plugin:@typescript-eslint/eslint-recommended',
         'plugin:@typescript-eslint/recommended',
         'plugin:@typescript-eslint/recommended-requiring-type-checking',
-        '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']
+      files: ['**/*.js', '**/*.mjs'],
+      plugins: ['jsdoc'],
+      extends: ['plugin:n/recommended', 'plugin:jsdoc/recommended', 'standard']
     },
     {
       files: ['tests/**/*.js'],
@@ -174,10 +145,5 @@ module.exports = defineConfig({
         'jsdoc/require-jsdoc': 'off'
       }
     }
-  ],
-  settings: {
-    jsdoc: {
-      mode: 'typescript'
-    }
-  }
+  ]
 })