-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Expand file tree
/
Copy patheslint.config.js
More file actions
118 lines (117 loc) · 3.13 KB
/
Copy patheslint.config.js
File metadata and controls
118 lines (117 loc) · 3.13 KB
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
// @ts-check
import { defineConfig } from 'eslint/config';
import eslint from '@eslint/js';
import globals from 'globals';
import tseslint from 'typescript-eslint';
import nodePlugin from 'eslint-plugin-n';
import oxlint from 'eslint-plugin-oxlint';
export default defineConfig(
{
ignores: [
'.git',
'node_modules',
'coverage',
'.yarn',
'packages/*/dist/**',
'packages/*/node_modules/**',
'tools/*/dist/**',
'tools/*/node_modules/**',
'integration/*/dist/**',
'integration/*/node_modules/**',
'packages/*/__snapshots__/**',
],
},
eslint.configs.recommended,
tseslint.configs.recommended,
nodePlugin.configs['flat/recommended-module'],
{
languageOptions: {
globals: {
...globals.nodeBuiltin,
},
},
rules: {
'n/hashbang': 'off',
'n/no-unpublished-bin': 'off',
// `util.styleText` is intentionally used despite still being flagged as
// experimental on Node 20.x; it is stable on the other supported ranges.
'n/no-unsupported-features/node-builtins': [
'error',
{ ignores: ['util.styleText'] },
],
'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/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',
'n/no-missing-import': ['error', { ignoreTypeImport: true }],
},
},
{
files: ['**/*.cjs'],
extends: [nodePlugin.configs['flat/recommended-script']],
languageOptions: {
globals: {
...globals.node,
},
},
rules: {
'@typescript-eslint/no-require-imports': 'off',
},
},
{
files: ['packages/inquirer/test/**', 'packages/**/*.test.*'],
rules: {
'n/no-extraneous-import': [
'error',
{
allowModules: ['vitest', '@inquirer/testing'],
},
],
'n/no-extraneous-require': [
'error',
{
allowModules: ['vitest', '@inquirer/testing'],
},
],
'n/no-unsupported-features/node-builtins': [
'error',
{
version: '^22.16.0 || >=24.0.0',
},
],
},
},
{
files: ['tools/**', 'integration/**', 'packages/*/examples/**', 'packages/demo/**'],
rules: {
'n/no-unsupported-features/node-builtins': [
'error',
{
version: '^24.0.0',
},
],
},
},
...oxlint.buildFromOxlintConfigFile('./.oxlintrc.json'),
);