Commit | Line | Data |
---|---|---|
147d7c42 JB |
1 | import cspellConfigs from '@cspell/eslint-plugin/configs' |
2 | import js from '@eslint/js' | |
3 | import { defineFlatConfig } from 'eslint-define-config' | |
4 | import jsdoc from 'eslint-plugin-jsdoc' | |
5 | import nodePlugin from 'eslint-plugin-n' | |
6 | import simpleImportSort from 'eslint-plugin-simple-import-sort' | |
7 | import globals from 'globals' | |
8 | import neostandard from 'neostandard' | |
9 | // eslint-disable-next-line n/no-extraneous-import | |
10 | import tseslint from 'typescript-eslint' | |
11 | ||
12 | export default defineFlatConfig([ | |
13 | { | |
14 | ignores: ['docs/**', '**/dist/**', 'lib/**', 'outputs/**'], | |
15 | }, | |
16 | cspellConfigs.recommended, | |
17 | js.configs.recommended, | |
18 | ...nodePlugin.configs['flat/mixed-esm-and-cjs'], | |
19 | jsdoc.configs['flat/recommended-typescript'], | |
147d7c42 JB |
20 | ...tseslint.config(...tseslint.configs.strict, ...tseslint.configs.stylistic), |
21 | ...neostandard({ | |
22 | ts: true, | |
23 | globals: { | |
24 | ...globals.node, | |
25 | ...globals.mocha, | |
26 | }, | |
27 | }), | |
260bb737 JB |
28 | // ...tseslint.config( |
29 | // ...tseslint.configs.strictTypeChecked, | |
30 | // ...tseslint.configs.stylisticTypeChecked, | |
31 | // { | |
32 | // languageOptions: { | |
33 | // parserOptions: { | |
34 | // project: true, | |
35 | // tsconfigRootDir: import.meta.dirname, | |
36 | // }, | |
37 | // }, | |
38 | // } | |
39 | // ), | |
147d7c42 JB |
40 | { |
41 | plugins: { | |
42 | 'simple-import-sort': simpleImportSort, | |
43 | }, | |
44 | rules: { | |
01caf779 JB |
45 | '@cspell/spellchecker': [ |
46 | 'warn', | |
47 | { | |
48 | autoFix: true, | |
49 | cspell: { | |
50 | words: [ | |
51 | 'Alessandro', | |
52 | 'Ardizio', | |
53 | 'Benoit', | |
54 | 'IWRR', | |
55 | 'Quadflieg', | |
56 | 'neostandard', | |
57 | 'poolifier', | |
58 | 'tseslint', | |
59 | ], | |
60 | }, | |
61 | }, | |
62 | ], | |
147d7c42 JB |
63 | 'simple-import-sort/imports': 'error', |
64 | 'simple-import-sort/exports': 'error', | |
65 | }, | |
66 | }, | |
67 | { | |
68 | files: [ | |
69 | 'src/pools/selection-strategies/fair-share-worker-choice-strategy.ts', | |
70 | ], | |
71 | rules: { | |
72 | '@stylistic/operator-linebreak': 'off', | |
73 | }, | |
74 | }, | |
e56903ca JB |
75 | { |
76 | files: ['examples/**/*.ts'], | |
77 | rules: { | |
78 | 'no-undef': 'off', | |
79 | }, | |
80 | }, | |
147d7c42 | 81 | { |
937e8172 | 82 | files: ['examples/**/*.js', 'examples/**/*.cjs'], |
147d7c42 | 83 | rules: { |
54050139 JB |
84 | 'n/no-missing-import': [ |
85 | 'error', | |
86 | { | |
87 | allowModules: ['ws'], | |
88 | }, | |
89 | ], | |
147d7c42 JB |
90 | '@typescript-eslint/no-require-imports': 'off', |
91 | }, | |
92 | }, | |
93 | { | |
937e8172 | 94 | files: ['benchmarks/**/*.cjs'], |
147d7c42 | 95 | rules: { |
937e8172 JB |
96 | '@typescript-eslint/no-require-imports': 'off', |
97 | }, | |
98 | }, | |
99 | { | |
100 | files: ['tests/**/*.js', 'tests/**/*.mjs', 'tests/**/*.cjs'], | |
101 | rules: { | |
102 | '@typescript-eslint/no-require-imports': 'off', | |
147d7c42 JB |
103 | '@typescript-eslint/no-empty-function': 'off', |
104 | }, | |
105 | }, | |
106 | ]) |