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