@luxass/eslint-config 4.14.0 → 4.15.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/dist/index.cjs +34 -14
- package/dist/index.d.cts +1139 -185
- package/dist/index.d.ts +1139 -185
- package/dist/index.js +33 -13
- package/package.json +39 -39
package/dist/index.js
CHANGED
|
@@ -237,6 +237,9 @@ async function astro(options = {}) {
|
|
|
237
237
|
},
|
|
238
238
|
processor: "astro/client-side-ts",
|
|
239
239
|
rules: {
|
|
240
|
+
// Astro uses top level await for e.g. data fetching
|
|
241
|
+
// https://docs.astro.build/en/guides/data-fetching/#fetch-in-astro
|
|
242
|
+
"antfu/no-top-level-await": "off",
|
|
240
243
|
// use recommended rules
|
|
241
244
|
"astro/missing-client-only-directive-value": "error",
|
|
242
245
|
"astro/no-conflict-set-directives": "error",
|
|
@@ -526,7 +529,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
526
529
|
});
|
|
527
530
|
}
|
|
528
531
|
if (options.markdown) {
|
|
529
|
-
const
|
|
532
|
+
const formatter = options.markdown === true ? "prettier" : options.markdown;
|
|
530
533
|
configs2.push({
|
|
531
534
|
name: "luxass/formatter/markdown",
|
|
532
535
|
files: [GLOB_MARKDOWN],
|
|
@@ -534,9 +537,9 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
534
537
|
parser: parserPlain
|
|
535
538
|
},
|
|
536
539
|
rules: {
|
|
537
|
-
[`format/${
|
|
540
|
+
[`format/${formatter}`]: [
|
|
538
541
|
"error",
|
|
539
|
-
|
|
542
|
+
formatter === "prettier" ? mergePrettierOptions(prettierOptions, {
|
|
540
543
|
embeddedLanguageFormatting: "off",
|
|
541
544
|
parser: "markdown"
|
|
542
545
|
}) : {
|
|
@@ -1144,10 +1147,10 @@ async function perfectionist() {
|
|
|
1144
1147
|
"perfectionist/sort-imports": ["error", {
|
|
1145
1148
|
groups: [
|
|
1146
1149
|
"type",
|
|
1147
|
-
["parent-type", "sibling-type", "index-type"],
|
|
1150
|
+
["parent-type", "sibling-type", "index-type", "internal-type"],
|
|
1148
1151
|
"builtin",
|
|
1149
1152
|
"external",
|
|
1150
|
-
|
|
1153
|
+
"internal",
|
|
1151
1154
|
["parent", "sibling", "index"],
|
|
1152
1155
|
"side-effect",
|
|
1153
1156
|
"object",
|
|
@@ -1175,6 +1178,12 @@ var RemixPackages = [
|
|
|
1175
1178
|
"@remix-run/serve",
|
|
1176
1179
|
"@remix-run/dev"
|
|
1177
1180
|
];
|
|
1181
|
+
var ReactRouterPackages = [
|
|
1182
|
+
"@react-router/node",
|
|
1183
|
+
"@react-router/react",
|
|
1184
|
+
"@react-router/serve",
|
|
1185
|
+
"@react-router/dev"
|
|
1186
|
+
];
|
|
1178
1187
|
var NextJsPackages = [
|
|
1179
1188
|
"next"
|
|
1180
1189
|
];
|
|
@@ -1209,6 +1218,7 @@ async function react(options = {}) {
|
|
|
1209
1218
|
]);
|
|
1210
1219
|
const isAllowConstantExport = ReactRefreshAllowConstantExportPackages.some((i) => isPackageExists2(i));
|
|
1211
1220
|
const isUsingRemix = RemixPackages.some((i) => isPackageExists2(i));
|
|
1221
|
+
const isUsingReactRouter = ReactRouterPackages.some((i) => isPackageExists2(i));
|
|
1212
1222
|
const isUsingNext = NextJsPackages.some((i) => isPackageExists2(i));
|
|
1213
1223
|
const plugins = pluginReact.configs.all.plugins;
|
|
1214
1224
|
return [
|
|
@@ -1220,7 +1230,8 @@ async function react(options = {}) {
|
|
|
1220
1230
|
"react-hooks": pluginReactHooks,
|
|
1221
1231
|
"react-hooks-extra": plugins["@eslint-react/hooks-extra"],
|
|
1222
1232
|
"react-naming-convention": plugins["@eslint-react/naming-convention"],
|
|
1223
|
-
"react-refresh": pluginReactRefresh
|
|
1233
|
+
"react-refresh": pluginReactRefresh,
|
|
1234
|
+
"react-web-api": plugins["@eslint-react/web-api"]
|
|
1224
1235
|
}
|
|
1225
1236
|
},
|
|
1226
1237
|
{
|
|
@@ -1272,7 +1283,7 @@ async function react(options = {}) {
|
|
|
1272
1283
|
"viewport",
|
|
1273
1284
|
"generateViewport"
|
|
1274
1285
|
] : [],
|
|
1275
|
-
...isUsingRemix ? [
|
|
1286
|
+
...isUsingRemix || isUsingReactRouter ? [
|
|
1276
1287
|
"meta",
|
|
1277
1288
|
"links",
|
|
1278
1289
|
"headers",
|
|
@@ -1282,27 +1293,37 @@ async function react(options = {}) {
|
|
|
1282
1293
|
]
|
|
1283
1294
|
}
|
|
1284
1295
|
],
|
|
1296
|
+
// recommended rules from @eslint-react/web-api
|
|
1297
|
+
"react-web-api/no-leaked-event-listener": "warn",
|
|
1298
|
+
"react-web-api/no-leaked-interval": "warn",
|
|
1299
|
+
"react-web-api/no-leaked-resize-observer": "warn",
|
|
1300
|
+
"react-web-api/no-leaked-timeout": "warn",
|
|
1285
1301
|
// recommended rules from @eslint-react
|
|
1286
1302
|
"react/ensure-forward-ref-using-ref": "warn",
|
|
1303
|
+
"react/jsx-no-duplicate-props": "warn",
|
|
1304
|
+
"react/jsx-uses-vars": "warn",
|
|
1287
1305
|
"react/no-access-state-in-setstate": "error",
|
|
1288
1306
|
"react/no-array-index-key": "warn",
|
|
1289
1307
|
"react/no-children-count": "warn",
|
|
1290
1308
|
"react/no-children-for-each": "warn",
|
|
1291
1309
|
"react/no-children-map": "warn",
|
|
1292
1310
|
"react/no-children-only": "warn",
|
|
1293
|
-
"react/no-children-prop": "warn",
|
|
1294
1311
|
"react/no-children-to-array": "warn",
|
|
1295
1312
|
"react/no-clone-element": "warn",
|
|
1296
1313
|
"react/no-comment-textnodes": "warn",
|
|
1297
1314
|
"react/no-component-will-mount": "error",
|
|
1298
1315
|
"react/no-component-will-receive-props": "error",
|
|
1299
1316
|
"react/no-component-will-update": "error",
|
|
1317
|
+
"react/no-context-provider": "warn",
|
|
1300
1318
|
"react/no-create-ref": "error",
|
|
1319
|
+
"react/no-default-props": "error",
|
|
1301
1320
|
"react/no-direct-mutation-state": "error",
|
|
1302
1321
|
"react/no-duplicate-key": "error",
|
|
1303
|
-
"react/no-
|
|
1322
|
+
"react/no-forward-ref": "warn",
|
|
1323
|
+
"react/no-implicit-key": "warn",
|
|
1304
1324
|
"react/no-missing-key": "error",
|
|
1305
|
-
"react/no-nested-components": "
|
|
1325
|
+
"react/no-nested-components": "error",
|
|
1326
|
+
"react/no-prop-types": "error",
|
|
1306
1327
|
"react/no-redundant-should-component-update": "error",
|
|
1307
1328
|
"react/no-set-state-in-component-did-mount": "warn",
|
|
1308
1329
|
"react/no-set-state-in-component-did-update": "warn",
|
|
@@ -1311,11 +1332,10 @@ async function react(options = {}) {
|
|
|
1311
1332
|
"react/no-unsafe-component-will-mount": "warn",
|
|
1312
1333
|
"react/no-unsafe-component-will-receive-props": "warn",
|
|
1313
1334
|
"react/no-unsafe-component-will-update": "warn",
|
|
1314
|
-
"react/no-unstable-context-value": "
|
|
1315
|
-
"react/no-unstable-default-props": "
|
|
1335
|
+
"react/no-unstable-context-value": "warn",
|
|
1336
|
+
"react/no-unstable-default-props": "warn",
|
|
1316
1337
|
"react/no-unused-class-component-members": "warn",
|
|
1317
1338
|
"react/no-unused-state": "warn",
|
|
1318
|
-
"react/no-useless-fragment": "warn",
|
|
1319
1339
|
"react/prefer-destructuring-assignment": "warn",
|
|
1320
1340
|
"react/prefer-shorthand-boolean": "warn",
|
|
1321
1341
|
"react/prefer-shorthand-fragment": "warn",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luxass/eslint-config",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.15.0",
|
|
4
4
|
"description": "ESLint config for @luxass",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
@@ -44,17 +44,17 @@
|
|
|
44
44
|
"test": "vitest --run",
|
|
45
45
|
"typegen": "tsx ./scripts/typegen.ts",
|
|
46
46
|
"test:watch": "vitest",
|
|
47
|
-
"lint": "eslint
|
|
47
|
+
"lint": "eslint .",
|
|
48
48
|
"typecheck": "tsc --noEmit"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@eslint-react/eslint-plugin": "^1.
|
|
51
|
+
"@eslint-react/eslint-plugin": "^1.19.0",
|
|
52
52
|
"@unocss/eslint-plugin": ">=0.50.0",
|
|
53
53
|
"astro-eslint-parser": "^1.0.2",
|
|
54
|
-
"eslint": "
|
|
54
|
+
"eslint": "^9.10.0",
|
|
55
55
|
"eslint-plugin-astro": "^1.2.0",
|
|
56
56
|
"eslint-plugin-format": ">=0.1.0",
|
|
57
|
-
"eslint-plugin-react-hooks": "^
|
|
57
|
+
"eslint-plugin-react-hooks": "^5.0.0",
|
|
58
58
|
"eslint-plugin-react-refresh": "^0.4.4",
|
|
59
59
|
"eslint-plugin-tailwindcss": "^3.17.0",
|
|
60
60
|
"prettier-plugin-astro": "^0.14.0"
|
|
@@ -89,68 +89,68 @@
|
|
|
89
89
|
}
|
|
90
90
|
},
|
|
91
91
|
"dependencies": {
|
|
92
|
-
"@antfu/install-pkg": "^0.
|
|
93
|
-
"@clack/prompts": "^0.
|
|
92
|
+
"@antfu/install-pkg": "^1.0.0",
|
|
93
|
+
"@clack/prompts": "^0.9.1",
|
|
94
94
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
|
|
95
95
|
"@eslint/markdown": "^6.2.1",
|
|
96
|
-
"@stylistic/eslint-plugin": "^2.
|
|
97
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
98
|
-
"@typescript-eslint/parser": "^8.
|
|
99
|
-
"@vitest/eslint-plugin": "^1.1.
|
|
100
|
-
"eslint-config-flat-gitignore": "^0.
|
|
101
|
-
"eslint-flat-config-utils": "^0.
|
|
102
|
-
"eslint-merge-processors": "^
|
|
96
|
+
"@stylistic/eslint-plugin": "^2.13.0",
|
|
97
|
+
"@typescript-eslint/eslint-plugin": "^8.19.1",
|
|
98
|
+
"@typescript-eslint/parser": "^8.19.1",
|
|
99
|
+
"@vitest/eslint-plugin": "^1.1.25",
|
|
100
|
+
"eslint-config-flat-gitignore": "^1.0.0",
|
|
101
|
+
"eslint-flat-config-utils": "^1.0.0",
|
|
102
|
+
"eslint-merge-processors": "^1.0.0",
|
|
103
103
|
"eslint-plugin-antfu": "^2.7.0",
|
|
104
|
-
"eslint-plugin-import-x": "^4.
|
|
105
|
-
"eslint-plugin-jsdoc": "^50.
|
|
104
|
+
"eslint-plugin-import-x": "^4.6.1",
|
|
105
|
+
"eslint-plugin-jsdoc": "^50.6.1",
|
|
106
106
|
"eslint-plugin-jsonc": "^2.18.2",
|
|
107
|
-
"eslint-plugin-n": "^17.
|
|
108
|
-
"eslint-plugin-perfectionist": "^4.0
|
|
107
|
+
"eslint-plugin-n": "^17.15.1",
|
|
108
|
+
"eslint-plugin-perfectionist": "^4.6.0",
|
|
109
109
|
"eslint-plugin-regexp": "^2.7.0",
|
|
110
|
-
"eslint-plugin-toml": "^0.
|
|
110
|
+
"eslint-plugin-toml": "^0.12.0",
|
|
111
111
|
"eslint-plugin-unicorn": "^56.0.1",
|
|
112
112
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
113
|
-
"eslint-plugin-vue": "^9.
|
|
114
|
-
"eslint-plugin-yml": "^1.
|
|
115
|
-
"eslint-processor-vue-blocks": "^0.
|
|
116
|
-
"globals": "^15.
|
|
113
|
+
"eslint-plugin-vue": "^9.32.0",
|
|
114
|
+
"eslint-plugin-yml": "^1.16.0",
|
|
115
|
+
"eslint-processor-vue-blocks": "^1.0.0",
|
|
116
|
+
"globals": "^15.14.0",
|
|
117
117
|
"jsonc-eslint-parser": "^2.4.0",
|
|
118
|
-
"local-pkg": "^0.
|
|
118
|
+
"local-pkg": "^1.0.0",
|
|
119
119
|
"parse-gitignore": "^2.0.0",
|
|
120
120
|
"toml-eslint-parser": "^0.10.0",
|
|
121
121
|
"vue-eslint-parser": "^9.4.3",
|
|
122
122
|
"yaml-eslint-parser": "^1.2.3"
|
|
123
123
|
},
|
|
124
124
|
"devDependencies": {
|
|
125
|
-
"@eslint-react/eslint-plugin": "^1.
|
|
126
|
-
"@eslint/config-inspector": "^0.
|
|
127
|
-
"@stylistic/eslint-plugin-migrate": "^2.
|
|
125
|
+
"@eslint-react/eslint-plugin": "^1.23.2",
|
|
126
|
+
"@eslint/config-inspector": "^0.7.1",
|
|
127
|
+
"@stylistic/eslint-plugin-migrate": "^2.13.0",
|
|
128
128
|
"@types/estree": "^1.0.6",
|
|
129
|
-
"@types/node": "^22.
|
|
129
|
+
"@types/node": "^22.10.5",
|
|
130
130
|
"@typescript-eslint/rule-tester": "^8.16.0",
|
|
131
|
-
"@unocss/eslint-plugin": "^
|
|
131
|
+
"@unocss/eslint-plugin": "^65.4.0",
|
|
132
132
|
"astro-eslint-parser": "^1.1.0",
|
|
133
|
-
"eslint": "^9.
|
|
133
|
+
"eslint": "^9.18.0",
|
|
134
134
|
"eslint-plugin-astro": "^1.3.1",
|
|
135
|
-
"eslint-plugin-format": "^0.1
|
|
136
|
-
"eslint-plugin-react-hooks": "^5.
|
|
137
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
135
|
+
"eslint-plugin-format": "^1.0.1",
|
|
136
|
+
"eslint-plugin-react-hooks": "^5.1.0",
|
|
137
|
+
"eslint-plugin-react-refresh": "^0.4.18",
|
|
138
138
|
"eslint-plugin-tailwindcss": "^3.17.5",
|
|
139
|
-
"eslint-typegen": "^0.
|
|
140
|
-
"jiti": "^2.4.
|
|
139
|
+
"eslint-typegen": "^1.0.0",
|
|
140
|
+
"jiti": "^2.4.2",
|
|
141
141
|
"prettier-plugin-astro": "^0.14.1",
|
|
142
142
|
"tailwindcss": "^3.4.15",
|
|
143
143
|
"tsup": "^8.3.5",
|
|
144
144
|
"tsx": "^4.19.2",
|
|
145
|
-
"typescript": "^5.7.
|
|
145
|
+
"typescript": "^5.7.3",
|
|
146
146
|
"unocss": "^0.64.1",
|
|
147
|
-
"vitest": "^2.1.
|
|
147
|
+
"vitest": "^2.1.8",
|
|
148
148
|
"vue": "^3.5.13"
|
|
149
149
|
},
|
|
150
150
|
"resolutions": {
|
|
151
151
|
"@eslint-community/eslint-utils": "^4.4.1",
|
|
152
|
-
"@typescript-eslint/utils": "^8.
|
|
153
|
-
"eslint": "^9.
|
|
152
|
+
"@typescript-eslint/utils": "^8.19.1",
|
|
153
|
+
"eslint": "^9.18.0",
|
|
154
154
|
"tsx": "^4.19.2"
|
|
155
155
|
}
|
|
156
156
|
}
|