feat: use monotonic high resolution timer for worker tasks statistics
[poolifier.git] / .eslintrc.js
1 // @ts-check
2 const { defineConfig } = require('eslint-define-config')
3
4 module.exports = defineConfig({
5 root: true,
6 env: {
7 es2022: true,
8 node: true,
9 mocha: true
10 },
11 parserOptions: {
12 ecmaVersion: 2022,
13 sourceType: 'module'
14 },
15 plugins: ['promise', 'spellcheck'],
16 extends: [
17 'eslint:recommended',
18 'plugin:import/recommended',
19 'plugin:promise/recommended'
20 ],
21 rules: {
22 'sort-imports': [
23 'warn',
24 {
25 ignoreMemberSort: true,
26 ignoreDeclarationSort: true
27 }
28 ],
29
30 'spellcheck/spell-checker': [
31 'warn',
32 {
33 skipWords: [
34 'benny',
35 'browserslist',
36 'builtins',
37 'christopher',
38 'cjs',
39 'comparator',
40 'cpu',
41 'cpus',
42 'ctx',
43 'deprecations',
44 'ecma',
45 'enum',
46 'esm',
47 'fibonacci',
48 'fs',
49 'hrtime',
50 'inheritDoc',
51 'jsdoc',
52 'microjob',
53 'mjs',
54 'num',
55 'os',
56 'piscina',
57 'pnpm',
58 'poolifier',
59 'poolify',
60 'readonly',
61 'serializable',
62 'sinon',
63 'threadjs',
64 'threadwork',
65 'tsconfig',
66 'tsdoc',
67 'typedoc',
68 'unlink',
69 'unregister',
70 'utf8',
71 'workerpool'
72 ],
73 skipIfMatch: ['^@.*', '^plugin:.*']
74 }
75 ]
76 },
77 overrides: [
78 {
79 files: ['**/*.ts'],
80 plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'],
81 parser: '@typescript-eslint/parser',
82 parserOptions: {
83 project: './tsconfig.json'
84 },
85 extends: [
86 'plugin:@typescript-eslint/eslint-recommended',
87 'plugin:@typescript-eslint/recommended',
88 'plugin:@typescript-eslint/recommended-requiring-type-checking',
89 'plugin:import/typescript',
90 'standard-with-typescript'
91 ],
92 rules: {
93 '@typescript-eslint/no-inferrable-types': [
94 'error',
95 { ignoreProperties: true }
96 ],
97 'tsdoc/syntax': 'warn'
98 }
99 },
100 {
101 files: ['examples/typescript/**/*.ts'],
102 rules: {
103 'import/no-unresolved': 'off',
104 '@typescript-eslint/no-unsafe-argument': 'off',
105 '@typescript-eslint/no-unsafe-call': 'off',
106 '@typescript-eslint/no-unsafe-assignment': 'off'
107 }
108 },
109 {
110 files: ['**/*.js', '**/*.mjs'],
111 plugins: ['jsdoc'],
112 extends: ['plugin:n/recommended', 'plugin:jsdoc/recommended', 'standard']
113 },
114 {
115 files: ['tests/**/*.js'],
116 rules: {
117 'jsdoc/require-jsdoc': 'off'
118 }
119 },
120 {
121 files: ['tests/pools/selection-strategies/**/*.js'],
122 rules: {
123 'n/no-missing-require': 'off'
124 }
125 },
126 {
127 files: ['benchmarks/**/*.js'],
128 rules: {
129 'jsdoc/require-jsdoc': 'off'
130 }
131 },
132 {
133 files: ['benchmarks/versus-external-pools/**/*.js'],
134 rules: {
135 'n/no-missing-require': 'off'
136 }
137 },
138 {
139 files: ['examples/**/*.js'],
140 rules: {
141 'n/no-missing-require': 'off',
142 'jsdoc/require-jsdoc': 'off'
143 }
144 }
145 ]
146 })