build: refine eslint spell checker configuration
[poolifier.git] / eslint.config.js
CommitLineData
147d7c42
JB
1import cspellConfigs from '@cspell/eslint-plugin/configs'
2import js from '@eslint/js'
3import { defineFlatConfig } from 'eslint-define-config'
4import jsdoc from 'eslint-plugin-jsdoc'
5import nodePlugin from 'eslint-plugin-n'
6import simpleImportSort from 'eslint-plugin-simple-import-sort'
7import globals from 'globals'
8import neostandard from 'neostandard'
9// eslint-disable-next-line n/no-extraneous-import
10import tseslint from 'typescript-eslint'
11
12export 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'],
20 // ...tseslint.config(...tseslint.configs.strictTypeChecked, ...tseslint.configs.stylisticTypeChecked),
21 ...tseslint.config(...tseslint.configs.strict, ...tseslint.configs.stylistic),
22 ...neostandard({
23 ts: true,
24 globals: {
25 ...globals.node,
26 ...globals.mocha,
27 },
28 }),
29 {
30 plugins: {
31 'simple-import-sort': simpleImportSort,
32 },
33 rules: {
01caf779
JB
34 '@cspell/spellchecker': [
35 'warn',
36 {
37 autoFix: true,
38 cspell: {
39 words: [
40 'Alessandro',
41 'Ardizio',
42 'Benoit',
43 'IWRR',
44 'Quadflieg',
45 'neostandard',
46 'poolifier',
47 'tseslint',
48 ],
49 },
50 },
51 ],
147d7c42
JB
52 'simple-import-sort/imports': 'error',
53 'simple-import-sort/exports': 'error',
54 },
55 },
56 {
57 files: [
58 'src/pools/selection-strategies/fair-share-worker-choice-strategy.ts',
59 ],
60 rules: {
61 '@stylistic/operator-linebreak': 'off',
62 },
63 },
e56903ca
JB
64 {
65 files: ['examples/**/*.ts'],
66 rules: {
67 'no-undef': 'off',
68 },
69 },
147d7c42 70 {
937e8172 71 files: ['examples/**/*.js', 'examples/**/*.cjs'],
147d7c42 72 rules: {
54050139
JB
73 'n/no-missing-import': [
74 'error',
75 {
76 allowModules: ['ws'],
77 },
78 ],
147d7c42
JB
79 '@typescript-eslint/no-require-imports': 'off',
80 },
81 },
82 {
937e8172 83 files: ['benchmarks/**/*.cjs'],
147d7c42 84 rules: {
937e8172
JB
85 '@typescript-eslint/no-require-imports': 'off',
86 },
87 },
88 {
89 files: ['tests/**/*.js', 'tests/**/*.mjs', 'tests/**/*.cjs'],
90 rules: {
91 '@typescript-eslint/no-require-imports': 'off',
147d7c42
JB
92 '@typescript-eslint/no-empty-function': 'off',
93 },
94 },
95])