README.md: Small refinements
[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,
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: [
53 'poolifier',
5c5a1fb7
S
54 'christopher',
55 'ecma',
3832ad95 56 'enum',
5c5a1fb7 57 'jsdoc',
3832ad95 58 'pioardi',
5c5a1fb7
S
59 'readonly',
60 'serializable',
61 'unregister',
62 'workerpool'
63 ],
64 skipIfMatch: ['^@.*', '^plugin:.*']
65 }
777b7824 66 ]
3c5eaeb9
JB
67 },
68 overrides: [
50eceb07
S
69 {
70 files: ['src/**/*.ts'],
71 extends: 'plugin:jsdoc/recommended',
72 rules: {
3832ad95
S
73 'jsdoc/match-description': [
74 'warn',
75 {
76 mainDescription:
77 '/^[A-Z`].+?(\\.|:)(\\n\\n.*((\\n{1,2}- .+)|(_.+_)|`.+`|\\n\\n---))?$/us',
78 matchDescription: '^[A-Z`].+(\\.|`.+`)$',
79 contexts: ['any'],
80 tags: {
81 param: true,
82 returns: true
83 }
84 }
85 ],
50eceb07 86 'jsdoc/no-types': 'error',
3832ad95
S
87 'jsdoc/require-jsdoc': [
88 'warn',
89 {
90 contexts: [
91 'ClassDeclaration',
92 'ClassProperty:not([accessibility=/(private|protected)/])',
93 'ExportNamedDeclaration:has(VariableDeclaration)',
94 'FunctionExpression',
95 'MethodDefinition:not([accessibility=/(private|protected)/]) > FunctionExpression',
96 'TSEnumDeclaration',
97 'TSInterfaceDeclaration',
98 'TSMethodSignature',
99 // 'TSPropertySignature',
100 'TSTypeAliasDeclaration'
101 ]
102 }
103 ],
50eceb07
S
104 'jsdoc/require-param-type': 'off',
105 'jsdoc/require-returns-type': 'off'
106 }
107 },
3c5eaeb9
JB
108 {
109 files: ['*.js'],
583a27ce 110 extends: 'plugin:node/recommended',
3c5eaeb9 111 rules: {
fa699c42 112 '@typescript-eslint/no-unused-vars': 'off',
3c5eaeb9
JB
113 '@typescript-eslint/no-var-requires': 'off'
114 }
fa699c42
JB
115 },
116 {
583a27ce 117 files: ['examples/typescript/**/*.ts'],
fa699c42
JB
118 rules: {
119 'import/no-unresolved': 'off'
120 }
583a27ce
JB
121 },
122 {
123 files: ['examples/**/*.js'],
124 rules: {
125 'node/no-missing-require': 'off'
126 }
3c5eaeb9 127 }
3832ad95
S
128 ],
129 settings: {
130 jsdoc: {
131 mode: 'typescript'
132 }
133 }
777b7824 134}