X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=.eslintrc.js;h=7448b400d0814fad77f4338920cccba9799afce0;hb=fb78f5c0d5c578e2dfa40193059a9b671f0cd126;hp=419b7e67a7b2ea3a1c71b0168ab87e50cb3dd566;hpb=2f8c5b5c1182f698efe07d327359bef934af3a29;p=poolifier.git diff --git a/.eslintrc.js b/.eslintrc.js index 419b7e67..7448b400 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -2,6 +2,7 @@ const { defineConfig } = require('eslint-define-config') module.exports = defineConfig({ + root: true, env: { es2021: true, node: true, @@ -11,14 +12,11 @@ module.exports = defineConfig({ ecmaVersion: 2021, sourceType: 'module' }, - plugins: ['promise', 'prettierx', 'jsdoc', 'spellcheck'], + plugins: ['promise', 'spellcheck'], extends: [ - 'standard', 'eslint:recommended', 'plugin:import/recommended', - 'plugin:jsdoc/recommended', - 'plugin:promise/recommended', - 'plugin:prettierx/standardx' + 'plugin:promise/recommended' ], rules: { 'no-void': 'off', @@ -35,7 +33,9 @@ module.exports = defineConfig({ 'warn', { skipWords: [ + 'benny', 'browserslist', + 'builtins', 'christopher', 'cjs', 'comparator', @@ -60,6 +60,7 @@ module.exports = defineConfig({ 'threadjs', 'threadwork', 'tsconfig', + 'tsdoc', 'typedoc', 'unlink', 'unregister', @@ -73,15 +74,16 @@ module.exports = defineConfig({ overrides: [ { files: ['**/*.ts'], + plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'], parser: '@typescript-eslint/parser', parserOptions: { project: './tsconfig.json' }, - plugins: ['@typescript-eslint'], extends: [ 'plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended', 'plugin:@typescript-eslint/recommended-requiring-type-checking', + 'standard-with-typescript', 'plugin:import/typescript' ], rules: { @@ -95,43 +97,13 @@ module.exports = defineConfig({ 'no-useless-constructor': 'off', - 'jsdoc/match-description': [ - 'warn', - { - contexts: ['any'], - tags: { - param: true, - returns: true - } - } - ], - 'jsdoc/no-types': 'error', - 'jsdoc/require-jsdoc': [ - 'warn', - { - contexts: [ - 'ClassDeclaration', - 'ClassProperty:not([accessibility=/(private|protected)/])', - 'ExportNamedDeclaration:has(VariableDeclaration)', - 'FunctionExpression', - 'MethodDefinition:not([accessibility=/(private|protected)/]) > FunctionExpression', - 'TSEnumDeclaration', - 'TSInterfaceDeclaration', - 'TSMethodSignature', - // 'TSPropertySignature', - 'TSTypeAliasDeclaration' - ] - } - ], - 'jsdoc/require-param-type': 'off', - 'jsdoc/require-returns-type': 'off' + 'tsdoc/syntax': 'error' } }, { files: ['examples/typescript/**/*.ts'], rules: { 'import/no-unresolved': 'off', - 'jsdoc/require-jsdoc': 'off', '@typescript-eslint/no-unsafe-argument': 'off', '@typescript-eslint/no-unsafe-call': 'off', '@typescript-eslint/no-unsafe-assignment': 'off' @@ -139,7 +111,8 @@ module.exports = defineConfig({ }, { files: ['**/*.js'], - extends: ['plugin:n/recommended'] + plugins: ['jsdoc'], + extends: ['plugin:n/recommended', 'standard', 'plugin:jsdoc/recommended'] }, { files: ['tests/**/*.js'], @@ -172,10 +145,5 @@ module.exports = defineConfig({ 'jsdoc/require-jsdoc': 'off' } } - ], - settings: { - jsdoc: { - mode: 'typescript' - } - } + ] })