]>
Commit | Line | Data |
---|---|---|
1 | module.exports = { | |
2 | env: { | |
3 | es2021: true, | |
4 | node: true, | |
5 | mocha: true | |
6 | }, | |
7 | parser: '@typescript-eslint/parser', | |
8 | parserOptions: { | |
9 | ecmaVersion: 2020, | |
10 | sourceType: 'module', | |
11 | warnOnUnsupportedTypeScriptVersion: false | |
12 | }, | |
13 | plugins: [ | |
14 | '@typescript-eslint', | |
15 | 'promise', | |
16 | 'prettierx', | |
17 | 'jsdoc', | |
18 | 'spellcheck' | |
19 | ], | |
20 | extends: [ | |
21 | 'standard', | |
22 | 'eslint:recommended', | |
23 | 'plugin:@typescript-eslint/recommended', | |
24 | 'plugin:import/errors', | |
25 | 'plugin:import/warnings', | |
26 | 'plugin:import/typescript', | |
27 | 'plugin:promise/recommended', | |
28 | 'plugin:prettierx/standardx', | |
29 | 'plugin:prettierx/@typescript-eslint' | |
30 | ], | |
31 | rules: { | |
32 | 'no-void': 'off', | |
33 | ||
34 | // We have some intentionally empty functions | |
35 | '@typescript-eslint/no-empty-function': 'off', | |
36 | ||
37 | '@typescript-eslint/no-inferrable-types': [ | |
38 | 'error', | |
39 | { ignoreProperties: true } | |
40 | ], | |
41 | ||
42 | 'sort-imports': [ | |
43 | 'warn', | |
44 | { | |
45 | ignoreMemberSort: true, | |
46 | ignoreDeclarationSort: true | |
47 | } | |
48 | ], | |
49 | ||
50 | 'spellcheck/spell-checker': [ | |
51 | 'warn', | |
52 | { | |
53 | skipWords: [ | |
54 | 'christopher', | |
55 | 'ecma', | |
56 | 'enum', | |
57 | 'inheritdoc', | |
58 | 'jsdoc', | |
59 | 'pioardi', | |
60 | 'poolifier', | |
61 | 'readonly', | |
62 | 'serializable', | |
63 | 'unregister', | |
64 | 'workerpool' | |
65 | ], | |
66 | skipIfMatch: ['^@.*', '^plugin:.*'] | |
67 | } | |
68 | ] | |
69 | }, | |
70 | overrides: [ | |
71 | { | |
72 | files: ['src/**/*.ts'], | |
73 | extends: 'plugin:jsdoc/recommended', | |
74 | rules: { | |
75 | 'no-useless-constructor': 'off', | |
76 | ||
77 | 'jsdoc/match-description': [ | |
78 | 'warn', | |
79 | { | |
80 | mainDescription: | |
81 | '/^[A-Z`].+?(\\.|:)(\\n\\n.*((\\n{1,2}- .+)|(_.+_)|`.+`|\\n\\n---))?$/us', | |
82 | matchDescription: '^[A-Z`].+(\\.|`.+`)$', | |
83 | contexts: ['any'], | |
84 | tags: { | |
85 | param: true, | |
86 | returns: true | |
87 | } | |
88 | } | |
89 | ], | |
90 | 'jsdoc/no-types': 'error', | |
91 | 'jsdoc/require-jsdoc': [ | |
92 | 'warn', | |
93 | { | |
94 | contexts: [ | |
95 | 'ClassDeclaration', | |
96 | 'ClassProperty:not([accessibility=/(private|protected)/])', | |
97 | 'ExportNamedDeclaration:has(VariableDeclaration)', | |
98 | 'FunctionExpression', | |
99 | 'MethodDefinition:not([accessibility=/(private|protected)/]) > FunctionExpression', | |
100 | 'TSEnumDeclaration', | |
101 | 'TSInterfaceDeclaration', | |
102 | 'TSMethodSignature', | |
103 | // 'TSPropertySignature', | |
104 | 'TSTypeAliasDeclaration' | |
105 | ] | |
106 | } | |
107 | ], | |
108 | 'jsdoc/require-param-type': 'off', | |
109 | 'jsdoc/require-returns-type': 'off' | |
110 | } | |
111 | }, | |
112 | { | |
113 | files: ['*.js'], | |
114 | extends: 'plugin:node/recommended', | |
115 | rules: { | |
116 | '@typescript-eslint/no-unused-vars': 'off', | |
117 | '@typescript-eslint/no-var-requires': 'off' | |
118 | } | |
119 | }, | |
120 | { | |
121 | files: ['examples/typescript/**/*.ts'], | |
122 | rules: { | |
123 | 'import/no-unresolved': 'off' | |
124 | } | |
125 | }, | |
126 | { | |
127 | files: ['examples/**/*.js'], | |
128 | rules: { | |
129 | 'node/no-missing-require': 'off' | |
130 | } | |
131 | } | |
132 | ], | |
133 | settings: { | |
134 | jsdoc: { | |
135 | mode: 'typescript' | |
136 | } | |
137 | } | |
138 | } |