chore: v2.6.16
[poolifier.git] / .eslintrc.js
index bdf03e9c964623a1e09cf94426d11fa31575841f..f981727ab3800ebe3efd391953978767f5e4b162 100644 (file)
@@ -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,52 +17,73 @@ module.exports = defineConfig({
     'plugin:import/recommended',
     'plugin:promise/recommended'
   ],
+  settings: {
+    'import/resolver': {
+      typescript: {
+        project: './tsconfig.eslint.json'
+      }
+    }
+  },
   rules: {
     'sort-imports': [
-      'warn',
+      'error',
       {
-        ignoreMemberSort: true,
         ignoreDeclarationSort: true
       }
     ],
+    'import/order': 'error',
 
     'spellcheck/spell-checker': [
       'warn',
       {
         skipWords: [
+          'Benoit',
           'benny',
           'browserslist',
           'builtins',
           'christopher',
           'cjs',
+          'cloneable',
           'comparator',
           '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',
-          'serializable',
+          'resize',
           'sinon',
           'threadjs',
           'threadwork',
+          'tinypool',
           'tsconfig',
           'tsdoc',
           'typedoc',
           'unlink',
           'unregister',
           'utf8',
-          'workerpool'
+          'workerpool',
+          'wwr'
         ],
         skipIfMatch: ['^@.*', '^plugin:.*']
       }
@@ -75,10 +95,9 @@ 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',
         'plugin:import/typescript',
@@ -89,20 +108,19 @@ module.exports = defineConfig({
           'error',
           { ignoreProperties: true }
         ],
-        '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', 'plugin:jsdoc/recommended', 'standard']
     },
@@ -119,7 +137,7 @@ module.exports = defineConfig({
       }
     },
     {
-      files: ['benchmarks/**/*.js'],
+      files: ['benchmarks/**/*.js', 'benchmarks/**/*.mjs'],
       rules: {
         'jsdoc/require-jsdoc': 'off'
       }
@@ -130,6 +148,13 @@ module.exports = defineConfig({
         'n/no-missing-require': 'off'
       }
     },
+    {
+      files: ['benchmarks/versus-external-pools/**/*.mjs'],
+      rules: {
+        'n/no-missing-import': 'off',
+        'import/no-unresolved': 'off'
+      }
+    },
     {
       files: ['examples/**/*.js'],
       rules: {