feat: add fastify poolifier integration example
[poolifier.git] / .eslintrc.js
1 const { defineConfig } = require('eslint-define-config')
2
3 module.exports = defineConfig({
4 root: true,
5 env: {
6 es2022: true,
7 node: true,
8 mocha: true
9 },
10 parserOptions: {
11 ecmaVersion: 2022,
12 sourceType: 'module'
13 },
14 plugins: ['promise', 'spellcheck'],
15 extends: [
16 'eslint:recommended',
17 'plugin:import/recommended',
18 'plugin:promise/recommended'
19 ],
20 settings: {
21 'import/resolver': {
22 typescript: {
23 project: './tsconfig.eslint.json'
24 }
25 }
26 },
27 rules: {
28 'sort-imports': [
29 'error',
30 {
31 ignoreDeclarationSort: true
32 }
33 ],
34 'import/order': 'error',
35
36 'spellcheck/spell-checker': [
37 'warn',
38 {
39 skipWords: [
40 'benoit',
41 'benny',
42 'browserslist',
43 'builtins',
44 'christopher',
45 'cjs',
46 'cloneable',
47 'comparator',
48 'cpu',
49 'cpus',
50 'ctx',
51 'deprecations',
52 'dequeue',
53 'dequeued',
54 'ecma',
55 'elu',
56 'enqueue',
57 'enum',
58 'errored',
59 'esm',
60 'fastify',
61 'fibonacci',
62 'fp',
63 'fs',
64 'inheritDoc',
65 'jsdoc',
66 'microjob',
67 'mjs',
68 'num',
69 'os',
70 'perf',
71 'piscina',
72 'pnpm',
73 'poolifier',
74 'poolify',
75 'readonly',
76 'resize',
77 'sinon',
78 'threadjs',
79 'threadwork',
80 'tinypool',
81 'tsconfig',
82 'tsdoc',
83 'typedoc',
84 'unlink',
85 'unref',
86 'unregister',
87 'utf8',
88 'workerpool',
89 'wwr'
90 ],
91 skipIfMatch: ['^@.*', '^plugin:.*']
92 }
93 ]
94 },
95 overrides: [
96 {
97 files: ['**/*.ts'],
98 plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'],
99 parser: '@typescript-eslint/parser',
100 parserOptions: {
101 project: './tsconfig.eslint.json'
102 },
103 extends: [
104 'plugin:@typescript-eslint/recommended',
105 'plugin:@typescript-eslint/recommended-requiring-type-checking',
106 'plugin:import/typescript',
107 'standard-with-typescript'
108 ],
109 rules: {
110 '@typescript-eslint/no-inferrable-types': [
111 'error',
112 { ignoreProperties: true }
113 ],
114 'tsdoc/syntax': 'warn'
115 }
116 },
117 {
118 files: ['examples/typescript/**/*.ts'],
119 rules: {
120 'import/no-unresolved': 'off',
121 '@typescript-eslint/no-unsafe-argument': 'off',
122 '@typescript-eslint/no-unsafe-call': 'off',
123 '@typescript-eslint/no-unsafe-return': 'off',
124 '@typescript-eslint/no-unsafe-assignment': 'off',
125 '@typescript-eslint/no-unsafe-member-access': 'off',
126 '@typescript-eslint/no-unnecessary-type-assertion': 'off',
127 '@typescript-eslint/restrict-template-expressions': 'off'
128 }
129 },
130 {
131 files: ['**/*.js', '**/*.mjs'],
132 plugins: ['jsdoc'],
133 extends: ['plugin:n/recommended', 'plugin:jsdoc/recommended', 'standard']
134 },
135 {
136 files: ['tests/**/*.js'],
137 rules: {
138 'jsdoc/require-jsdoc': 'off'
139 }
140 },
141 {
142 files: ['tests/pools/selection-strategies/**/*.js'],
143 rules: {
144 'n/no-missing-require': 'off'
145 }
146 },
147 {
148 files: ['benchmarks/**/*.js', 'benchmarks/**/*.mjs'],
149 rules: {
150 'jsdoc/require-jsdoc': 'off'
151 }
152 },
153 {
154 files: ['benchmarks/versus-external-pools/**/*.js'],
155 rules: {
156 'n/no-missing-require': 'off'
157 }
158 },
159 {
160 files: ['benchmarks/versus-external-pools/**/*.mjs'],
161 rules: {
162 'n/no-missing-import': 'off',
163 'import/no-unresolved': 'off'
164 }
165 },
166 {
167 files: ['examples/javascript/**/*.js'],
168 rules: {
169 'n/no-missing-require': 'off',
170 'jsdoc/require-jsdoc': 'off'
171 }
172 }
173 ]
174 })