@moso/eslint-config 3.0.1 → 3.0.3
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/index.d.mts +1 -0
- package/dist/index.mjs +60 -21
- package/package.json +9 -9
package/dist/index.d.mts
CHANGED
|
@@ -1694,6 +1694,7 @@ interface RuleOptions {
|
|
|
1694
1694
|
/**
|
|
1695
1695
|
* Disallow function declarations that contain unsafe references inside loop statements
|
|
1696
1696
|
* @see https://typescript-eslint.io/rules/no-loop-func
|
|
1697
|
+
* @deprecated
|
|
1697
1698
|
*/
|
|
1698
1699
|
'@typescript-eslint/no-loop-func'?: Linter.RuleEntry<[]>;
|
|
1699
1700
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -222,6 +222,7 @@ const astro = async (options) => {
|
|
|
222
222
|
const stylisticEnabled = stylistic !== false;
|
|
223
223
|
const [typescriptParser] = typescript ? await loadPackages(["@typescript-eslint/parser"]) : [void 0];
|
|
224
224
|
const [astroParser, astroPlugin] = await loadPackages(["astro-eslint-parser", "eslint-plugin-astro"]);
|
|
225
|
+
const { projectService, ...typeAwareParserOptions } = parserOptions ?? {};
|
|
225
226
|
const flattenRules = (configs) => configs.reduce((acc, config) => Object.assign(acc, config.rules), {});
|
|
226
227
|
return [
|
|
227
228
|
{
|
|
@@ -233,7 +234,10 @@ const astro = async (options) => {
|
|
|
233
234
|
parserOptions: {
|
|
234
235
|
extraFileExtensions: [".astro"],
|
|
235
236
|
parser: typescript ? typescriptParser : void 0,
|
|
236
|
-
...typescript &&
|
|
237
|
+
...typescript && {
|
|
238
|
+
...typeAwareParserOptions,
|
|
239
|
+
...Boolean(projectService) && { project: true }
|
|
240
|
+
}
|
|
237
241
|
},
|
|
238
242
|
sourceType: "module"
|
|
239
243
|
},
|
|
@@ -246,12 +250,12 @@ const astro = async (options) => {
|
|
|
246
250
|
rules: {
|
|
247
251
|
"@moso/no-top-level-await": "off",
|
|
248
252
|
"node/no-top-level-await": "off",
|
|
253
|
+
"unicorn/no-await-expression-member": "off",
|
|
249
254
|
...flattenRules(astroPlugin.configs.recommended),
|
|
250
255
|
...!lessOpinionated && {
|
|
251
256
|
"astro/no-set-html-directive": "error",
|
|
252
257
|
"astro/no-set-text-directive": "error",
|
|
253
258
|
"astro/no-unsafe-inline-scripts": "error",
|
|
254
|
-
"astro/no-unused-css-selector": "error",
|
|
255
259
|
...stylisticEnabled && {
|
|
256
260
|
"astro/prefer-class-list-directive": "error",
|
|
257
261
|
"astro/prefer-object-class-list": "error",
|
|
@@ -683,7 +687,7 @@ const ignores = async (options) => {
|
|
|
683
687
|
var package_default = {
|
|
684
688
|
name: "@moso/eslint-config",
|
|
685
689
|
type: "module",
|
|
686
|
-
version: "3.0.
|
|
690
|
+
version: "3.0.3",
|
|
687
691
|
description: "@moso's sharable ESLint config",
|
|
688
692
|
author: {
|
|
689
693
|
"name": "Morten Sørensen",
|
|
@@ -738,7 +742,7 @@ var package_default = {
|
|
|
738
742
|
},
|
|
739
743
|
workspaces: ["src/rules"],
|
|
740
744
|
peerDependencies: {
|
|
741
|
-
"@eslint-react/eslint-plugin": "^5.14.
|
|
745
|
+
"@eslint-react/eslint-plugin": "^5.14.8",
|
|
742
746
|
"@next/eslint-plugin-next": "^16.2.10",
|
|
743
747
|
"astro-eslint-parser": "^3.0.0",
|
|
744
748
|
"eslint": "^10.0.0",
|
|
@@ -773,9 +777,9 @@ var package_default = {
|
|
|
773
777
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.7.2",
|
|
774
778
|
"@eslint/js": "^10.0.1",
|
|
775
779
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
776
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
777
|
-
"@typescript-eslint/parser": "^8.
|
|
778
|
-
"@typescript-eslint/utils": "^8.
|
|
780
|
+
"@typescript-eslint/eslint-plugin": "^8.64.0",
|
|
781
|
+
"@typescript-eslint/parser": "^8.64.0",
|
|
782
|
+
"@typescript-eslint/utils": "^8.64.0",
|
|
779
783
|
"@vitest/eslint-plugin": "^1.6.23",
|
|
780
784
|
"eslint-config-flat-gitignore": "^2.3.0",
|
|
781
785
|
"eslint-flat-config-utils": "^3.2.0",
|
|
@@ -803,14 +807,14 @@ var package_default = {
|
|
|
803
807
|
"yaml-eslint-parser": "^2.1.0"
|
|
804
808
|
},
|
|
805
809
|
devDependencies: {
|
|
806
|
-
"@eslint-react/eslint-plugin": "^5.14.
|
|
810
|
+
"@eslint-react/eslint-plugin": "^5.14.8",
|
|
807
811
|
"@eslint/compat": "^2.1.0",
|
|
808
|
-
"@eslint/config-inspector": "^3.0
|
|
812
|
+
"@eslint/config-inspector": "^3.1.0",
|
|
809
813
|
"@moso/eslint-plugin": "workspace:*",
|
|
810
814
|
"@next/eslint-plugin-next": "^16.2.10",
|
|
811
815
|
"@types/eslint-plugin-jsx-a11y": "^6.10.1",
|
|
812
816
|
"@types/node": "^26.1.1",
|
|
813
|
-
"@typescript-eslint/rule-tester": "^8.
|
|
817
|
+
"@typescript-eslint/rule-tester": "^8.64.0",
|
|
814
818
|
"astro-eslint-parser": "^3.0.0",
|
|
815
819
|
"bumpp": "^11.1.0",
|
|
816
820
|
"eslint": "^10.7.0",
|
|
@@ -2313,9 +2317,12 @@ const node = async (options = {}) => {
|
|
|
2313
2317
|
},
|
|
2314
2318
|
{
|
|
2315
2319
|
files: [
|
|
2320
|
+
GLOB_ASTRO,
|
|
2316
2321
|
GLOB_DTS,
|
|
2322
|
+
GLOB_JSX,
|
|
2317
2323
|
GLOB_TS,
|
|
2318
|
-
GLOB_TSX
|
|
2324
|
+
GLOB_TSX,
|
|
2325
|
+
GLOB_VUE
|
|
2319
2326
|
],
|
|
2320
2327
|
rules: {
|
|
2321
2328
|
"node/no-extraneous-import": "off",
|
|
@@ -2452,23 +2459,57 @@ const perfectionist = async (options) => {
|
|
|
2452
2459
|
"error",
|
|
2453
2460
|
{
|
|
2454
2461
|
...commonOptions,
|
|
2455
|
-
ignoreCase: true,
|
|
2456
|
-
type: "unsorted",
|
|
2457
|
-
useConfigurationIf: { tagMatchesPattern: "*Component$" }
|
|
2458
|
-
},
|
|
2459
|
-
{
|
|
2460
|
-
...commonOptions,
|
|
2461
|
-
ignoreCase: true,
|
|
2462
2462
|
type: "unsorted",
|
|
2463
|
-
useConfigurationIf: {
|
|
2463
|
+
useConfigurationIf: { tagMatchesPattern: "^[a-z][^.]*$" }
|
|
2464
2464
|
},
|
|
2465
2465
|
{
|
|
2466
2466
|
...commonOptions,
|
|
2467
|
+
customGroups: [
|
|
2468
|
+
{
|
|
2469
|
+
elementNamePattern: ["^role$", "^aria-.+$"],
|
|
2470
|
+
groupName: "a11y"
|
|
2471
|
+
},
|
|
2472
|
+
{
|
|
2473
|
+
elementNamePattern: [
|
|
2474
|
+
"^type$",
|
|
2475
|
+
"^id$",
|
|
2476
|
+
"^className$",
|
|
2477
|
+
"^href$",
|
|
2478
|
+
"^src$",
|
|
2479
|
+
"^srcSet$",
|
|
2480
|
+
"^name$",
|
|
2481
|
+
"^style$"
|
|
2482
|
+
],
|
|
2483
|
+
groupName: "almost-props"
|
|
2484
|
+
},
|
|
2485
|
+
{
|
|
2486
|
+
elementNamePattern: "^on.+",
|
|
2487
|
+
groupName: "callback"
|
|
2488
|
+
},
|
|
2489
|
+
{
|
|
2490
|
+
elementNamePattern: "^(?:class|client|is|server|set|transition):",
|
|
2491
|
+
groupName: "directive"
|
|
2492
|
+
},
|
|
2493
|
+
{
|
|
2494
|
+
elementNamePattern: ["^ref$", "^key$"],
|
|
2495
|
+
groupName: "reserved"
|
|
2496
|
+
}
|
|
2497
|
+
],
|
|
2467
2498
|
fallbackSort: {
|
|
2468
2499
|
order: "asc",
|
|
2469
2500
|
type: "natural"
|
|
2470
2501
|
},
|
|
2471
2502
|
ignoreCase: true,
|
|
2503
|
+
groups: [
|
|
2504
|
+
"reserved",
|
|
2505
|
+
"almost-props",
|
|
2506
|
+
"unknown",
|
|
2507
|
+
"directive",
|
|
2508
|
+
"a11y",
|
|
2509
|
+
"shorthand-prop",
|
|
2510
|
+
"callback",
|
|
2511
|
+
"multiline-prop"
|
|
2512
|
+
],
|
|
2472
2513
|
type: "alphabetical"
|
|
2473
2514
|
}
|
|
2474
2515
|
],
|
|
@@ -3392,7 +3433,6 @@ const typescript = async (options) => {
|
|
|
3392
3433
|
"no-extra-boolean-cast": "off",
|
|
3393
3434
|
"no-implied-eval": "off",
|
|
3394
3435
|
"no-invalid-this": "off",
|
|
3395
|
-
"no-loop-func": "off",
|
|
3396
3436
|
"no-loss-of-precision": "off",
|
|
3397
3437
|
"no-unused-vars": "off",
|
|
3398
3438
|
"no-use-before-define": "off",
|
|
@@ -3441,7 +3481,6 @@ const typescript = async (options) => {
|
|
|
3441
3481
|
"@typescript-eslint/no-explicit-any": unsafe,
|
|
3442
3482
|
"@typescript-eslint/no-import-type-side-effects": "error",
|
|
3443
3483
|
"@typescript-eslint/no-invalid-this": "off",
|
|
3444
|
-
"@typescript-eslint/no-loop-func": "error",
|
|
3445
3484
|
"@typescript-eslint/no-unused-expressions": ["error", {
|
|
3446
3485
|
allowShortCircuit: true,
|
|
3447
3486
|
allowTaggedTemplates: true,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moso/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.3",
|
|
5
5
|
"description": "@moso's sharable ESLint config",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Morten Sørensen",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"src/rules"
|
|
63
63
|
],
|
|
64
64
|
"peerDependencies": {
|
|
65
|
-
"@eslint-react/eslint-plugin": "^5.14.
|
|
65
|
+
"@eslint-react/eslint-plugin": "^5.14.8",
|
|
66
66
|
"@next/eslint-plugin-next": "^16.2.10",
|
|
67
67
|
"astro-eslint-parser": "^3.0.0",
|
|
68
68
|
"eslint": "^10.0.0",
|
|
@@ -121,9 +121,9 @@
|
|
|
121
121
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.7.2",
|
|
122
122
|
"@eslint/js": "^10.0.1",
|
|
123
123
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
124
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
125
|
-
"@typescript-eslint/parser": "^8.
|
|
126
|
-
"@typescript-eslint/utils": "^8.
|
|
124
|
+
"@typescript-eslint/eslint-plugin": "^8.64.0",
|
|
125
|
+
"@typescript-eslint/parser": "^8.64.0",
|
|
126
|
+
"@typescript-eslint/utils": "^8.64.0",
|
|
127
127
|
"@vitest/eslint-plugin": "^1.6.23",
|
|
128
128
|
"eslint-config-flat-gitignore": "^2.3.0",
|
|
129
129
|
"eslint-flat-config-utils": "^3.2.0",
|
|
@@ -151,14 +151,14 @@
|
|
|
151
151
|
"yaml-eslint-parser": "^2.1.0"
|
|
152
152
|
},
|
|
153
153
|
"devDependencies": {
|
|
154
|
-
"@eslint-react/eslint-plugin": "^5.14.
|
|
154
|
+
"@eslint-react/eslint-plugin": "^5.14.8",
|
|
155
155
|
"@eslint/compat": "^2.1.0",
|
|
156
|
-
"@eslint/config-inspector": "^3.0
|
|
157
|
-
"@moso/eslint-plugin": "3.0.
|
|
156
|
+
"@eslint/config-inspector": "^3.1.0",
|
|
157
|
+
"@moso/eslint-plugin": "3.0.1",
|
|
158
158
|
"@next/eslint-plugin-next": "^16.2.10",
|
|
159
159
|
"@types/eslint-plugin-jsx-a11y": "^6.10.1",
|
|
160
160
|
"@types/node": "^26.1.1",
|
|
161
|
-
"@typescript-eslint/rule-tester": "^8.
|
|
161
|
+
"@typescript-eslint/rule-tester": "^8.64.0",
|
|
162
162
|
"astro-eslint-parser": "^3.0.0",
|
|
163
163
|
"bumpp": "^11.1.0",
|
|
164
164
|
"eslint": "^10.7.0",
|