-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
40 lines (39 loc) · 1.06 KB
/
eslint.config.js
File metadata and controls
40 lines (39 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import jsdoc from 'eslint-plugin-jsdoc'
import { fixupPluginRules } from '@eslint/compat'
import prettierConfig from 'eslint-config-prettier'
export default [
{
ignores: ['node_modules/**', 'dist/**', 'coverage/**'],
},
{
files: ['src/**/*.js', 'tests/**/*.js'],
plugins: {
jsdoc: fixupPluginRules(jsdoc),
},
rules: {
// JSDoc rules — enforce type documentation on public APIs
'jsdoc/require-jsdoc': [
'error',
{
require: {
FunctionDeclaration: true,
MethodDefinition: false,
ClassDeclaration: false,
},
publicOnly: true,
},
],
'jsdoc/require-param': 'warn',
'jsdoc/require-param-type': 'warn',
'jsdoc/require-returns': 'warn',
'jsdoc/require-returns-type': 'warn',
'jsdoc/valid-types': 'error',
// General
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'no-console': ['warn', { allow: ['error'] }],
'prefer-const': 'error',
'no-var': 'error',
},
},
prettierConfig,
]