X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=.eslintrc.js;h=6c8063c8a5dcb3da31ee2f12a826b4017263bdfb;hb=3fda8d8bc479a2b0074254fc56b496cdbb878b1c;hp=16c73a1cbe8ad650e3c980702262104f8492a04c;hpb=777b7824df53fc7a599e6d7bc2f1f917f6193f0d;p=poolifier.git diff --git a/.eslintrc.js b/.eslintrc.js index 16c73a1c..6c8063c8 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -6,29 +6,93 @@ module.exports = { }, parser: '@typescript-eslint/parser', parserOptions: { - ecmaVersion: 12, + ecmaVersion: 2020, sourceType: 'module' }, - plugins: ['@typescript-eslint', 'prettierx'], + plugins: [ + '@typescript-eslint', + 'promise', + 'prettierx', + 'jsdoc', + 'spellcheck' + ], extends: [ 'standard', 'eslint:recommended', 'plugin:@typescript-eslint/recommended', + 'plugin:import/errors', + 'plugin:import/warnings', + 'plugin:import/typescript', + 'plugin:promise/recommended', 'plugin:prettierx/standardx', 'plugin:prettierx/@typescript-eslint' ], rules: { 'no-void': 'off', - // Disabled because it reports these for js files - '@typescript-eslint/no-var-requires': 'off', - // We have some intentionally empty functions '@typescript-eslint/no-empty-function': 'off', '@typescript-eslint/no-inferrable-types': [ 'error', { ignoreProperties: true } + ], + + 'sort-imports': [ + 'warn', + { + ignoreMemberSort: true, + ignoreDeclarationSort: true + } + ], + + 'spellcheck/spell-checker': [ + 'warn', + { + skipWords: [ + 'poolifier', + 'pioardi', + 'christopher', + 'ecma', + 'jsdoc', + 'readonly', + 'serializable', + 'unregister', + 'workerpool' + ], + skipIfMatch: ['^@.*', '^plugin:.*'] + } ] - } + }, + overrides: [ + { + files: ['src/**/*.ts'], + extends: 'plugin:jsdoc/recommended', + rules: { + 'jsdoc/no-types': 'error', + 'jsdoc/require-param-type': 'off', + 'jsdoc/require-returns-type': 'off' + } + }, + { + files: ['*.js'], + extends: 'plugin:node/recommended', + rules: { + '@typescript-eslint/no-unused-vars': 'off', + '@typescript-eslint/no-var-requires': 'off' + } + }, + { + files: ['examples/typescript/**/*.ts'], + rules: { + 'import/no-unresolved': 'off' + } + }, + { + files: ['examples/**/*.js'], + rules: { + 'node/no-missing-require': 'off' + } + } + ] }