@santi020k/eslint-config-santi020k 2.1.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -18
- package/dist/index.d.ts +14 -7
- package/dist/index.js +530 -439
- package/package.json +50 -48
- package/dist/configs/astro/index.config.d.ts +0 -22
- package/dist/configs/astro/rules.d.ts +0 -18
- package/dist/configs/expo/index.config.d.ts +0 -9
- package/dist/configs/expo/rules.d.ts +0 -6
- package/dist/configs/index.d.ts +0 -6
- package/dist/configs/js/index.config.d.ts +0 -3
- package/dist/configs/js/rules.d.ts +0 -4
- package/dist/configs/next/index.config.d.ts +0 -9
- package/dist/configs/next/rules.d.ts +0 -6
- package/dist/configs/react/index.config.d.ts +0 -11
- package/dist/configs/react/rules.d.ts +0 -3
- package/dist/configs/ts/index.config.d.ts +0 -3
- package/dist/configs/ts/rules.d.ts +0 -25
- package/dist/index.mjs +0 -489
- package/dist/optionals/cspell.d.ts +0 -15
- package/dist/optionals/i18next.d.ts +0 -2
- package/dist/optionals/index.d.ts +0 -6
- package/dist/optionals/mdx.d.ts +0 -21
- package/dist/optionals/tailwind.d.ts +0 -2
- package/dist/optionals/vitest.d.ts +0 -23
- package/dist/package.json +0 -107
- package/dist/utils/flatCompat.d.ts +0 -6
package/dist/index.js
CHANGED
|
@@ -1,489 +1,580 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import pluginJsxA11y from 'eslint-plugin-jsx-a11y';
|
|
7
|
-
import pluginN from 'eslint-plugin-n';
|
|
8
|
-
import pluginPromise from 'eslint-plugin-promise';
|
|
9
|
-
import pluginSimpleImport from 'eslint-plugin-simple-import-sort';
|
|
10
|
-
import pluginSonarJs from 'eslint-plugin-sonarjs';
|
|
11
|
-
import pluginUnusedImport from 'eslint-plugin-unused-imports';
|
|
12
|
-
import globals from 'globals';
|
|
13
|
-
import { FlatCompat } from '@eslint/eslintrc';
|
|
14
|
-
import { getDirname } from 'cross-dirname';
|
|
15
|
-
import { fixupConfigRules } from '@eslint/compat';
|
|
16
|
-
import pluginReactConfig from 'eslint-plugin-react/configs/recommended.js';
|
|
17
|
-
import pluginReactHooks from 'eslint-plugin-react-hooks';
|
|
18
|
-
import tsParser from '@typescript-eslint/parser';
|
|
19
|
-
import tsEslint from 'typescript-eslint';
|
|
20
|
-
import pluginCspell from '@cspell/eslint-plugin';
|
|
21
|
-
import pluginMdx from 'eslint-plugin-mdx';
|
|
22
|
-
import pluginTailwind from 'eslint-plugin-tailwindcss';
|
|
23
|
-
import pluginVitest from 'eslint-plugin-vitest';
|
|
1
|
+
// src/utils/apply-config-if-option-present.ts
|
|
2
|
+
var applyConfigIfOptionPresent = (configs, option, configToAdd) => {
|
|
3
|
+
const isOptionIncluded = configs.includes(option);
|
|
4
|
+
return isOptionIncluded ? configToAdd : [];
|
|
5
|
+
};
|
|
24
6
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
purpose with or without fee is hereby granted.
|
|
30
|
-
|
|
31
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
32
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
33
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
34
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
35
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
36
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
37
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
38
|
-
***************************************************************************** */
|
|
39
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
var __assign = function() {
|
|
43
|
-
__assign = Object.assign || function __assign(t) {
|
|
44
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
45
|
-
s = arguments[i];
|
|
46
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
47
|
-
}
|
|
48
|
-
return t;
|
|
49
|
-
};
|
|
50
|
-
return __assign.apply(this, arguments);
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
function __spreadArray(to, from, pack) {
|
|
54
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
55
|
-
if (ar || !(i in from)) {
|
|
56
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
57
|
-
ar[i] = from[i];
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
64
|
-
var e = new Error(message);
|
|
65
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
7
|
+
// src/utils/has-react-config.ts
|
|
8
|
+
var hasReactConfig = (configs) => {
|
|
9
|
+
if (!configs) return false;
|
|
10
|
+
return ReactConfigs.some((reactConfig2) => configs.includes(reactConfig2));
|
|
66
11
|
};
|
|
67
12
|
|
|
13
|
+
// src/configs/astro/index.config.ts
|
|
14
|
+
import pluginAstro from "eslint-plugin-astro";
|
|
15
|
+
|
|
16
|
+
// src/configs/js/rules.ts
|
|
68
17
|
var groups = [
|
|
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
|
-
|
|
18
|
+
// Internal packages.
|
|
19
|
+
// Atomic Design and components
|
|
20
|
+
["^(components|@/components|@components)(/.*|$)"],
|
|
21
|
+
["^(ui|@/ui|@ui)(/.*|$)"],
|
|
22
|
+
["^(atoms|@/atoms|@atoms)(/.*|$)"],
|
|
23
|
+
["^(molecules|@/molecules|@molecules)(/.*|$)"],
|
|
24
|
+
["^(organisms|@/organisms|@organisms)(/.*|$)"],
|
|
25
|
+
["^(templates|@/templates|@templates)(/.*|$)"],
|
|
26
|
+
["^(pages|@/pages|@pages)(/.*|$)"],
|
|
27
|
+
// Other posible folders
|
|
28
|
+
["^(store|@/store|@store)(/.*|$)"],
|
|
29
|
+
["^(api|@/api|@api)(/.*|$)"],
|
|
30
|
+
["^(contexts|@/contexts|@contexts)(/.*|$)"],
|
|
31
|
+
["^(hooks|@/hooks|@hooks)(/.*|$)"],
|
|
32
|
+
["^(lib|@/lib|@lib)(/.*|$)"],
|
|
33
|
+
["^(services|@/services|@services)(/.*|$)"],
|
|
34
|
+
["^(models|@/models|@models)(/.*|$)"],
|
|
35
|
+
["^(utils|@/utils|@utils)(/.*|$)"],
|
|
36
|
+
["^(ws|@/ws|@ws)(/.*|$)"],
|
|
37
|
+
// npm packages
|
|
38
|
+
// Anything that starts with a letter (or digit or underscore), or `@` followed by a letter.
|
|
39
|
+
["^\\w"],
|
|
40
|
+
// Side effect imports.
|
|
41
|
+
["^\\u0000"],
|
|
42
|
+
// Other relative imports. Put same-folder imports and `.` last.
|
|
43
|
+
["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"],
|
|
44
|
+
// Parent imports. Put `..` last.
|
|
45
|
+
["^\\.\\.(?!/?$)", "^\\.\\./?$"],
|
|
46
|
+
// Style imports.
|
|
47
|
+
["^.+\\.?(css|scss)$"]
|
|
99
48
|
];
|
|
100
|
-
var rules
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}],
|
|
141
|
-
'@stylistic/no-extra-parens': 'off',
|
|
142
|
-
'@stylistic/max-len': [
|
|
143
|
-
'warn',
|
|
144
|
-
{
|
|
145
|
-
code: 120,
|
|
146
|
-
tabWidth: 2,
|
|
147
|
-
comments: 200,
|
|
148
|
-
ignoreStrings: true
|
|
149
|
-
}
|
|
150
|
-
],
|
|
151
|
-
'@stylistic/max-statements-per-line': ['warn', { max: 1 }],
|
|
152
|
-
'@stylistic/array-element-newline': ['warn', 'consistent'],
|
|
153
|
-
'@stylistic/no-extra-semi': 'off',
|
|
154
|
-
'@stylistic/no-multi-spaces': 'off',
|
|
155
|
-
'@stylistic/padding-line-between-statements': [
|
|
156
|
-
'warn',
|
|
157
|
-
{ blankLine: 'always', prev: '*', next: '*' },
|
|
158
|
-
{ blankLine: 'any', prev: 'import', next: 'import' },
|
|
159
|
-
{
|
|
160
|
-
blankLine: 'always',
|
|
161
|
-
prev: ['const', 'let', 'var'],
|
|
162
|
-
next: ['const', 'let', 'var']
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
blankLine: 'never',
|
|
166
|
-
prev: ['singleline-const', 'singleline-let', 'singleline-var'],
|
|
167
|
-
next: ['singleline-const', 'singleline-let', 'singleline-var']
|
|
168
|
-
},
|
|
169
|
-
{ blankLine: 'always', prev: 'block-like', next: 'const' },
|
|
170
|
-
{ blankLine: 'always', prev: 'const', next: 'block-like' }
|
|
171
|
-
],
|
|
172
|
-
'@stylistic/function-paren-newline': ['warn', 'consistent'],
|
|
173
|
-
'arrow-body-style': ['warn', 'as-needed'],
|
|
174
|
-
'prefer-arrow-callback': ['warn', { allowNamedFunctions: true }],
|
|
175
|
-
'func-style': ['warn', 'expression', { allowArrowFunctions: true }],
|
|
176
|
-
'simple-import-sort/imports': [
|
|
177
|
-
'warn',
|
|
178
|
-
{
|
|
179
|
-
groups: groups
|
|
180
|
-
}
|
|
181
|
-
],
|
|
182
|
-
'jsx-a11y/alt-text': 'warn',
|
|
183
|
-
'no-empty': 'warn',
|
|
184
|
-
'no-nested-ternary': 'warn',
|
|
185
|
-
'no-undef': 'warn',
|
|
186
|
-
'unused-imports/no-unused-vars': [
|
|
187
|
-
'warn',
|
|
188
|
-
{
|
|
189
|
-
vars: 'all',
|
|
190
|
-
varsIgnorePattern: '^_',
|
|
191
|
-
args: 'after-used',
|
|
192
|
-
argsIgnorePattern: '^_',
|
|
193
|
-
destructuredArrayIgnorePattern: '^_',
|
|
194
|
-
ignoreRestSiblings: true
|
|
195
|
-
}
|
|
196
|
-
],
|
|
197
|
-
'no-void': 'warn',
|
|
198
|
-
camelcase: 'warn',
|
|
199
|
-
'array-callback-return': 'warn',
|
|
200
|
-
'no-fallthrough': 'warn',
|
|
201
|
-
eqeqeq: 'warn',
|
|
202
|
-
'no-constant-binary-expression': 'warn',
|
|
203
|
-
'@stylistic/lines-around-comment': 'warn',
|
|
204
|
-
'import/no-duplicates': 'warn',
|
|
205
|
-
'valid-typeof': 'warn',
|
|
206
|
-
'no-constant-condition': 'warn',
|
|
207
|
-
'no-use-before-define': 'warn',
|
|
208
|
-
'@stylistic/implicit-arrow-linebreak': 'warn',
|
|
209
|
-
'import/export': 'warn',
|
|
210
|
-
'no-useless-escape': 'warn',
|
|
211
|
-
'no-useless-return': 'warn',
|
|
212
|
-
'prefer-promise-reject-errors': 'warn',
|
|
213
|
-
'no-useless-constructor': 'warn',
|
|
214
|
-
'no-new': 'warn',
|
|
215
|
-
'prefer-regex-literals': 'warn',
|
|
216
|
-
'@stylistic/multiline-comment-style': 'off',
|
|
217
|
-
'space-before-function-paren': 'off'
|
|
218
|
-
};
|
|
219
|
-
|
|
220
|
-
var rules$4 = {
|
|
221
|
-
'simple-import-sort/imports': [
|
|
222
|
-
'warn',
|
|
223
|
-
{
|
|
224
|
-
groups: __spreadArray([
|
|
225
|
-
// Packages `react` related packages come first.
|
|
226
|
-
['^react'],
|
|
227
|
-
['^(astro)(/.*|$)?']
|
|
228
|
-
], groups, true)
|
|
49
|
+
var rules = {
|
|
50
|
+
"unused-imports/no-unused-imports": "warn",
|
|
51
|
+
indent: "off",
|
|
52
|
+
"brace-style": "off",
|
|
53
|
+
"@stylistic/brace-style": ["warn", "1tbs"],
|
|
54
|
+
"@stylistic/indent": ["warn", 2],
|
|
55
|
+
"@stylistic/quote-props": ["warn", "as-needed"],
|
|
56
|
+
quotes: "off",
|
|
57
|
+
"@stylistic/quotes": ["warn", "single"],
|
|
58
|
+
"@stylistic/semi": ["warn", "never"],
|
|
59
|
+
"quote-props": "off",
|
|
60
|
+
"comma-dangle": "off",
|
|
61
|
+
"@stylistic/comma-dangle": ["warn", "never"],
|
|
62
|
+
"@stylistic/object-curly-spacing": ["warn", "always"],
|
|
63
|
+
"@stylistic/padded-blocks": ["warn", "never"],
|
|
64
|
+
"@stylistic/arrow-parens": ["warn", "as-needed"],
|
|
65
|
+
"@stylistic/dot-location": ["warn", "property"],
|
|
66
|
+
"@stylistic/function-call-argument-newline": ["warn", "never"],
|
|
67
|
+
"@stylistic/object-property-newline": [
|
|
68
|
+
"warn",
|
|
69
|
+
{ allowAllPropertiesOnSameLine: true }
|
|
70
|
+
],
|
|
71
|
+
"@stylistic/multiline-ternary": ["warn", "always-multiline"],
|
|
72
|
+
"@stylistic/member-delimiter-style": ["error", {
|
|
73
|
+
multiline: {
|
|
74
|
+
delimiter: "none",
|
|
75
|
+
requireLast: false
|
|
76
|
+
},
|
|
77
|
+
singleline: {
|
|
78
|
+
delimiter: "comma",
|
|
79
|
+
requireLast: false
|
|
80
|
+
},
|
|
81
|
+
overrides: {
|
|
82
|
+
interface: {
|
|
83
|
+
multiline: {
|
|
84
|
+
delimiter: "none",
|
|
85
|
+
requireLast: false
|
|
229
86
|
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}],
|
|
90
|
+
"@stylistic/no-extra-parens": "off",
|
|
91
|
+
"@stylistic/max-len": [
|
|
92
|
+
"warn",
|
|
93
|
+
{
|
|
94
|
+
code: 120,
|
|
95
|
+
tabWidth: 2,
|
|
96
|
+
comments: 200,
|
|
97
|
+
ignoreStrings: true
|
|
98
|
+
}
|
|
99
|
+
],
|
|
100
|
+
"@stylistic/max-statements-per-line": ["warn", { max: 1 }],
|
|
101
|
+
"@stylistic/array-element-newline": ["warn", "consistent"],
|
|
102
|
+
"@stylistic/no-extra-semi": "off",
|
|
103
|
+
"@stylistic/no-multi-spaces": "off",
|
|
104
|
+
"@stylistic/padding-line-between-statements": [
|
|
105
|
+
"warn",
|
|
106
|
+
{ blankLine: "always", prev: "*", next: "*" },
|
|
107
|
+
{ blankLine: "any", prev: "import", next: "import" },
|
|
108
|
+
{
|
|
109
|
+
blankLine: "always",
|
|
110
|
+
prev: ["const", "let", "var"],
|
|
111
|
+
next: ["const", "let", "var"]
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
blankLine: "never",
|
|
115
|
+
prev: ["singleline-const", "singleline-let", "singleline-var"],
|
|
116
|
+
next: ["singleline-const", "singleline-let", "singleline-var"]
|
|
117
|
+
},
|
|
118
|
+
{ blankLine: "always", prev: "block-like", next: "const" },
|
|
119
|
+
{ blankLine: "always", prev: "const", next: "block-like" }
|
|
120
|
+
],
|
|
121
|
+
"@stylistic/function-paren-newline": ["warn", "consistent"],
|
|
122
|
+
"arrow-body-style": ["warn", "as-needed"],
|
|
123
|
+
"prefer-arrow-callback": ["warn", { allowNamedFunctions: true }],
|
|
124
|
+
"func-style": ["warn", "expression", { allowArrowFunctions: true }],
|
|
125
|
+
"simple-import-sort/imports": [
|
|
126
|
+
"warn",
|
|
127
|
+
{
|
|
128
|
+
groups
|
|
129
|
+
}
|
|
130
|
+
],
|
|
131
|
+
"jsx-a11y/alt-text": "warn",
|
|
132
|
+
"no-empty": "warn",
|
|
133
|
+
"no-nested-ternary": "warn",
|
|
134
|
+
"no-undef": "warn",
|
|
135
|
+
"unused-imports/no-unused-vars": [
|
|
136
|
+
"warn",
|
|
137
|
+
{
|
|
138
|
+
vars: "all",
|
|
139
|
+
varsIgnorePattern: "^_",
|
|
140
|
+
args: "after-used",
|
|
141
|
+
argsIgnorePattern: "^_",
|
|
142
|
+
destructuredArrayIgnorePattern: "^_",
|
|
143
|
+
ignoreRestSiblings: true
|
|
144
|
+
}
|
|
145
|
+
],
|
|
146
|
+
"no-void": "warn",
|
|
147
|
+
camelcase: "warn",
|
|
148
|
+
"array-callback-return": "warn",
|
|
149
|
+
"no-fallthrough": "warn",
|
|
150
|
+
eqeqeq: "warn",
|
|
151
|
+
"no-constant-binary-expression": "warn",
|
|
152
|
+
"@stylistic/lines-around-comment": "warn",
|
|
153
|
+
"import/no-duplicates": "warn",
|
|
154
|
+
"valid-typeof": "warn",
|
|
155
|
+
"no-constant-condition": "warn",
|
|
156
|
+
"no-use-before-define": "warn",
|
|
157
|
+
"@stylistic/implicit-arrow-linebreak": "warn",
|
|
158
|
+
"import/export": "warn",
|
|
159
|
+
"no-useless-escape": "warn",
|
|
160
|
+
"no-useless-return": "warn",
|
|
161
|
+
"prefer-promise-reject-errors": "warn",
|
|
162
|
+
"no-useless-constructor": "warn",
|
|
163
|
+
"no-new": "warn",
|
|
164
|
+
"prefer-regex-literals": "warn",
|
|
165
|
+
"@stylistic/multiline-comment-style": "off",
|
|
166
|
+
"space-before-function-paren": "off"
|
|
243
167
|
};
|
|
244
168
|
|
|
245
|
-
|
|
169
|
+
// src/configs/astro/rules.ts
|
|
170
|
+
var rules2 = {
|
|
171
|
+
"simple-import-sort/imports": [
|
|
172
|
+
"warn",
|
|
246
173
|
{
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
174
|
+
groups: [
|
|
175
|
+
// Packages `react` related packages come first.
|
|
176
|
+
["^react"],
|
|
177
|
+
["^(astro)(/.*|$)?"],
|
|
178
|
+
...groups
|
|
179
|
+
]
|
|
250
180
|
}
|
|
251
|
-
],
|
|
181
|
+
],
|
|
182
|
+
// Disable no-unresolved rule for .astro files
|
|
183
|
+
"react/jsx-filename-extension": [1, { extensions: [".astro"] }],
|
|
184
|
+
// Accept jsx in astro files
|
|
185
|
+
"react/destructuring-assignment": "off",
|
|
186
|
+
// Vscode doesn't support automatically destructuring, it's a pain to add a new variable
|
|
187
|
+
"react/require-default-props": "off",
|
|
188
|
+
// Allow non-defined react props as undefined
|
|
189
|
+
"react/jsx-props-no-spreading": "off",
|
|
190
|
+
// _app.tsx uses spread operator and also, react-hook-form
|
|
191
|
+
"react/react-in-jsx-scope": "off",
|
|
192
|
+
"react/no-unknown-property": "off",
|
|
193
|
+
// Disable conflicted rules
|
|
194
|
+
"@stylistic/jsx-indent": "off",
|
|
195
|
+
"@stylistic/jsx-one-expression-per-line": "off",
|
|
196
|
+
"@stylistic/jsx-tag-spacing": "off",
|
|
197
|
+
"react/jsx-key": "off"
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
// src/configs/astro/index.config.ts
|
|
201
|
+
var astroConfig = [
|
|
202
|
+
...pluginAstro.configs.recommended,
|
|
203
|
+
{
|
|
204
|
+
files: ["**/*.astro"],
|
|
205
|
+
name: "custom-astro",
|
|
206
|
+
rules: rules2
|
|
207
|
+
}
|
|
208
|
+
];
|
|
252
209
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
210
|
+
// src/configs/js/index.config.ts
|
|
211
|
+
import configStandard from "eslint-config-standard";
|
|
212
|
+
import pluginImport from "eslint-plugin-import";
|
|
213
|
+
import pluginJsxA11y from "eslint-plugin-jsx-a11y";
|
|
214
|
+
import pluginN from "eslint-plugin-n";
|
|
215
|
+
import pluginPromise from "eslint-plugin-promise";
|
|
216
|
+
import pluginSimpleImport from "eslint-plugin-simple-import-sort";
|
|
217
|
+
import pluginUnusedImport from "eslint-plugin-unused-imports";
|
|
218
|
+
import globals from "globals";
|
|
219
|
+
import eslint from "@eslint/js";
|
|
220
|
+
import pluginStylistic from "@stylistic/eslint-plugin";
|
|
221
|
+
var languageOptions = {
|
|
222
|
+
ecmaVersion: "latest",
|
|
223
|
+
sourceType: "module",
|
|
224
|
+
globals: {
|
|
225
|
+
...globals.browser,
|
|
226
|
+
...globals.node
|
|
227
|
+
}
|
|
257
228
|
};
|
|
258
229
|
var jsConfig = [
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
},
|
|
274
|
-
__assign({ name: 'stylistic' }, pluginStylistic.configs['recommended-flat']),
|
|
275
|
-
{
|
|
276
|
-
name: 'custom-js',
|
|
277
|
-
languageOptions: languageOptions$1,
|
|
278
|
-
files: ['**/*.{js,jsx,mjs,cjs}'],
|
|
279
|
-
ignores: ['node_modules/*'],
|
|
280
|
-
rules: rules$5
|
|
230
|
+
{
|
|
231
|
+
name: "eslint-config",
|
|
232
|
+
...eslint.configs.recommended
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
name: "plugins",
|
|
236
|
+
plugins: {
|
|
237
|
+
n: pluginN,
|
|
238
|
+
promise: pluginPromise,
|
|
239
|
+
import: { rules: pluginImport.rules },
|
|
240
|
+
"simple-import-sort": pluginSimpleImport,
|
|
241
|
+
"jsx-a11y": pluginJsxA11y,
|
|
242
|
+
"unused-imports": pluginUnusedImport
|
|
243
|
+
// sonarjs: pluginSonarJs
|
|
281
244
|
},
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
245
|
+
languageOptions,
|
|
246
|
+
rules: {
|
|
247
|
+
...configStandard.rules,
|
|
248
|
+
// ...pluginSonarJs.configs.recommended.rules,
|
|
249
|
+
"import/first": "off"
|
|
285
250
|
}
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
name: "stylistic",
|
|
254
|
+
...pluginStylistic.configs["recommended-flat"]
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
name: "custom-js",
|
|
258
|
+
languageOptions,
|
|
259
|
+
files: ["**/*.{js,jsx,mjs,cjs}"],
|
|
260
|
+
ignores: ["node_modules/*"],
|
|
261
|
+
rules
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
name: "ignore-node-modules-js",
|
|
265
|
+
ignores: ["node_modules/*"]
|
|
266
|
+
}
|
|
286
267
|
];
|
|
287
268
|
|
|
288
|
-
//
|
|
269
|
+
// src/utils/flat-compat.ts
|
|
270
|
+
import { getDirname } from "cross-dirname";
|
|
271
|
+
import { FlatCompat } from "@eslint/eslintrc";
|
|
289
272
|
var flatCompat = new FlatCompat({
|
|
290
|
-
|
|
291
|
-
|
|
273
|
+
baseDirectory: getDirname(),
|
|
274
|
+
recommendedConfig: {}
|
|
292
275
|
});
|
|
293
276
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
277
|
+
// src/configs/next/rules.ts
|
|
278
|
+
var rules3 = {
|
|
279
|
+
"simple-import-sort/imports": [
|
|
280
|
+
"warn",
|
|
281
|
+
{
|
|
282
|
+
groups: [
|
|
283
|
+
// Packages `react` related packages come first.
|
|
284
|
+
["^react"],
|
|
285
|
+
["^(next)(/.*|$)?"],
|
|
286
|
+
...groups
|
|
287
|
+
]
|
|
288
|
+
}
|
|
289
|
+
]
|
|
305
290
|
};
|
|
306
291
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
292
|
+
// src/configs/next/index.config.ts
|
|
293
|
+
import { fixupConfigRules } from "@eslint/compat";
|
|
294
|
+
var nextConfig = [
|
|
295
|
+
...fixupConfigRules(flatCompat.extends("plugin:@next/next/core-web-vitals")),
|
|
296
|
+
{
|
|
297
|
+
name: "custom-next",
|
|
298
|
+
rules: rules3
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
name: "ignore-next-folder",
|
|
302
|
+
ignores: [".next/*"]
|
|
303
|
+
}
|
|
304
|
+
];
|
|
305
|
+
|
|
306
|
+
// src/configs/react/index.config.ts
|
|
307
|
+
import pluginReactConfig from "eslint-plugin-react/configs/recommended.js";
|
|
308
|
+
import pluginReactHooks from "eslint-plugin-react-hooks";
|
|
309
|
+
import globals2 from "globals";
|
|
310
|
+
|
|
311
|
+
// src/configs/react/rules.ts
|
|
312
|
+
var rules4 = {
|
|
313
|
+
"react/react-in-jsx-scope": "off",
|
|
314
|
+
"react/jsx-max-depth": ["warn", { max: 7 }],
|
|
315
|
+
"react/prop-types": "off",
|
|
316
|
+
"react-hooks/exhaustive-deps": "off",
|
|
317
|
+
"react/button-has-type": "warn",
|
|
318
|
+
"react/display-name": "warn",
|
|
319
|
+
"react/no-children-prop": "warn",
|
|
320
|
+
"react/no-danger-with-children": "warn",
|
|
321
|
+
"react/no-unstable-nested-components": "warn",
|
|
322
|
+
"react/self-closing-comp": ["warn", { component: true, html: true }],
|
|
323
|
+
"react/jsx-curly-brace-presence": [
|
|
324
|
+
"warn",
|
|
325
|
+
{ props: "never", children: "never" }
|
|
326
|
+
],
|
|
327
|
+
"react/jsx-curly-newline": "warn",
|
|
328
|
+
"react/destructuring-assignment": "warn",
|
|
329
|
+
"react/jsx-pascal-case": "warn",
|
|
330
|
+
"react/boolean-prop-naming": "warn",
|
|
331
|
+
"react/hook-use-state": "warn",
|
|
332
|
+
"react/jsx-boolean-value": "warn",
|
|
333
|
+
"react/jsx-closing-tag-location": "warn",
|
|
334
|
+
"react/jsx-closing-bracket-location": "warn",
|
|
335
|
+
"react/jsx-wrap-multilines": "warn",
|
|
336
|
+
"react/jsx-no-target-blank": "warn",
|
|
337
|
+
"react/jsx-no-leaked-render": "warn",
|
|
338
|
+
"react/jsx-handler-names": "warn",
|
|
339
|
+
"react/jsx-fragments": "warn",
|
|
340
|
+
"react/no-deprecated": "warn",
|
|
341
|
+
"react/no-multi-comp": "warn",
|
|
342
|
+
"react/no-unescaped-entities": "warn",
|
|
343
|
+
"react/jsx-no-undef": "warn",
|
|
344
|
+
"react/no-unknown-property": "warn",
|
|
345
|
+
"simple-import-sort/imports": [
|
|
346
|
+
"warn",
|
|
312
347
|
{
|
|
313
|
-
|
|
314
|
-
|
|
348
|
+
groups: [
|
|
349
|
+
// Packages `react` related packages come first.
|
|
350
|
+
["^react"],
|
|
351
|
+
...groups
|
|
352
|
+
]
|
|
315
353
|
}
|
|
316
|
-
]
|
|
317
|
-
|
|
318
|
-
var rules$2 = {
|
|
319
|
-
'react/react-in-jsx-scope': 'off',
|
|
320
|
-
'react/jsx-max-depth': ['warn', { max: 7 }],
|
|
321
|
-
'react/prop-types': 'off',
|
|
322
|
-
'react-hooks/exhaustive-deps': 'off',
|
|
323
|
-
'react/button-has-type': 'warn',
|
|
324
|
-
'react/display-name': 'warn',
|
|
325
|
-
'react/no-children-prop': 'warn',
|
|
326
|
-
'react/no-danger-with-children': 'warn',
|
|
327
|
-
'react/no-unstable-nested-components': 'warn',
|
|
328
|
-
'react/self-closing-comp': ['warn', { component: true, html: true }],
|
|
329
|
-
'react/jsx-curly-brace-presence': [
|
|
330
|
-
'warn',
|
|
331
|
-
{ props: 'never', children: 'never' }
|
|
332
|
-
],
|
|
333
|
-
'react/jsx-curly-newline': 'warn',
|
|
334
|
-
'react/destructuring-assignment': 'warn',
|
|
335
|
-
'react/jsx-pascal-case': 'warn',
|
|
336
|
-
'react/boolean-prop-naming': 'warn',
|
|
337
|
-
'react/hook-use-state': 'warn',
|
|
338
|
-
'react/jsx-boolean-value': 'warn',
|
|
339
|
-
'react/jsx-closing-tag-location': 'warn',
|
|
340
|
-
'react/jsx-closing-bracket-location': 'warn',
|
|
341
|
-
'react/jsx-wrap-multilines': 'warn',
|
|
342
|
-
'react/jsx-no-target-blank': 'warn',
|
|
343
|
-
'react/jsx-no-leaked-render': 'warn',
|
|
344
|
-
'react/jsx-handler-names': 'warn',
|
|
345
|
-
'react/jsx-fragments': 'warn',
|
|
346
|
-
'react/no-deprecated': 'warn',
|
|
347
|
-
'react/no-multi-comp': 'warn',
|
|
348
|
-
'react/no-unescaped-entities': 'warn',
|
|
349
|
-
'react/jsx-no-undef': 'warn',
|
|
350
|
-
'react/no-unknown-property': 'warn',
|
|
351
|
-
'simple-import-sort/imports': [
|
|
352
|
-
'warn',
|
|
353
|
-
{
|
|
354
|
-
groups: __spreadArray([
|
|
355
|
-
// Packages `react` related packages come first.
|
|
356
|
-
['^react']
|
|
357
|
-
], groups, true)
|
|
358
|
-
}
|
|
359
|
-
]
|
|
354
|
+
]
|
|
360
355
|
};
|
|
361
356
|
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
357
|
+
// src/configs/react/index.config.ts
|
|
358
|
+
import { fixupConfigRules as fixupConfigRules2 } from "@eslint/compat";
|
|
359
|
+
var languageOptions2 = {
|
|
360
|
+
ecmaVersion: "latest",
|
|
361
|
+
sourceType: "module",
|
|
362
|
+
...pluginReactConfig.languageOptions,
|
|
363
|
+
globals: {
|
|
364
|
+
...globals2.browser,
|
|
365
|
+
...globals2.node
|
|
366
|
+
}
|
|
367
|
+
};
|
|
368
|
+
var reactConfig = [
|
|
369
|
+
...fixupConfigRules2(pluginReactConfig).map((react) => ({
|
|
370
|
+
...react,
|
|
371
|
+
name: "react",
|
|
372
|
+
languageOptions: languageOptions2,
|
|
373
|
+
settings: {
|
|
374
|
+
react: {
|
|
375
|
+
version: "detect"
|
|
376
|
+
}
|
|
376
377
|
}
|
|
377
|
-
|
|
378
|
+
})),
|
|
379
|
+
{
|
|
380
|
+
name: "custom-react",
|
|
381
|
+
plugins: {
|
|
382
|
+
"react-hooks": pluginReactHooks
|
|
383
|
+
},
|
|
384
|
+
languageOptions: languageOptions2,
|
|
385
|
+
files: ["**/*.{js,jsx,mjs,cjs,ts,tsx,mts,cts}"],
|
|
386
|
+
rules: {
|
|
387
|
+
...pluginReactHooks.configs.recommended.rules,
|
|
388
|
+
...rules4
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
];
|
|
378
392
|
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
{
|
|
382
|
-
vars: 'all',
|
|
383
|
-
varsIgnorePattern: '^_',
|
|
384
|
-
args: 'after-used',
|
|
385
|
-
argsIgnorePattern: '^_',
|
|
386
|
-
destructuredArrayIgnorePattern: '^_',
|
|
387
|
-
ignoreRestSiblings: true
|
|
388
|
-
}
|
|
389
|
-
], '@typescript-eslint/no-explicit-any': 'warn', '@typescript-eslint/no-empty-function': 'warn', '@typescript-eslint/ban-types': 'warn', '@typescript-eslint/no-var-requires': 'warn', '@typescript-eslint/ban-ts-comment': 'warn', '@typescript-eslint/no-non-null-assertion': 'warn', '@typescript-eslint/no-invalid-void-type': 'warn', '@typescript-eslint/no-dynamic-delete': 'warn', '@typescript-eslint/no-useless-constructor': 'warn', '@typescript-eslint/prefer-for-of': 'warn', '@typescript-eslint/no-duplicate-enum-values': 'warn' });
|
|
393
|
+
// src/configs/ts/index.config.ts
|
|
394
|
+
import tsEslint from "typescript-eslint";
|
|
390
395
|
|
|
391
|
-
|
|
396
|
+
// src/configs/ts/rules.ts
|
|
397
|
+
var rules5 = {
|
|
398
|
+
// ! js rules are not enabled in ts files, eslint rules would be duplicated, this can be improved in the future
|
|
399
|
+
...rules,
|
|
400
|
+
semi: "off",
|
|
401
|
+
"no-unused-vars": "off",
|
|
402
|
+
"@typescript-eslint/indent": "off",
|
|
403
|
+
"@typescript-eslint/no-unused-vars": [
|
|
404
|
+
"warn",
|
|
392
405
|
{
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
},
|
|
400
|
-
ecmaVersion: 'latest'
|
|
401
|
-
}
|
|
402
|
-
},
|
|
403
|
-
{
|
|
404
|
-
name: 'ignore-node-modules-ts',
|
|
405
|
-
ignores: ['node_modules/*']
|
|
406
|
+
vars: "all",
|
|
407
|
+
varsIgnorePattern: "^_",
|
|
408
|
+
args: "after-used",
|
|
409
|
+
argsIgnorePattern: "^_",
|
|
410
|
+
destructuredArrayIgnorePattern: "^_",
|
|
411
|
+
ignoreRestSiblings: true
|
|
406
412
|
}
|
|
407
|
-
],
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
413
|
+
],
|
|
414
|
+
"@typescript-eslint/no-explicit-any": "warn",
|
|
415
|
+
"@typescript-eslint/no-empty-function": "warn",
|
|
416
|
+
"@typescript-eslint/no-empty-object-type": "warn",
|
|
417
|
+
"@typescript-eslint/no-unsafe-function-type": "warn",
|
|
418
|
+
"@typescript-eslint/no-wrapper-object-types": "warn",
|
|
419
|
+
"@typescript-eslint/no-var-requires": "warn",
|
|
420
|
+
"@typescript-eslint/ban-ts-comment": "warn",
|
|
421
|
+
"@typescript-eslint/no-non-null-assertion": "warn",
|
|
422
|
+
"@typescript-eslint/no-invalid-void-type": "warn",
|
|
423
|
+
"@typescript-eslint/no-dynamic-delete": "warn",
|
|
424
|
+
"@typescript-eslint/no-useless-constructor": "warn",
|
|
425
|
+
"@typescript-eslint/prefer-for-of": "warn",
|
|
426
|
+
"@typescript-eslint/no-duplicate-enum-values": "warn"
|
|
420
427
|
};
|
|
421
428
|
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
429
|
+
// src/configs/ts/index.config.ts
|
|
430
|
+
import tsParser from "@typescript-eslint/parser";
|
|
431
|
+
var tsConfig = [
|
|
432
|
+
...tsEslint.configs.stylistic,
|
|
433
|
+
{
|
|
434
|
+
name: "custom-ts",
|
|
435
|
+
files: ["**/*.{ts,tsx,mts,cts}"],
|
|
436
|
+
rules: rules5,
|
|
437
|
+
languageOptions: {
|
|
438
|
+
parserOptions: {
|
|
439
|
+
parser: tsParser
|
|
440
|
+
},
|
|
441
|
+
ecmaVersion: "latest"
|
|
426
442
|
}
|
|
427
|
-
|
|
443
|
+
}
|
|
444
|
+
// TODO: Temporal
|
|
445
|
+
// {
|
|
446
|
+
// name: 'ignore-node-modules-ts',
|
|
447
|
+
// ignores: ['node_modules/*']
|
|
448
|
+
// }
|
|
449
|
+
];
|
|
428
450
|
|
|
429
|
-
|
|
451
|
+
// src/configs/expo/rules.ts
|
|
452
|
+
var rules6 = {
|
|
453
|
+
"simple-import-sort/imports": [
|
|
454
|
+
"warn",
|
|
430
455
|
{
|
|
431
|
-
|
|
432
|
-
|
|
456
|
+
groups: [
|
|
457
|
+
// Packages `react` related packages come first.
|
|
458
|
+
["^react"],
|
|
459
|
+
["^(expo)(/.*|$)?"],
|
|
460
|
+
...groups
|
|
461
|
+
]
|
|
433
462
|
}
|
|
463
|
+
]
|
|
464
|
+
};
|
|
465
|
+
|
|
466
|
+
// src/configs/expo/index.config.ts
|
|
467
|
+
import { fixupConfigRules as fixupConfigRules3 } from "@eslint/compat";
|
|
468
|
+
var expoConfig = [
|
|
469
|
+
...fixupConfigRules3(flatCompat.extends("expo")),
|
|
470
|
+
{
|
|
471
|
+
name: "custom-expo",
|
|
472
|
+
rules: rules6
|
|
473
|
+
}
|
|
434
474
|
];
|
|
435
475
|
|
|
436
|
-
|
|
476
|
+
// src/optionals/cspell.ts
|
|
477
|
+
import pluginCspell from "@cspell/eslint-plugin";
|
|
478
|
+
var cspell = [
|
|
479
|
+
{
|
|
480
|
+
name: "cspell",
|
|
481
|
+
plugins: { "@cspell": pluginCspell }
|
|
482
|
+
}
|
|
483
|
+
];
|
|
437
484
|
|
|
485
|
+
// src/optionals/i18next.ts
|
|
486
|
+
import { fixupConfigRules as fixupConfigRules4 } from "@eslint/compat";
|
|
487
|
+
var i18next = [
|
|
488
|
+
...fixupConfigRules4(flatCompat.plugins("i18next"))
|
|
489
|
+
];
|
|
490
|
+
|
|
491
|
+
// src/optionals/mdx.ts
|
|
492
|
+
import pluginMdx from "eslint-plugin-mdx";
|
|
438
493
|
var mdx = [
|
|
439
|
-
|
|
440
|
-
|
|
494
|
+
{
|
|
495
|
+
...pluginMdx.flat
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
...pluginMdx.flatCodeBlocks,
|
|
499
|
+
rules: {
|
|
500
|
+
...pluginMdx.flatCodeBlocks.rules
|
|
501
|
+
}
|
|
502
|
+
}
|
|
441
503
|
];
|
|
442
504
|
|
|
443
|
-
|
|
505
|
+
// src/optionals/tailwind.ts
|
|
506
|
+
import pluginTailwind from "eslint-plugin-tailwindcss";
|
|
507
|
+
var tailwind = [...pluginTailwind.configs["flat/recommended"]];
|
|
444
508
|
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
509
|
+
// src/optionals/vitest.ts
|
|
510
|
+
import pluginVitest from "eslint-plugin-vitest";
|
|
511
|
+
import { fixupConfigRules as fixupConfigRules5 } from "@eslint/compat";
|
|
512
|
+
var vitest = [
|
|
513
|
+
...fixupConfigRules5(flatCompat.extends("plugin:testing-library/react")),
|
|
514
|
+
{
|
|
515
|
+
name: "vitest",
|
|
516
|
+
files: ["tests/**"],
|
|
517
|
+
// or any other pattern
|
|
518
|
+
plugins: {
|
|
519
|
+
vitest: pluginVitest
|
|
520
|
+
},
|
|
521
|
+
rules: {
|
|
522
|
+
...pluginVitest.configs.recommended.rules,
|
|
523
|
+
// you can also use vitest.configs.all.rules to enable all rules
|
|
524
|
+
"vitest/max-nested-describe": ["error", { max: 3 }],
|
|
525
|
+
// you can also modify rules' behavior using option like this
|
|
526
|
+
"vitest/expect-expect": [
|
|
527
|
+
"error",
|
|
528
|
+
{
|
|
529
|
+
assertFunctionNames: ["expect", "assert", "should"]
|
|
456
530
|
}
|
|
531
|
+
]
|
|
457
532
|
}
|
|
458
|
-
|
|
533
|
+
}
|
|
534
|
+
];
|
|
459
535
|
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
536
|
+
// src/index.ts
|
|
537
|
+
var ConfigOption2 = /* @__PURE__ */ ((ConfigOption3) => {
|
|
538
|
+
ConfigOption3["Ts"] = "ts";
|
|
539
|
+
ConfigOption3["React"] = "react";
|
|
540
|
+
ConfigOption3["Next"] = "next";
|
|
541
|
+
ConfigOption3["Expo"] = "expo";
|
|
542
|
+
ConfigOption3["Astro"] = "astro";
|
|
543
|
+
return ConfigOption3;
|
|
544
|
+
})(ConfigOption2 || {});
|
|
545
|
+
var OptionalOption = /* @__PURE__ */ ((OptionalOption2) => {
|
|
546
|
+
OptionalOption2["Cspell"] = "cspell";
|
|
547
|
+
OptionalOption2["Tailwind"] = "tailwind";
|
|
548
|
+
OptionalOption2["Vitest"] = "vitest";
|
|
549
|
+
OptionalOption2["I18next"] = "i18next";
|
|
550
|
+
OptionalOption2["Mdx"] = "mdx";
|
|
551
|
+
return OptionalOption2;
|
|
552
|
+
})(OptionalOption || {});
|
|
476
553
|
var ReactConfigs = [
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
554
|
+
"react" /* React */,
|
|
555
|
+
"astro" /* Astro */,
|
|
556
|
+
"next" /* Next */,
|
|
557
|
+
"expo" /* Expo */
|
|
481
558
|
];
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
559
|
+
var eslintConfig = ({ config = [], optionals = [] } = {}) => {
|
|
560
|
+
const hasReact = hasReactConfig(config);
|
|
561
|
+
return [
|
|
562
|
+
...jsConfig,
|
|
563
|
+
...hasReact ? reactConfig : [],
|
|
564
|
+
...applyConfigIfOptionPresent(config, "ts" /* Ts */, tsConfig),
|
|
565
|
+
...applyConfigIfOptionPresent(config, "next" /* Next */, nextConfig),
|
|
566
|
+
...applyConfigIfOptionPresent(config, "astro" /* Astro */, astroConfig),
|
|
567
|
+
...applyConfigIfOptionPresent(config, "expo" /* Expo */, expoConfig),
|
|
568
|
+
...optionals.includes("cspell" /* Cspell */) ? cspell : [],
|
|
569
|
+
...optionals.includes("tailwind" /* Tailwind */) ? tailwind : [],
|
|
570
|
+
...optionals.includes("vitest" /* Vitest */) ? vitest : [],
|
|
571
|
+
...optionals.includes("i18next" /* I18next */) ? i18next : [],
|
|
572
|
+
...optionals.includes("mdx" /* Mdx */) ? mdx : []
|
|
573
|
+
];
|
|
574
|
+
};
|
|
575
|
+
export {
|
|
576
|
+
ConfigOption2 as ConfigOption,
|
|
577
|
+
OptionalOption,
|
|
578
|
+
ReactConfigs,
|
|
579
|
+
eslintConfig
|
|
487
580
|
};
|
|
488
|
-
|
|
489
|
-
export { ConfigOptions, OptionalOptions, eslintConfig };
|