@storm-software/eslint 0.125.1 → 0.126.1
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/dist/preset.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Linter } from 'eslint';
|
|
2
2
|
import { FlatConfigComposer } from 'eslint-flat-config-utils';
|
|
3
|
-
import { O as OptionsConfig, R as RuleOptions, T as TypedFlatConfigItem, A as Awaitable, C as ConfigNames } from './types-
|
|
3
|
+
import { O as OptionsConfig, R as RuleOptions, T as TypedFlatConfigItem, A as Awaitable, C as ConfigNames } from './types-CadFhnVH.js';
|
|
4
4
|
import '@nx/eslint-plugin/src/utils/runtime-lint-utils';
|
|
5
5
|
import '@stylistic/eslint-plugin';
|
|
6
6
|
import '@typescript-eslint/parser';
|
package/dist/preset.js
CHANGED
|
@@ -166,6 +166,9 @@ async function disables() {
|
|
|
166
166
|
}
|
|
167
167
|
__name(disables, "disables");
|
|
168
168
|
|
|
169
|
+
// src/configs/formatters.ts
|
|
170
|
+
import defu from "defu";
|
|
171
|
+
|
|
169
172
|
// src/configs/stylistic.ts
|
|
170
173
|
var StylisticConfigDefaults = {
|
|
171
174
|
indent: 2,
|
|
@@ -174,7 +177,7 @@ var StylisticConfigDefaults = {
|
|
|
174
177
|
semi: true
|
|
175
178
|
};
|
|
176
179
|
async function stylistic(options = {}) {
|
|
177
|
-
const { indent, jsx: jsx2, overrides = {}, quotes, semi, lineEndings = "unix" } = {
|
|
180
|
+
const { indent = 2, jsx: jsx2 = true, overrides = {}, quotes = "double", semi = true, lineEndings = "unix" } = {
|
|
178
181
|
...StylisticConfigDefaults,
|
|
179
182
|
...options
|
|
180
183
|
};
|
|
@@ -199,15 +202,41 @@ async function stylistic(options = {}) {
|
|
|
199
202
|
"error",
|
|
200
203
|
lineEndings
|
|
201
204
|
],
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
205
|
+
"style/comma-dangle": [
|
|
206
|
+
"error",
|
|
207
|
+
"never"
|
|
208
|
+
],
|
|
209
|
+
"style/comma-style": [
|
|
210
|
+
"error",
|
|
211
|
+
"last"
|
|
212
|
+
],
|
|
213
|
+
"style/quotes": [
|
|
214
|
+
"error",
|
|
215
|
+
quotes
|
|
216
|
+
],
|
|
217
|
+
"style/semi": [
|
|
218
|
+
"error",
|
|
219
|
+
semi ? "always" : "never"
|
|
220
|
+
],
|
|
221
|
+
"style/indent": [
|
|
222
|
+
"error",
|
|
223
|
+
indent,
|
|
224
|
+
{
|
|
225
|
+
SwitchCase: 1
|
|
226
|
+
}
|
|
227
|
+
],
|
|
228
|
+
"style/operator-linebreak": [
|
|
229
|
+
"error",
|
|
230
|
+
"after"
|
|
231
|
+
],
|
|
232
|
+
"style/jsx-indent": [
|
|
233
|
+
"error",
|
|
234
|
+
indent
|
|
235
|
+
],
|
|
236
|
+
"style/jsx-quotes": [
|
|
237
|
+
"error",
|
|
238
|
+
quotes === "single" ? "prefer-single" : "prefer-double"
|
|
239
|
+
],
|
|
211
240
|
...overrides
|
|
212
241
|
}
|
|
213
242
|
}
|
|
@@ -245,30 +274,35 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
245
274
|
options.astro ? "prettier-plugin-astro" : void 0,
|
|
246
275
|
options.xml || options.svg ? "@prettier/plugin-xml" : void 0
|
|
247
276
|
]);
|
|
248
|
-
const { indent, quotes, semi } = {
|
|
277
|
+
const { indent = 2, quotes = "double", semi = true } = {
|
|
249
278
|
...StylisticConfigDefaults,
|
|
250
279
|
...stylistic2
|
|
251
280
|
};
|
|
252
|
-
const prettierOptions =
|
|
253
|
-
|
|
281
|
+
const prettierOptions = defu({
|
|
282
|
+
proseWrap: "always",
|
|
283
|
+
quoteProps: "preserve",
|
|
284
|
+
bracketSameLine: true,
|
|
285
|
+
bracketSpacing: true,
|
|
286
|
+
arrowParens: "avoid",
|
|
287
|
+
endOfLine: "lf",
|
|
254
288
|
printWidth: 120,
|
|
255
289
|
semi,
|
|
256
290
|
singleQuote: quotes === "single",
|
|
257
291
|
tabWidth: typeof indent === "number" ? indent : 2,
|
|
258
|
-
trailingComma: "
|
|
292
|
+
trailingComma: "none",
|
|
259
293
|
useTabs: indent === "tab"
|
|
260
|
-
}, options.prettierOptions
|
|
294
|
+
}, options.prettierOptions ?? {});
|
|
261
295
|
const prettierXmlOptions = {
|
|
262
296
|
xmlQuoteAttributes: "double",
|
|
263
297
|
xmlSelfClosingSpace: true,
|
|
264
298
|
xmlSortAttributesByKey: false,
|
|
265
299
|
xmlWhitespaceSensitivity: "ignore"
|
|
266
300
|
};
|
|
267
|
-
const dprintOptions =
|
|
301
|
+
const dprintOptions = defu({
|
|
268
302
|
indentWidth: typeof indent === "number" ? indent : 2,
|
|
269
303
|
quoteStyle: quotes === "single" ? "preferSingle" : "preferDouble",
|
|
270
304
|
useTabs: indent === "tab"
|
|
271
|
-
}, options.dprintOptions
|
|
305
|
+
}, options.dprintOptions ?? {});
|
|
272
306
|
const pluginFormat = await interopDefault(import("eslint-plugin-format"));
|
|
273
307
|
const configs2 = [
|
|
274
308
|
{
|
|
@@ -774,7 +808,7 @@ async function imports(options = {}) {
|
|
|
774
808
|
__name(imports, "imports");
|
|
775
809
|
|
|
776
810
|
// src/configs/javascript.ts
|
|
777
|
-
import
|
|
811
|
+
import defu2 from "defu";
|
|
778
812
|
import globalsLib from "globals";
|
|
779
813
|
async function javascript(options = {}) {
|
|
780
814
|
const { isInEditor = false, lineEndings = "unix", overrides = {}, name = "", globals = {} } = options;
|
|
@@ -783,7 +817,7 @@ async function javascript(options = {}) {
|
|
|
783
817
|
name: "storm/javascript/setup",
|
|
784
818
|
languageOptions: {
|
|
785
819
|
ecmaVersion: 2022,
|
|
786
|
-
globals:
|
|
820
|
+
globals: defu2(globals, {
|
|
787
821
|
...globalsLib.browser,
|
|
788
822
|
...globalsLib.es2021,
|
|
789
823
|
...globalsLib.node,
|
|
@@ -1901,7 +1935,7 @@ async function javascript(options = {}) {
|
|
|
1901
1935
|
}
|
|
1902
1936
|
],
|
|
1903
1937
|
"prefer-const": [
|
|
1904
|
-
|
|
1938
|
+
"error",
|
|
1905
1939
|
{
|
|
1906
1940
|
destructuring: "all",
|
|
1907
1941
|
ignoreReadBeforeAssign: true
|
|
@@ -1918,7 +1952,7 @@ async function javascript(options = {}) {
|
|
|
1918
1952
|
"prefer-spread": "error",
|
|
1919
1953
|
"prefer-template": "error",
|
|
1920
1954
|
"symbol-description": "error",
|
|
1921
|
-
"unused-imports/no-unused-imports":
|
|
1955
|
+
"unused-imports/no-unused-imports": "error",
|
|
1922
1956
|
"unused-imports/no-unused-vars": [
|
|
1923
1957
|
"error",
|
|
1924
1958
|
{
|
|
@@ -2467,7 +2501,7 @@ async function node() {
|
|
|
2467
2501
|
__name(node, "node");
|
|
2468
2502
|
|
|
2469
2503
|
// src/configs/nx.ts
|
|
2470
|
-
import
|
|
2504
|
+
import defu3 from "defu";
|
|
2471
2505
|
async function nx(options = {}) {
|
|
2472
2506
|
const { depsCheck, moduleBoundaries } = options;
|
|
2473
2507
|
return [
|
|
@@ -2495,7 +2529,7 @@ async function nx(options = {}) {
|
|
|
2495
2529
|
rules: {
|
|
2496
2530
|
"@nx/dependency-checks": [
|
|
2497
2531
|
"error",
|
|
2498
|
-
|
|
2532
|
+
defu3(depsCheck ?? {}, {
|
|
2499
2533
|
buildTargets: [
|
|
2500
2534
|
"build-base",
|
|
2501
2535
|
"build"
|
|
@@ -3283,7 +3317,9 @@ async function typescript(options = {}) {
|
|
|
3283
3317
|
"error",
|
|
3284
3318
|
{
|
|
3285
3319
|
allowNullableBoolean: true,
|
|
3286
|
-
allowNullableObject: true
|
|
3320
|
+
allowNullableObject: true,
|
|
3321
|
+
allowNullableString: true,
|
|
3322
|
+
allowNullableEnum: true
|
|
3287
3323
|
}
|
|
3288
3324
|
],
|
|
3289
3325
|
"ts/switch-exhaustiveness-check": "error",
|
|
@@ -3339,10 +3375,15 @@ async function typescript(options = {}) {
|
|
|
3339
3375
|
files,
|
|
3340
3376
|
name: "storm/typescript/rules",
|
|
3341
3377
|
rules: {
|
|
3342
|
-
...renameRules(
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3378
|
+
...renameRules(
|
|
3379
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
3380
|
+
pluginTs.configs["eslint-recommended"]?.overrides?.[0]?.rules,
|
|
3381
|
+
{
|
|
3382
|
+
"@typescript-eslint": "ts"
|
|
3383
|
+
}
|
|
3384
|
+
),
|
|
3385
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
3386
|
+
...renameRules(pluginTs.configs.strict?.rules, {
|
|
3346
3387
|
"@typescript-eslint": "ts"
|
|
3347
3388
|
}),
|
|
3348
3389
|
/*************************************************************
|
|
@@ -3436,6 +3477,7 @@ async function typescript(options = {}) {
|
|
|
3436
3477
|
"ts/no-import-type-side-effects": "error",
|
|
3437
3478
|
"ts/no-invalid-void-type": "off",
|
|
3438
3479
|
"ts/no-non-null-assertion": "off",
|
|
3480
|
+
"ts/no-non-null-asserted-optional-chain": "error",
|
|
3439
3481
|
"ts/no-redeclare": [
|
|
3440
3482
|
"error",
|
|
3441
3483
|
{
|
|
@@ -3879,9 +3921,7 @@ function getStormConfig(options, ...userConfigs) {
|
|
|
3879
3921
|
}
|
|
3880
3922
|
if (isInEditor) {
|
|
3881
3923
|
composer = composer.disableRulesFix([
|
|
3882
|
-
"
|
|
3883
|
-
"test/no-only-tests",
|
|
3884
|
-
"prefer-const"
|
|
3924
|
+
"test/no-only-tests"
|
|
3885
3925
|
], {
|
|
3886
3926
|
builtinRules: /* @__PURE__ */ __name(() => import([
|
|
3887
3927
|
"eslint",
|
|
@@ -15209,6 +15209,7 @@ interface OptionsConfig extends OptionsComponentExts, OptionsJavascript, Options
|
|
|
15209
15209
|
* Enable stylistic rules.
|
|
15210
15210
|
*
|
|
15211
15211
|
* @see https://eslint.style/
|
|
15212
|
+
*
|
|
15212
15213
|
* @default true
|
|
15213
15214
|
*/
|
|
15214
15215
|
stylistic?: boolean | (StylisticConfig & OptionsOverrides);
|
package/dist/utils/combine.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Awaitable } from 'eslint-flat-config-utils';
|
|
2
|
-
import { T as TypedFlatConfigItem } from '../types-
|
|
2
|
+
import { T as TypedFlatConfigItem } from '../types-CadFhnVH.js';
|
|
3
3
|
import '@nx/eslint-plugin/src/utils/runtime-lint-utils';
|
|
4
4
|
import '@stylistic/eslint-plugin';
|
|
5
5
|
import '@typescript-eslint/parser';
|
package/package.json
CHANGED