@moso/eslint-config 3.0.1 → 3.0.2
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 +26 -36
- 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.2",
|
|
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",
|
|
@@ -2448,30 +2455,15 @@ const perfectionist = async (options) => {
|
|
|
2448
2455
|
ignoreCase: true,
|
|
2449
2456
|
type: "alphabetical"
|
|
2450
2457
|
}],
|
|
2451
|
-
"perfectionist/sort-jsx-props": [
|
|
2452
|
-
|
|
2453
|
-
{
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
type: "unsorted",
|
|
2457
|
-
useConfigurationIf: { tagMatchesPattern: "*Component$" }
|
|
2458
|
-
},
|
|
2459
|
-
{
|
|
2460
|
-
...commonOptions,
|
|
2461
|
-
ignoreCase: true,
|
|
2462
|
-
type: "unsorted",
|
|
2463
|
-
useConfigurationIf: { matchesAstSelector: "VariableDeclaration[kind=\"const\"] JSXElement" }
|
|
2458
|
+
"perfectionist/sort-jsx-props": ["error", {
|
|
2459
|
+
...commonOptions,
|
|
2460
|
+
fallbackSort: {
|
|
2461
|
+
order: "asc",
|
|
2462
|
+
type: "natural"
|
|
2464
2463
|
},
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
order: "asc",
|
|
2469
|
-
type: "natural"
|
|
2470
|
-
},
|
|
2471
|
-
ignoreCase: true,
|
|
2472
|
-
type: "alphabetical"
|
|
2473
|
-
}
|
|
2474
|
-
],
|
|
2464
|
+
ignoreCase: true,
|
|
2465
|
+
type: "alphabetical"
|
|
2466
|
+
}],
|
|
2475
2467
|
"perfectionist/sort-maps": [
|
|
2476
2468
|
"error",
|
|
2477
2469
|
{
|
|
@@ -3392,7 +3384,6 @@ const typescript = async (options) => {
|
|
|
3392
3384
|
"no-extra-boolean-cast": "off",
|
|
3393
3385
|
"no-implied-eval": "off",
|
|
3394
3386
|
"no-invalid-this": "off",
|
|
3395
|
-
"no-loop-func": "off",
|
|
3396
3387
|
"no-loss-of-precision": "off",
|
|
3397
3388
|
"no-unused-vars": "off",
|
|
3398
3389
|
"no-use-before-define": "off",
|
|
@@ -3441,7 +3432,6 @@ const typescript = async (options) => {
|
|
|
3441
3432
|
"@typescript-eslint/no-explicit-any": unsafe,
|
|
3442
3433
|
"@typescript-eslint/no-import-type-side-effects": "error",
|
|
3443
3434
|
"@typescript-eslint/no-invalid-this": "off",
|
|
3444
|
-
"@typescript-eslint/no-loop-func": "error",
|
|
3445
3435
|
"@typescript-eslint/no-unused-expressions": ["error", {
|
|
3446
3436
|
allowShortCircuit: true,
|
|
3447
3437
|
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.2",
|
|
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",
|