-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy patheslint.config.mjs
95 lines (93 loc) · 3.3 KB
/
eslint.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// @ts-check
import { includeIgnoreFile } from '@eslint/compat';
import eslint from '@eslint/js';
import eslintConfigPrettier from 'eslint-config-prettier';
import nodePlugin from 'eslint-plugin-n';
import pluginPromise from 'eslint-plugin-promise';
import eslintPluginUnicorn from 'eslint-plugin-unicorn';
import globals from 'globals';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import tseslint from 'typescript-eslint';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const gitignorePath = path.resolve(__dirname, '.gitignore');
export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.strict,
...tseslint.configs.stylistic,
nodePlugin.configs['flat/recommended'],
eslintPluginUnicorn.configs['flat/recommended'],
pluginPromise.configs['flat/recommended'],
{
languageOptions: {
parser: tseslint.parser,
ecmaVersion: 2022,
sourceType: 'module',
globals: {
...globals.node,
},
},
},
{
name: 'Global Ignores',
ignores: [
...includeIgnoreFile(gitignorePath).ignores,
'/.cache',
'/.git',
'/.husky',
'/.yarn',
'.dependency-cruiser.js',
'cucumber.setup.js',
'eslint.config.mjs',
],
},
{
files: ['**/*.ts'],
rules: {
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/consistent-type-definitions': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/indent': 'off',
'@typescript-eslint/member-delimiter-style': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-object-literal-type-assertion': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
'n/no-missing-import': 'off',
'n/no-unpublished-import': 'off',
'import/extensions': 'off',
'import/no-cycle': 'off',
'import/no-extraneous-dependencies': 'off',
'import/order': 'off',
'import/prefer-default-export': 'off',
'no-restricted-exports': 'off',
'no-undef': 'off',
'func-names': 'off',
'no-unused-vars': 'off',
'no-use-before-define': 'off',
'promise/always-return': 'off',
'promise/catch-or-return': 'off',
'unicorn/filename-case': 'off',
'unicorn/prefer-module': 'off',
'unicorn/prefer-top-level-await': 'off',
'unicorn/prevent-abbreviations': 'off',
'unicorn/no-array-reduce': 'off',
'unicorn/no-abusive-eslint-disable': 'off',
'unicorn/no-array-callback-reference': 'off',
},
},
eslintConfigPrettier,
);