build(ci): enable dependencies caching with pnpm
[poolifier.git] / .eslintrc.js
index 7448b400d0814fad77f4338920cccba9799afce0..80dcda2b7212d88878c7f2f65b426896e9a02a99 100644 (file)
@@ -4,12 +4,12 @@ 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'],
@@ -19,8 +19,6 @@ module.exports = defineConfig({
     'plugin:promise/recommended'
   ],
   rules: {
-    'no-void': 'off',
-
     'sort-imports': [
       'warn',
       {
@@ -33,6 +31,7 @@ module.exports = defineConfig({
       'warn',
       {
         skipWords: [
+          'Benoit',
           'benny',
           'browserslist',
           'builtins',
@@ -42,19 +41,27 @@ 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',
@@ -65,7 +72,8 @@ module.exports = defineConfig({
           'unlink',
           'unregister',
           'utf8',
-          'workerpool'
+          'workerpool',
+          'wwr'
         ],
         skipIfMatch: ['^@.*', '^plugin:.*']
       }
@@ -77,27 +85,21 @@ 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'
       }
     },
     {
@@ -110,9 +112,9 @@ module.exports = defineConfig({
       }
     },
     {
-      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'],