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