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