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