build: silence linter
[poolifier.git] / .eslintrc.js
index 7448b400d0814fad77f4338920cccba9799afce0..4f57c1e21608a81ee836fc80d2122ed97881602a 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,54 +17,90 @@ module.exports = defineConfig({
     'plugin:import/recommended',
     'plugin:promise/recommended'
   ],
+  settings: {
+    'import/resolver': {
+      typescript: {
+        project: './tsconfig.json'
+      }
+    }
+  },
   rules: {
-    'no-void': 'off',
-
     'sort-imports': [
-      'warn',
+      'error',
       {
-        ignoreMemberSort: true,
         ignoreDeclarationSort: true
       }
     ],
+    'import/order': 'error',
 
     'spellcheck/spell-checker': [
       'warn',
       {
         skipWords: [
-          'benny',
+          'axios',
+          'benoit',
           'browserslist',
           'builtins',
           'christopher',
           'cjs',
+          'cloneable',
           'comparator',
           'cpu',
           'cpus',
+          'cryptographically',
           'ctx',
+          'deprecations',
+          'deque',
+          'dequeue',
+          'dequeued',
+          'deregisters',
+          'dts',
           'ecma',
+          'elu',
+          'enqueue',
           'enum',
+          'errored',
+          'esm',
+          'fastify',
           'fibonacci',
+          'fp',
           'fs',
           'inheritDoc',
+          'javascript',
           'jsdoc',
+          'localhost',
           'microjob',
+          'mjs',
+          'nodemailer',
+          'npx',
           'num',
           'os',
+          'perf',
           'piscina',
+          'pnpm',
           'poolifier',
-          'poolify',
+          'prepend',
+          'prepends',
+          'readdir',
           'readonly',
-          'serializable',
+          'req',
+          'resize',
           'sinon',
+          'smtp',
           'threadjs',
           'threadwork',
+          'tinypool',
           'tsconfig',
           'tsdoc',
           'typedoc',
           'unlink',
-          'unregister',
+          'unref',
           'utf8',
-          'workerpool'
+          'webcrypto',
+          'workerpool',
+          'ws',
+          'wss',
+          'wwr'
         ],
         skipIfMatch: ['^@.*', '^plugin:.*']
       }
@@ -80,24 +115,17 @@ module.exports = defineConfig({
         project: './tsconfig.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'
       }
     },
     {
@@ -106,13 +134,19 @@ module.exports = defineConfig({
         'import/no-unresolved': 'off',
         '@typescript-eslint/no-unsafe-argument': 'off',
         '@typescript-eslint/no-unsafe-call': 'off',
-        '@typescript-eslint/no-unsafe-assignment': 'off'
+        '@typescript-eslint/no-unsafe-return': 'off',
+        '@typescript-eslint/no-unsafe-assignment': 'off',
+        '@typescript-eslint/no-unsafe-member-access': 'off',
+        '@typescript-eslint/no-unnecessary-type-assertion': 'off',
+        '@typescript-eslint/no-redundant-type-constituents': 'off',
+        '@typescript-eslint/strict-boolean-expressions': 'off',
+        '@typescript-eslint/return-await': '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'],
@@ -127,7 +161,7 @@ module.exports = defineConfig({
       }
     },
     {
-      files: ['benchmarks/**/*.js'],
+      files: ['benchmarks/**/*.js', 'benchmarks/**/*.mjs'],
       rules: {
         'jsdoc/require-jsdoc': 'off'
       }
@@ -139,7 +173,14 @@ module.exports = defineConfig({
       }
     },
     {
-      files: ['examples/**/*.js'],
+      files: ['benchmarks/versus-external-pools/**/*.mjs'],
+      rules: {
+        'n/no-missing-import': 'off',
+        'import/no-unresolved': 'off'
+      }
+    },
+    {
+      files: ['examples/javascript/**/*.js'],
       rules: {
         'n/no-missing-require': 'off',
         'jsdoc/require-jsdoc': 'off'