forked from SBoudrias/Inquirer.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
73 lines (72 loc) · 1.79 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
// @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: {
'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.recommended],
},
{
files: ['**/*.cjs'],
extends: [nodePlugin.configs['flat/recommended-script']],
languageOptions: {
globals: {
...globals.node,
},
},
},
{
files: ['packages/inquirer/test/**', 'packages/**/*.test.*'],
rules: {
'n/no-extraneous-import': [
'error',
{
allowModules: ['vitest'],
},
],
'n/no-extraneous-require': [
'error',
{
allowModules: ['vitest'],
},
],
},
},
eslintPluginPrettierRecommended,
);