module.exports = defineConfig({
root: true,
env: {
- es2021: true,
+ es2022: true,
node: true,
mocha: true
},
parserOptions: {
- ecmaVersion: 2021,
+ ecmaVersion: 2022,
sourceType: 'module'
},
- plugins: ['promise', 'jsdoc', 'spellcheck'],
+ plugins: ['promise', 'spellcheck'],
extends: [
'eslint:recommended',
'plugin:import/recommended',
- 'plugin:jsdoc/recommended',
'plugin:promise/recommended'
],
rules: {
- 'no-void': 'off',
-
'sort-imports': [
'warn',
{
'warn',
{
skipWords: [
+ 'benny',
'browserslist',
'builtins',
'christopher',
'threadjs',
'threadwork',
'tsconfig',
+ 'tsdoc',
'typedoc',
'unlink',
'unregister',
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'
+ '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',
-
- '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'
},
{
files: ['**/*.js'],
- extends: ['plugin:n/recommended', 'standard']
+ plugins: ['jsdoc'],
+ extends: ['plugin:n/recommended', 'plugin:jsdoc/recommended', 'standard']
},
{
files: ['tests/**/*.js'],
'jsdoc/require-jsdoc': 'off'
}
}
- ],
- settings: {
- jsdoc: {
- mode: 'typescript'
- }
- }
+ ]
})