-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
eslint.config.js
87 lines (86 loc) · 2.29 KB
/
eslint.config.js
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
// @ts-check
import eslint from '@eslint/js';
import globals from 'globals';
import tseslint from 'typescript-eslint';
import nodePlugin from 'eslint-plugin-n';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import eslintPluginUnicorn from 'eslint-plugin-unicorn';
export default tseslint.config(
{
ignores: [
'.git',
'node_modules',
'coverage',
'packages/*/dist/**',
'packages/*/node_modules/**',
'packages/*/__snapshots__/**',
],
},
eslint.configs.recommended,
nodePlugin.configs['flat/recommended-module'],
eslintPluginUnicorn.configs['flat/recommended'],
{
languageOptions: {
globals: {
...globals.nodeBuiltin,
},
},
rules: {
'n/hashbang': 'off',
'unicorn/consistent-function-scoping': 'off',
'unicorn/filename-case': 'off',
'unicorn/no-array-callback-reference': 'off',
'unicorn/no-array-for-each': 'off',
'unicorn/no-array-reduce': 'off',
'unicorn/no-null': 'off',
'unicorn/no-process-exit': 'off',
'unicorn/prefer-event-target': 'off',
'unicorn/prefer-top-level-await': 'off',
'unicorn/prevent-abbreviations': 'off',
},
},
{
files: ['**/*.mts', '**/*.ts'],
extends: [...tseslint.configs.strictTypeChecked],
languageOptions: {
parserOptions: {
projectService: true,
},
},
rules: {
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/no-invalid-void-type': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-confusing-void-expression': 'off',
'@typescript-eslint/no-unnecessary-type-parameters': 'off',
},
},
{
files: ['**/*.cjs'],
extends: [nodePlugin.configs['flat/recommended-script']],
languageOptions: {
globals: {
...globals.node,
},
},
},
{
files: ['packages/inquirer/test/**', 'packages/**/*.test.*'],
rules: {
'@typescript-eslint/unbound-method': 'off',
'n/no-extraneous-import': [
'error',
{
allowModules: ['vitest'],
},
],
'n/no-extraneous-require': [
'error',
{
allowModules: ['vitest'],
},
],
},
},
eslintPluginPrettierRecommended,
);