Commit | Line | Data |
---|---|---|
6a6e81d0 S |
1 | const { defineConfig } = require('eslint-define-config') |
2 | ||
3 | module.exports = defineConfig({ | |
97c16550 | 4 | root: true, |
777b7824 | 5 | env: { |
54541487 | 6 | es2022: true, |
777b7824 S |
7 | node: true, |
8 | mocha: true | |
9 | }, | |
6d0425b4 | 10 | parserOptions: { |
ded253e2 JB |
11 | sourceType: 'module', |
12 | ecmaVersion: 2022 | |
6d0425b4 | 13 | }, |
ded253e2 | 14 | plugins: ['simple-import-sort', 'promise', 'spellcheck'], |
777b7824 | 15 | extends: [ |
777b7824 | 16 | 'eslint:recommended', |
305aeaa7 | 17 | 'plugin:import/recommended', |
78cea37e | 18 | 'plugin:promise/recommended' |
777b7824 | 19 | ], |
b70e9c5e JB |
20 | settings: { |
21 | 'import/resolver': { | |
22 | typescript: { | |
7d1fc6d3 | 23 | project: './tsconfig.json' |
b70e9c5e JB |
24 | } |
25 | } | |
26 | }, | |
777b7824 | 27 | rules: { |
ded253e2 JB |
28 | 'simple-import-sort/imports': 'error', |
29 | 'simple-import-sort/exports': 'error', | |
5c5a1fb7 S |
30 | |
31 | 'spellcheck/spell-checker': [ | |
32 | 'warn', | |
33 | { | |
34 | skipWords: [ | |
d68ce4c6 | 35 | 'axios', |
494d9576 | 36 | 'benoit', |
fe2f6f84 | 37 | 'browserslist', |
e4bc7a49 | 38 | 'builtins', |
5c5a1fb7 | 39 | 'christopher', |
7a6a0a96 | 40 | 'cjs', |
e102732c | 41 | 'cloneable', |
74750c7f | 42 | 'comparator', |
23ff945a JB |
43 | 'cpu', |
44 | 'cpus', | |
147be6fe | 45 | 'cryptographically', |
7a6a0a96 | 46 | 'ctx', |
30eafb1e | 47 | 'deprecations', |
574b351d | 48 | 'deque', |
adc3c320 | 49 | 'dequeue', |
a0d41544 | 50 | 'dequeued', |
dad86fd8 | 51 | 'deregisters', |
b40c4b06 | 52 | 'dts', |
5c5a1fb7 | 53 | 'ecma', |
62c15a68 | 54 | 'elu', |
adc3c320 | 55 | 'enqueue', |
3832ad95 | 56 | 'enum', |
02706357 | 57 | 'errored', |
e5a5c0fc | 58 | 'esm', |
a8706532 | 59 | 'fastify', |
bdaf31cd | 60 | 'fibonacci', |
a8706532 | 61 | 'fp', |
7a6a0a96 | 62 | 'fs', |
e97e8563 | 63 | 'func', |
a76fac14 | 64 | 'inheritDoc', |
02999424 | 65 | 'javascript', |
5c5a1fb7 | 66 | 'jsdoc', |
a29a2fac | 67 | 'linebreak', |
72855e92 | 68 | 'localhost', |
7a6a0a96 | 69 | 'microjob', |
fe18768d | 70 | 'mjs', |
3c5dc3fb | 71 | 'nodemailer', |
2ab81545 | 72 | 'npx', |
fe2f6f84 | 73 | 'num', |
23ff945a | 74 | 'os', |
62c15a68 | 75 | 'perf', |
7a6a0a96 | 76 | 'piscina', |
8d75fd5f | 77 | 'pnpm', |
a35560ba | 78 | 'poolifier', |
574b351d JB |
79 | 'prepend', |
80 | 'prepends', | |
02999424 | 81 | 'readdir', |
5c5a1fb7 | 82 | 'readonly', |
167c661c | 83 | 'req', |
d21911e6 | 84 | 'resize', |
a3809289 | 85 | 'sinon', |
9aef1431 | 86 | 'smtp', |
7a6a0a96 JB |
87 | 'threadjs', |
88 | 'threadwork', | |
afd32690 | 89 | 'tinypool', |
7d82d90e | 90 | 'tsconfig', |
38e795c1 | 91 | 'tsdoc', |
fe2f6f84 | 92 | 'typedoc', |
7a6a0a96 | 93 | 'unlink', |
dcd9851c | 94 | 'unref', |
7a6a0a96 | 95 | 'utf8', |
2fc5cae3 | 96 | 'workerpool', |
72855e92 JB |
97 | 'ws', |
98 | 'wss', | |
2fc5cae3 | 99 | 'wwr' |
5c5a1fb7 S |
100 | ], |
101 | skipIfMatch: ['^@.*', '^plugin:.*'] | |
102 | } | |
777b7824 | 103 | ] |
3c5eaeb9 JB |
104 | }, |
105 | overrides: [ | |
50eceb07 | 106 | { |
a17cc27a | 107 | files: ['**/*.ts'], |
38e795c1 | 108 | plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'], |
815d4289 | 109 | parser: '@typescript-eslint/parser', |
f3636726 | 110 | parserOptions: { |
7d1fc6d3 | 111 | project: './tsconfig.json' |
f3636726 | 112 | }, |
a17cc27a | 113 | extends: [ |
c63a35a0 JB |
114 | 'plugin:@typescript-eslint/strict-type-checked', |
115 | 'plugin:@typescript-eslint/stylistic-type-checked', | |
3aa14de1 | 116 | 'plugin:import/typescript', |
7471ae6b | 117 | 'love' |
a17cc27a | 118 | ], |
50eceb07 | 119 | rules: { |
67f3f2d6 | 120 | 'operator-linebreak': 'off', |
afc003b2 | 121 | 'tsdoc/syntax': 'warn' |
50eceb07 S |
122 | } |
123 | }, | |
7a6a0a96 JB |
124 | { |
125 | files: ['examples/typescript/**/*.ts'], | |
126 | rules: { | |
26bb464f JB |
127 | 'import/no-unresolved': [ |
128 | 'error', | |
129 | { | |
130 | ignore: [ | |
131 | '^axios$', | |
132 | '^express$', | |
133 | '^fastify$', | |
134 | '^fastify-plugin$', | |
135 | '^node-fetch$', | |
136 | '^nodemailer$', | |
137 | '^poolifier$', | |
138 | '^ws$' | |
139 | ] | |
140 | } | |
141 | ], | |
7288e334 | 142 | '@typescript-eslint/no-unsafe-argument': 'off', |
7a6a0a96 | 143 | '@typescript-eslint/no-unsafe-call': 'off', |
7288e334 | 144 | '@typescript-eslint/no-unsafe-return': 'off', |
95e50651 | 145 | '@typescript-eslint/no-unsafe-assignment': 'off', |
7288e334 JB |
146 | '@typescript-eslint/no-unsafe-member-access': 'off', |
147 | '@typescript-eslint/no-unnecessary-type-assertion': 'off', | |
417b3b41 | 148 | '@typescript-eslint/no-redundant-type-constituents': 'off', |
7288e334 | 149 | '@typescript-eslint/strict-boolean-expressions': 'off', |
8b81cdcf | 150 | '@typescript-eslint/return-await': 'off', |
67f3f2d6 | 151 | '@typescript-eslint/no-non-null-assertion': 'off' |
7a6a0a96 JB |
152 | } |
153 | }, | |
3c5eaeb9 | 154 | { |
28883f84 | 155 | files: ['**/*.cjs', '**/*.js', '**/*.mjs'], |
38e795c1 | 156 | plugins: ['jsdoc'], |
3aa14de1 | 157 | extends: ['plugin:n/recommended', 'plugin:jsdoc/recommended', 'standard'] |
fa699c42 JB |
158 | }, |
159 | { | |
28883f84 | 160 | files: ['tests/**/*.cjs', 'tests/**/*.js', 'tests/**/*.mjs'], |
305aeaa7 JB |
161 | rules: { |
162 | 'jsdoc/require-jsdoc': 'off' | |
163 | } | |
164 | }, | |
165 | { | |
28883f84 JB |
166 | files: [ |
167 | 'benchmarks/**/*.cjs', | |
168 | 'benchmarks/**/*.js', | |
169 | 'benchmarks/**/*.mjs' | |
170 | ], | |
fa699c42 | 171 | rules: { |
a17cc27a | 172 | 'jsdoc/require-jsdoc': 'off' |
fa699c42 | 173 | } |
583a27ce JB |
174 | }, |
175 | { | |
28883f84 | 176 | files: ['examples/javascript/**/*.cjs', 'examples/javascript/**/*.js'], |
583a27ce | 177 | rules: { |
305aeaa7 JB |
178 | 'jsdoc/require-jsdoc': 'off' |
179 | } | |
3c5eaeb9 | 180 | } |
38e795c1 | 181 | ] |
6a6e81d0 | 182 | }) |