fix: ensure task function ops sync worker choice strategies
[poolifier.git] / .eslintrc.cjs
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 sourceType: 'module',
12 ecmaVersion: 2022
13 },
14 plugins: ['simple-import-sort', '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.json'
24 }
25 }
26 },
27 rules: {
28 'simple-import-sort/imports': 'error',
29 'simple-import-sort/exports': 'error',
30
31 'spellcheck/spell-checker': [
32 'warn',
33 {
34 skipWords: [
35 'argv',
36 'axios',
37 'benoit',
38 'browserslist',
39 'builtins',
40 'christopher',
41 'cjs',
42 'cloneable',
43 'comparator',
44 'cpu',
45 'cpus',
46 'cryptographically',
47 'ctx',
48 'deduped',
49 'deprecations',
50 'deque',
51 'dequeue',
52 'dequeued',
53 'deregisters',
54 'dts',
55 'ecma',
56 'elu',
57 'enqueue',
58 'enum',
59 'errored',
60 'esm',
61 'fastify',
62 'fibonacci',
63 'fp',
64 'fs',
65 'func',
66 'inheritDoc',
67 'javascript',
68 'jsdoc',
69 'linebreak',
70 'localhost',
71 'microjob',
72 'mjs',
73 'nodemailer',
74 'npx',
75 'num',
76 'os',
77 'perf',
78 'piscina',
79 'pnpm',
80 'poolifier',
81 'prepend',
82 'prepends',
83 'positionals',
84 'readdir',
85 'readonly',
86 'req',
87 'resize',
88 'sinon',
89 'smtp',
90 'threadjs',
91 'threadwork',
92 'tinypool',
93 'tld',
94 'tos',
95 'tsconfig',
96 'tsdoc',
97 'typedoc',
98 'unlink',
99 'unref',
100 'utf8',
101 'workerpool',
102 'ws',
103 'wss',
104 'wwr'
105 ],
106 skipIfMatch: ['^@.*', '^plugin:.*']
107 }
108 ]
109 },
110 overrides: [
111 {
112 files: ['**/*.ts'],
113 plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'],
114 parser: '@typescript-eslint/parser',
115 parserOptions: {
116 project: './tsconfig.json'
117 },
118 extends: [
119 'plugin:@typescript-eslint/strict-type-checked',
120 'plugin:@typescript-eslint/stylistic-type-checked',
121 'plugin:import/typescript',
122 'love'
123 ],
124 rules: {
125 'operator-linebreak': 'off',
126 'tsdoc/syntax': 'warn'
127 }
128 },
129 {
130 files: ['examples/typescript/**/*.ts'],
131 rules: {
132 'import/no-unresolved': [
133 'error',
134 {
135 ignore: [
136 '^axios$',
137 '^express$',
138 '^fastify$',
139 '^fastify-plugin$',
140 '^node-fetch$',
141 '^nodemailer$',
142 '^poolifier$',
143 '^ws$'
144 ]
145 }
146 ],
147 '@typescript-eslint/no-unsafe-argument': 'off',
148 '@typescript-eslint/no-unsafe-call': 'off',
149 '@typescript-eslint/no-unsafe-return': 'off',
150 '@typescript-eslint/no-unsafe-assignment': 'off',
151 '@typescript-eslint/no-unsafe-member-access': 'off',
152 '@typescript-eslint/no-unnecessary-type-assertion': 'off',
153 '@typescript-eslint/no-redundant-type-constituents': 'off',
154 '@typescript-eslint/strict-boolean-expressions': 'off',
155 '@typescript-eslint/return-await': 'off',
156 '@typescript-eslint/no-non-null-assertion': 'off'
157 }
158 },
159 {
160 files: ['**/*.cjs', '**/*.js', '**/*.mjs'],
161 plugins: ['jsdoc'],
162 extends: ['plugin:n/recommended', 'plugin:jsdoc/recommended', 'standard']
163 },
164 {
165 files: ['tests/**/*.cjs', 'tests/**/*.js', 'tests/**/*.mjs'],
166 rules: {
167 'jsdoc/require-jsdoc': 'off'
168 }
169 },
170 {
171 files: [
172 'benchmarks/**/*.cjs',
173 'benchmarks/**/*.js',
174 'benchmarks/**/*.mjs'
175 ],
176 rules: {
177 'jsdoc/require-jsdoc': 'off'
178 }
179 },
180 {
181 files: ['examples/javascript/**/*.cjs', 'examples/javascript/**/*.js'],
182 rules: {
183 'jsdoc/require-jsdoc': 'off'
184 }
185 }
186 ]
187 })