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