X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=.eslintrc.js;h=9bf41f268ea143ee9841e6575ac2f6c9223aa8fd;hb=9aef1431cbefd8bf1fc48654c94cc464243e0113;hp=6dcbf08c555060355cb041c17d01eb5f1e60a85e;hpb=545414871fbd3e07078d87cacfe86436839643f0;p=poolifier.git diff --git a/.eslintrc.js b/.eslintrc.js index 6dcbf08c..9bf41f26 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,4 +1,3 @@ -// @ts-check const { defineConfig } = require('eslint-define-config') module.exports = defineConfig({ @@ -18,52 +17,85 @@ 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: [ + 'axios', + 'benoit', 'benny', 'browserslist', 'builtins', 'christopher', 'cjs', + 'cloneable', 'comparator', 'cpu', 'cpus', 'ctx', + 'deprecations', + 'dequeue', + 'dequeued', 'ecma', + 'elu', + 'enqueue', 'enum', + 'errored', + 'esm', + 'fastify', 'fibonacci', + 'fp', 'fs', 'inheritDoc', + 'javascript', 'jsdoc', + 'localhost', 'microjob', + 'mjs', + 'npx', 'num', 'os', + 'perf', 'piscina', + 'pnpm', 'poolifier', 'poolify', + 'readdir', 'readonly', - 'serializable', + 'req', + 'resize', 'sinon', + 'smtp', 'threadjs', 'threadwork', + 'tinypool', 'tsconfig', 'tsdoc', 'typedoc', 'unlink', + 'unref', 'unregister', 'utf8', - 'workerpool' + 'workerpool', + 'ws', + 'wss', + 'wwr' ], skipIfMatch: ['^@.*', '^plugin:.*'] } @@ -75,10 +107,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,7 +120,7 @@ module.exports = defineConfig({ 'error', { ignoreProperties: true } ], - 'tsdoc/syntax': 'error' + 'tsdoc/syntax': 'warn' } }, { @@ -98,11 +129,16 @@ 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/strict-boolean-expressions': 'off', + '@typescript-eslint/return-await': 'off' } }, { - files: ['**/*.js'], + files: ['**/*.js', '**/*.mjs'], plugins: ['jsdoc'], extends: ['plugin:n/recommended', 'plugin:jsdoc/recommended', 'standard'] }, @@ -119,7 +155,7 @@ module.exports = defineConfig({ } }, { - files: ['benchmarks/**/*.js'], + files: ['benchmarks/**/*.js', 'benchmarks/**/*.mjs'], rules: { 'jsdoc/require-jsdoc': 'off' } @@ -131,7 +167,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'