chore(deps-dev): bump tatami-ng to 0.6.0
[poolifier.git] / eslint.config.js
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 perfectionist from 'eslint-plugin-perfectionist'
6 import globals from 'globals'
7 import neostandard, { plugins } from 'neostandard'
8
9 export default defineFlatConfig([
10 {
11 ignores: ['docs/**', '**/dist/**', 'lib/**', 'outputs/**'],
12 },
13 cspellConfigs.recommended,
14 js.configs.recommended,
15 plugins.promise.configs['flat/recommended'],
16 ...plugins.n.configs['flat/mixed-esm-and-cjs'],
17 jsdoc.configs['flat/recommended-typescript'],
18 {
19 rules: {
20 'jsdoc/check-tag-names': [
21 'warn',
22 {
23 definedTags: ['defaultValue', 'experimental', 'typeParam'],
24 typed: true,
25 },
26 ],
27 },
28 },
29 ...plugins['typescript-eslint'].config(
30 {
31 extends: [
32 ...plugins['typescript-eslint'].configs.strictTypeChecked,
33 ...plugins['typescript-eslint'].configs.stylisticTypeChecked,
34 ],
35 languageOptions: {
36 parserOptions: {
37 projectService: true,
38 tsconfigRootDir: import.meta.dirname,
39 },
40 },
41 },
42 {
43 files: ['**/*.js', '**/*.mjs', '**/*.cjs'],
44 ...plugins['typescript-eslint'].configs.disableTypeChecked,
45 }
46 ),
47 {
48 rules: {
49 '@cspell/spellchecker': [
50 'warn',
51 {
52 autoFix: true,
53 cspell: {
54 words: [
55 'Alessandro',
56 'Ardizio',
57 'Benoit',
58 'IWRR',
59 'Quadflieg',
60 'neostandard',
61 'poolifier',
62 ],
63 },
64 },
65 ],
66 },
67 },
68 perfectionist.configs['recommended-natural'],
69 ...neostandard({
70 globals: {
71 ...globals.mocha,
72 },
73 ts: true,
74 }),
75 {
76 files: [
77 'src/pools/selection-strategies/fair-share-worker-choice-strategy.ts',
78 ],
79 rules: {
80 '@stylistic/operator-linebreak': 'off',
81 },
82 },
83 // examples specific configuration
84 {
85 files: ['examples/**/*.ts'],
86 rules: {
87 '@typescript-eslint/no-redundant-type-constituents': 'off',
88 '@typescript-eslint/no-unnecessary-type-assertion': 'off',
89 '@typescript-eslint/no-unsafe-argument': 'off',
90 '@typescript-eslint/no-unsafe-assignment': 'off',
91 '@typescript-eslint/no-unsafe-call': 'off',
92 '@typescript-eslint/no-unsafe-member-access': 'off',
93 '@typescript-eslint/no-unsafe-return': 'off',
94 '@typescript-eslint/restrict-template-expressions': 'off',
95 '@typescript-eslint/return-await': 'off',
96 },
97 },
98 {
99 files: ['examples/**/*.js', 'examples/**/*.cjs'],
100 rules: {
101 '@typescript-eslint/no-require-imports': 'off',
102 'n/no-missing-import': [
103 'error',
104 {
105 allowModules: ['ws'],
106 },
107 ],
108 },
109 },
110 // benchmarks specific configuration
111 {
112 files: ['benchmarks/**/*.cjs'],
113 rules: {
114 '@typescript-eslint/no-require-imports': 'off',
115 },
116 },
117 // tests specific configuration
118 {
119 files: ['tests/**/*.js', 'tests/**/*.mjs', 'tests/**/*.cjs'],
120 rules: {
121 '@typescript-eslint/no-empty-function': 'off',
122 '@typescript-eslint/no-require-imports': 'off',
123 },
124 },
125 ])