@vinicunca/eslint-config 2.13.2 → 2.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 +33 -22
- package/dist/index.d.cts +1687 -257
- package/dist/index.d.ts +1687 -257
- package/dist/index.js +32 -21
- package/package.json +16 -10
package/dist/index.cjs
CHANGED
|
@@ -112,7 +112,7 @@ __export(src_exports, {
|
|
|
112
112
|
});
|
|
113
113
|
module.exports = __toCommonJS(src_exports);
|
|
114
114
|
|
|
115
|
-
// ../node_modules/.pnpm/tsup@8.3.5_jiti@2.4.
|
|
115
|
+
// ../node_modules/.pnpm/tsup@8.3.5_jiti@2.4.1_postcss@8.4.49_tsx@4.19.2_typescript@5.7.2_yaml@2.5.0/node_modules/tsup/assets/cjs_shims.js
|
|
116
116
|
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
|
|
117
117
|
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
118
118
|
|
|
@@ -1349,10 +1349,10 @@ async function perfectionist() {
|
|
|
1349
1349
|
{
|
|
1350
1350
|
groups: [
|
|
1351
1351
|
"type",
|
|
1352
|
-
["parent-type", "sibling-type", "index-type"],
|
|
1352
|
+
["parent-type", "sibling-type", "index-type", "internal-type"],
|
|
1353
1353
|
"builtin",
|
|
1354
1354
|
"external",
|
|
1355
|
-
|
|
1355
|
+
"internal",
|
|
1356
1356
|
["parent", "sibling", "index"],
|
|
1357
1357
|
"side-effect",
|
|
1358
1358
|
"object",
|
|
@@ -1394,20 +1394,26 @@ var NextJsPackages = [
|
|
|
1394
1394
|
async function react(options = {}) {
|
|
1395
1395
|
const {
|
|
1396
1396
|
files = [GLOB_SRC],
|
|
1397
|
-
|
|
1397
|
+
filesTypeAware = [GLOB_TS, GLOB_TSX],
|
|
1398
|
+
ignoresTypeAware = [
|
|
1399
|
+
`${GLOB_MARKDOWN}/**`,
|
|
1400
|
+
GLOB_ASTRO_TS
|
|
1401
|
+
],
|
|
1402
|
+
overrides = {},
|
|
1403
|
+
tsconfigPath
|
|
1398
1404
|
} = options;
|
|
1399
|
-
const tsconfigPath = options?.tsconfigPath ? toArray(options.tsconfigPath) : void 0;
|
|
1400
1405
|
const isTypeAware = !!tsconfigPath;
|
|
1406
|
+
const typeAwareRules = {
|
|
1407
|
+
"react/no-leaked-conditional-rendering": "warn"
|
|
1408
|
+
};
|
|
1401
1409
|
const [
|
|
1402
1410
|
pluginReact,
|
|
1403
1411
|
pluginReactHooks,
|
|
1404
|
-
pluginReactRefresh
|
|
1405
|
-
parserTs
|
|
1412
|
+
pluginReactRefresh
|
|
1406
1413
|
] = await Promise.all([
|
|
1407
1414
|
interopDefault(import("@eslint-react/eslint-plugin")),
|
|
1408
1415
|
interopDefault(import("eslint-plugin-react-hooks")),
|
|
1409
|
-
interopDefault(import("eslint-plugin-react-refresh"))
|
|
1410
|
-
interopDefault(import("@typescript-eslint/parser"))
|
|
1416
|
+
interopDefault(import("eslint-plugin-react-refresh"))
|
|
1411
1417
|
]);
|
|
1412
1418
|
const isAllowConstantExport = ReactRefreshAllowConstantExportPackages.some((i) => (0, import_local_pkg3.isPackageExists)(i));
|
|
1413
1419
|
const isUsingRemix = RemixPackages.some((i) => (0, import_local_pkg3.isPackageExists)(i));
|
|
@@ -1428,12 +1434,10 @@ async function react(options = {}) {
|
|
|
1428
1434
|
{
|
|
1429
1435
|
files,
|
|
1430
1436
|
languageOptions: {
|
|
1431
|
-
parser: parserTs,
|
|
1432
1437
|
parserOptions: {
|
|
1433
1438
|
ecmaFeatures: {
|
|
1434
1439
|
jsx: true
|
|
1435
|
-
}
|
|
1436
|
-
...isTypeAware ? { project: tsconfigPath } : {}
|
|
1440
|
+
}
|
|
1437
1441
|
},
|
|
1438
1442
|
sourceType: "module"
|
|
1439
1443
|
},
|
|
@@ -1515,13 +1519,18 @@ async function react(options = {}) {
|
|
|
1515
1519
|
"react/prefer-destructuring-assignment": WARN,
|
|
1516
1520
|
"react/prefer-shorthand-boolean": WARN,
|
|
1517
1521
|
"react/prefer-shorthand-fragment": WARN,
|
|
1518
|
-
...isTypeAware ? {
|
|
1519
|
-
"react/no-leaked-conditional-rendering": WARN
|
|
1520
|
-
} : {},
|
|
1521
1522
|
// overrides
|
|
1522
1523
|
...overrides
|
|
1523
1524
|
}
|
|
1524
|
-
}
|
|
1525
|
+
},
|
|
1526
|
+
...isTypeAware ? [{
|
|
1527
|
+
files: filesTypeAware,
|
|
1528
|
+
ignores: ignoresTypeAware,
|
|
1529
|
+
name: "antfu/react/type-aware-rules",
|
|
1530
|
+
rules: {
|
|
1531
|
+
...typeAwareRules
|
|
1532
|
+
}
|
|
1533
|
+
}] : []
|
|
1525
1534
|
];
|
|
1526
1535
|
}
|
|
1527
1536
|
|
|
@@ -1633,7 +1642,9 @@ async function sonar() {
|
|
|
1633
1642
|
sonar: import_eslint_plugin_sonarjs.default
|
|
1634
1643
|
},
|
|
1635
1644
|
rules: {
|
|
1636
|
-
...import_eslint_plugin_sonarjs.default.configs.recommended.rules
|
|
1645
|
+
...import_eslint_plugin_sonarjs.default.configs.recommended.rules,
|
|
1646
|
+
"sonar/todo-tag": OFF,
|
|
1647
|
+
"sonar/pseudo-random": OFF
|
|
1637
1648
|
}
|
|
1638
1649
|
}
|
|
1639
1650
|
];
|
|
@@ -2543,8 +2554,7 @@ async function yaml(options = {}) {
|
|
|
2543
2554
|
"yaml/indent": [ERROR, indent === "tab" ? 2 : indent],
|
|
2544
2555
|
"yaml/key-spacing": ERROR,
|
|
2545
2556
|
"yaml/no-tab-indent": ERROR,
|
|
2546
|
-
|
|
2547
|
-
"yaml/quotes": [ERROR, { avoidEscape: false, prefer: quotes }],
|
|
2557
|
+
"yaml/quotes": [ERROR, { avoidEscape: true, prefer: quotes === "backtick" ? "single" : quotes }],
|
|
2548
2558
|
"yaml/spaced-comment": ERROR
|
|
2549
2559
|
} : {},
|
|
2550
2560
|
...overrides
|
|
@@ -2694,6 +2704,7 @@ function vinicuncaESLint(options = {}, ...userConfigs) {
|
|
|
2694
2704
|
}
|
|
2695
2705
|
if (enableReact) {
|
|
2696
2706
|
configs2.push(react({
|
|
2707
|
+
...typescriptOptions,
|
|
2697
2708
|
overrides: getOverrides(options, "react"),
|
|
2698
2709
|
tsconfigPath
|
|
2699
2710
|
}));
|
|
@@ -2786,15 +2797,15 @@ function vinicuncaESLint(options = {}, ...userConfigs) {
|
|
|
2786
2797
|
}
|
|
2787
2798
|
return composer;
|
|
2788
2799
|
}
|
|
2789
|
-
function resolveSubOptions(options, key) {
|
|
2790
|
-
return e(options[key]) ? {} : options[key] || {};
|
|
2791
|
-
}
|
|
2792
2800
|
function getOverrides(options, key) {
|
|
2793
2801
|
const sub = resolveSubOptions(options, key);
|
|
2794
2802
|
return {
|
|
2795
2803
|
..."overrides" in sub ? sub.overrides : {}
|
|
2796
2804
|
};
|
|
2797
2805
|
}
|
|
2806
|
+
function resolveSubOptions(options, key) {
|
|
2807
|
+
return e(options[key]) ? {} : options[key] || {};
|
|
2808
|
+
}
|
|
2798
2809
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2799
2810
|
0 && (module.exports = {
|
|
2800
2811
|
GLOB_ALL_SRC,
|