@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 CHANGED
@@ -102,7 +102,7 @@ __export(src_exports, {
102
102
  });
103
103
  module.exports = __toCommonJS(src_exports);
104
104
 
105
- // node_modules/.pnpm/tsup@8.3.5_jiti@2.4.0_postcss@8.4.47_tsx@4.19.2_typescript@5.7.2_yaml@2.6.0/node_modules/tsup/assets/cjs_shims.js
105
+ // node_modules/.pnpm/tsup@8.3.5_jiti@2.4.2_postcss@8.4.47_tsx@4.19.2_typescript@5.7.3_yaml@2.6.0/node_modules/tsup/assets/cjs_shims.js
106
106
  var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
107
107
  var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
108
108
 
@@ -345,6 +345,9 @@ async function astro(options = {}) {
345
345
  },
346
346
  processor: "astro/client-side-ts",
347
347
  rules: {
348
+ // Astro uses top level await for e.g. data fetching
349
+ // https://docs.astro.build/en/guides/data-fetching/#fetch-in-astro
350
+ "antfu/no-top-level-await": "off",
348
351
  // use recommended rules
349
352
  "astro/missing-client-only-directive-value": "error",
350
353
  "astro/no-conflict-set-directives": "error",
@@ -634,7 +637,7 @@ async function formatters(options = {}, stylistic2 = {}) {
634
637
  });
635
638
  }
636
639
  if (options.markdown) {
637
- const formater = options.markdown === true ? "prettier" : options.markdown;
640
+ const formatter = options.markdown === true ? "prettier" : options.markdown;
638
641
  configs2.push({
639
642
  name: "luxass/formatter/markdown",
640
643
  files: [GLOB_MARKDOWN],
@@ -642,9 +645,9 @@ async function formatters(options = {}, stylistic2 = {}) {
642
645
  parser: parserPlain
643
646
  },
644
647
  rules: {
645
- [`format/${formater}`]: [
648
+ [`format/${formatter}`]: [
646
649
  "error",
647
- formater === "prettier" ? mergePrettierOptions(prettierOptions, {
650
+ formatter === "prettier" ? mergePrettierOptions(prettierOptions, {
648
651
  embeddedLanguageFormatting: "off",
649
652
  parser: "markdown"
650
653
  }) : {
@@ -1252,10 +1255,10 @@ async function perfectionist() {
1252
1255
  "perfectionist/sort-imports": ["error", {
1253
1256
  groups: [
1254
1257
  "type",
1255
- ["parent-type", "sibling-type", "index-type"],
1258
+ ["parent-type", "sibling-type", "index-type", "internal-type"],
1256
1259
  "builtin",
1257
1260
  "external",
1258
- ["internal", "internal-type"],
1261
+ "internal",
1259
1262
  ["parent", "sibling", "index"],
1260
1263
  "side-effect",
1261
1264
  "object",
@@ -1283,6 +1286,12 @@ var RemixPackages = [
1283
1286
  "@remix-run/serve",
1284
1287
  "@remix-run/dev"
1285
1288
  ];
1289
+ var ReactRouterPackages = [
1290
+ "@react-router/node",
1291
+ "@react-router/react",
1292
+ "@react-router/serve",
1293
+ "@react-router/dev"
1294
+ ];
1286
1295
  var NextJsPackages = [
1287
1296
  "next"
1288
1297
  ];
@@ -1317,6 +1326,7 @@ async function react(options = {}) {
1317
1326
  ]);
1318
1327
  const isAllowConstantExport = ReactRefreshAllowConstantExportPackages.some((i) => (0, import_local_pkg2.isPackageExists)(i));
1319
1328
  const isUsingRemix = RemixPackages.some((i) => (0, import_local_pkg2.isPackageExists)(i));
1329
+ const isUsingReactRouter = ReactRouterPackages.some((i) => (0, import_local_pkg2.isPackageExists)(i));
1320
1330
  const isUsingNext = NextJsPackages.some((i) => (0, import_local_pkg2.isPackageExists)(i));
1321
1331
  const plugins = pluginReact.configs.all.plugins;
1322
1332
  return [
@@ -1328,7 +1338,8 @@ async function react(options = {}) {
1328
1338
  "react-hooks": pluginReactHooks,
1329
1339
  "react-hooks-extra": plugins["@eslint-react/hooks-extra"],
1330
1340
  "react-naming-convention": plugins["@eslint-react/naming-convention"],
1331
- "react-refresh": pluginReactRefresh
1341
+ "react-refresh": pluginReactRefresh,
1342
+ "react-web-api": plugins["@eslint-react/web-api"]
1332
1343
  }
1333
1344
  },
1334
1345
  {
@@ -1380,7 +1391,7 @@ async function react(options = {}) {
1380
1391
  "viewport",
1381
1392
  "generateViewport"
1382
1393
  ] : [],
1383
- ...isUsingRemix ? [
1394
+ ...isUsingRemix || isUsingReactRouter ? [
1384
1395
  "meta",
1385
1396
  "links",
1386
1397
  "headers",
@@ -1390,27 +1401,37 @@ async function react(options = {}) {
1390
1401
  ]
1391
1402
  }
1392
1403
  ],
1404
+ // recommended rules from @eslint-react/web-api
1405
+ "react-web-api/no-leaked-event-listener": "warn",
1406
+ "react-web-api/no-leaked-interval": "warn",
1407
+ "react-web-api/no-leaked-resize-observer": "warn",
1408
+ "react-web-api/no-leaked-timeout": "warn",
1393
1409
  // recommended rules from @eslint-react
1394
1410
  "react/ensure-forward-ref-using-ref": "warn",
1411
+ "react/jsx-no-duplicate-props": "warn",
1412
+ "react/jsx-uses-vars": "warn",
1395
1413
  "react/no-access-state-in-setstate": "error",
1396
1414
  "react/no-array-index-key": "warn",
1397
1415
  "react/no-children-count": "warn",
1398
1416
  "react/no-children-for-each": "warn",
1399
1417
  "react/no-children-map": "warn",
1400
1418
  "react/no-children-only": "warn",
1401
- "react/no-children-prop": "warn",
1402
1419
  "react/no-children-to-array": "warn",
1403
1420
  "react/no-clone-element": "warn",
1404
1421
  "react/no-comment-textnodes": "warn",
1405
1422
  "react/no-component-will-mount": "error",
1406
1423
  "react/no-component-will-receive-props": "error",
1407
1424
  "react/no-component-will-update": "error",
1425
+ "react/no-context-provider": "warn",
1408
1426
  "react/no-create-ref": "error",
1427
+ "react/no-default-props": "error",
1409
1428
  "react/no-direct-mutation-state": "error",
1410
1429
  "react/no-duplicate-key": "error",
1411
- "react/no-implicit-key": "error",
1430
+ "react/no-forward-ref": "warn",
1431
+ "react/no-implicit-key": "warn",
1412
1432
  "react/no-missing-key": "error",
1413
- "react/no-nested-components": "warn",
1433
+ "react/no-nested-components": "error",
1434
+ "react/no-prop-types": "error",
1414
1435
  "react/no-redundant-should-component-update": "error",
1415
1436
  "react/no-set-state-in-component-did-mount": "warn",
1416
1437
  "react/no-set-state-in-component-did-update": "warn",
@@ -1419,11 +1440,10 @@ async function react(options = {}) {
1419
1440
  "react/no-unsafe-component-will-mount": "warn",
1420
1441
  "react/no-unsafe-component-will-receive-props": "warn",
1421
1442
  "react/no-unsafe-component-will-update": "warn",
1422
- "react/no-unstable-context-value": "error",
1423
- "react/no-unstable-default-props": "error",
1443
+ "react/no-unstable-context-value": "warn",
1444
+ "react/no-unstable-default-props": "warn",
1424
1445
  "react/no-unused-class-component-members": "warn",
1425
1446
  "react/no-unused-state": "warn",
1426
- "react/no-useless-fragment": "warn",
1427
1447
  "react/prefer-destructuring-assignment": "warn",
1428
1448
  "react/prefer-shorthand-boolean": "warn",
1429
1449
  "react/prefer-shorthand-fragment": "warn",