-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
70 lines (70 loc) · 2.52 KB
/
.eslintrc.js
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
module.exports = {
ignorePatterns: ['dist', 'node_modules'],
root: true,
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'jsdoc', 'simple-import-sort', 'unused-imports'],
extends: [
// including prettier here ensures that we don't set any rules which will conflict
// with Prettier's formatting. Keep it last in the list so that nothing else messes
// with it!
'prettier',
],
rules: {
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
},
],
/**
* Configuration for the JSDoc plugin rules can be found at:
* https://github.com/gajus/eslint-plugin-jsdoc
*/
// validates that the name immediately following `@param` matches the parameter name in the function signature
// this works in conjunction with "jsdoc/require-param"
'jsdoc/check-param-names': [
'error',
{
// if `checkStructured` is `true`, it asks that the JSDoc describe the fields being destructured.
// turn this off to not leak function internals/discourage describing them
checkDestructured: false,
},
],
// require that jsdoc attached to a method/function require one `@param` per parameter
'jsdoc/require-param': [
'error',
{
// if `checkStructured` is `true`, it asks that the JSDoc describe the fields being destructured.
// turn this off to not leak function internals/discourage describing them
checkDestructured: false,
// always check setters as they should require a parameter (by definition)
checkSetters: true,
},
],
'jsdoc/require-param-description': ['error'],
// rely on TypeScript types to be the source of truth, minimize verbosity in comments
'jsdoc/require-param-type': ['off'],
'jsdoc/require-returns': ['error'],
'jsdoc/require-returns-check': ['error'],
'jsdoc/require-returns-description': ['error'],
// rely on TypeScript types to be the source of truth, minimize verbosity in comments
'jsdoc/require-returns-type': ['off'],
'no-cond-assign': 'error',
'no-var': 'error',
'prefer-const': 'error',
'prefer-rest-params': 'error',
'prefer-spread': 'error',
'simple-import-sort/exports': 'error',
'simple-import-sort/imports': 'error',
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': [
'warn',
{
vars: 'all',
varsIgnorePattern: '^_',
args: 'after-used',
argsIgnorePattern: '^_',
},
],
},
};