@vinicunca/eslint-config 2.13.2 → 2.14.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 +30 -21
- package/dist/index.d.cts +10 -8
- package/dist/index.d.ts +10 -8
- package/dist/index.js +29 -20
- package/package.json +15 -9
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
|
|
|
@@ -2543,8 +2552,7 @@ async function yaml(options = {}) {
|
|
|
2543
2552
|
"yaml/indent": [ERROR, indent === "tab" ? 2 : indent],
|
|
2544
2553
|
"yaml/key-spacing": ERROR,
|
|
2545
2554
|
"yaml/no-tab-indent": ERROR,
|
|
2546
|
-
|
|
2547
|
-
"yaml/quotes": [ERROR, { avoidEscape: false, prefer: quotes }],
|
|
2555
|
+
"yaml/quotes": [ERROR, { avoidEscape: true, prefer: quotes === "backtick" ? "single" : quotes }],
|
|
2548
2556
|
"yaml/spaced-comment": ERROR
|
|
2549
2557
|
} : {},
|
|
2550
2558
|
...overrides
|
|
@@ -2694,6 +2702,7 @@ function vinicuncaESLint(options = {}, ...userConfigs) {
|
|
|
2694
2702
|
}
|
|
2695
2703
|
if (enableReact) {
|
|
2696
2704
|
configs2.push(react({
|
|
2705
|
+
...typescriptOptions,
|
|
2697
2706
|
overrides: getOverrides(options, "react"),
|
|
2698
2707
|
tsconfigPath
|
|
2699
2708
|
}));
|
|
@@ -2786,15 +2795,15 @@ function vinicuncaESLint(options = {}, ...userConfigs) {
|
|
|
2786
2795
|
}
|
|
2787
2796
|
return composer;
|
|
2788
2797
|
}
|
|
2789
|
-
function resolveSubOptions(options, key) {
|
|
2790
|
-
return e(options[key]) ? {} : options[key] || {};
|
|
2791
|
-
}
|
|
2792
2798
|
function getOverrides(options, key) {
|
|
2793
2799
|
const sub = resolveSubOptions(options, key);
|
|
2794
2800
|
return {
|
|
2795
2801
|
..."overrides" in sub ? sub.overrides : {}
|
|
2796
2802
|
};
|
|
2797
2803
|
}
|
|
2804
|
+
function resolveSubOptions(options, key) {
|
|
2805
|
+
return e(options[key]) ? {} : options[key] || {};
|
|
2806
|
+
}
|
|
2798
2807
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2799
2808
|
0 && (module.exports = {
|
|
2800
2809
|
GLOB_ALL_SRC,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Linter } from 'eslint';
|
|
2
|
-
import { FlatConfigComposer } from 'eslint-flat-config-utils';
|
|
3
2
|
import { StylisticCustomizeOptions } from '@stylistic/eslint-plugin';
|
|
4
3
|
import { ParserOptions } from '@typescript-eslint/parser';
|
|
5
4
|
import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
|
|
6
5
|
import { Options } from 'eslint-processor-vue-blocks';
|
|
6
|
+
import { FlatConfigComposer } from 'eslint-flat-config-utils';
|
|
7
7
|
export { default as pluginComments } from '@eslint-community/eslint-plugin-eslint-comments';
|
|
8
8
|
export { default as pluginAntfu } from 'eslint-plugin-antfu';
|
|
9
9
|
import * as eslintPluginImportX from 'eslint-plugin-import-x';
|
|
@@ -11248,9 +11248,10 @@ type ReactNamingConventionFilenameExtension = []|[(("always" | "as-needed") | {
|
|
|
11248
11248
|
})]
|
|
11249
11249
|
// ----- react-refresh/only-export-components -----
|
|
11250
11250
|
type ReactRefreshOnlyExportComponents = []|[{
|
|
11251
|
+
allowExportNames?: string[]
|
|
11251
11252
|
allowConstantExport?: boolean
|
|
11253
|
+
customHOCs?: string[]
|
|
11252
11254
|
checkJS?: boolean
|
|
11253
|
-
allowExportNames?: string[]
|
|
11254
11255
|
}]
|
|
11255
11256
|
// ----- react/no-useless-fragment -----
|
|
11256
11257
|
type ReactNoUselessFragment = []|[{
|
|
@@ -14025,6 +14026,10 @@ type TsPreferOptionalChain = []|[{
|
|
|
14025
14026
|
type TsPreferPromiseRejectErrors = []|[{
|
|
14026
14027
|
|
|
14027
14028
|
allowEmptyReject?: boolean
|
|
14029
|
+
|
|
14030
|
+
allowThrowingAny?: boolean
|
|
14031
|
+
|
|
14032
|
+
allowThrowingUnknown?: boolean
|
|
14028
14033
|
}]
|
|
14029
14034
|
// ----- ts/prefer-readonly -----
|
|
14030
14035
|
type TsPreferReadonly = []|[{
|
|
@@ -15892,11 +15897,8 @@ type Yoda = []|[("always" | "never")]|[("always" | "never"), {
|
|
|
15892
15897
|
onlyEquality?: boolean
|
|
15893
15898
|
}]
|
|
15894
15899
|
// Names of all the configs
|
|
15895
|
-
type ConfigNames = 'vinicunca/astro/setup' | 'vinicunca/astro/rules' | 'vinicunca/eslint-comments/rules' | 'vinicunca/formatter/setup' | 'vinicunca/imports/rules' | 'vinicunca/imports/disables/bin' | 'vinicunca/javascript/setup' | 'vinicunca/javascript/rules' | 'vinicunca/javascript/disables' | 'vinicunca/jsx/setup' | 'vinicunca/jsdoc/rules' | 'vinicunca/jsonc/setup' | 'vinicunca/jsonc/rules' | 'vinicunca/markdown/setup' | 'vinicunca/markdown/processor' | 'vinicunca/markdown/parser' | 'vinicunca/markdown/disables' | 'vinicunca/node/rules' | 'vinicunca/perfectionist/rules' | 'vinicunca/react/setup' | 'vinicunca/react/rules' | 'vinicunca/
|
|
15900
|
+
type ConfigNames = 'vinicunca/astro/setup' | 'vinicunca/astro/rules' | 'vinicunca/eslint-comments/rules' | 'vinicunca/formatter/setup' | 'vinicunca/imports/rules' | 'vinicunca/imports/disables/bin' | 'vinicunca/javascript/setup' | 'vinicunca/javascript/rules' | 'vinicunca/javascript/disables' | 'vinicunca/jsx/setup' | 'vinicunca/jsdoc/rules' | 'vinicunca/jsonc/setup' | 'vinicunca/jsonc/rules' | 'vinicunca/markdown/setup' | 'vinicunca/markdown/processor' | 'vinicunca/markdown/parser' | 'vinicunca/markdown/disables' | 'vinicunca/node/rules' | 'vinicunca/perfectionist/rules' | 'vinicunca/react/setup' | 'vinicunca/react/rules' | 'vinicunca/solid/setup' | 'vinicunca/solid/rules' | 'vinicunca/sort/package-json' | 'vinicunca/stylistic/rules' | 'vinicunca/svelte/setup' | 'vinicunca/svelte/rules' | 'vinicunca/test/setup' | 'vinicunca/test/rules' | 'vinicunca/toml/setup' | 'vinicunca/toml/rules' | 'vinicunca/regexp/rules' | 'vinicunca/sonar/rules' | 'vinicunca/typescript/setup' | 'vinicunca/typescript/parser' | 'vinicunca/typescript/rules' | 'vinicunca/typescript/disables/dts' | 'vinicunca/typescript/disables/tests' | 'vinicunca/typescript/disables/javascript' | 'vinicunca/unicorn/rules' | 'vinicunca/unocss' | 'vinicunca/vue/setup' | 'vinicunca/vue/rules' | 'vinicunca/yaml/setup' | 'vinicunca/yaml/rules'
|
|
15896
15901
|
|
|
15897
|
-
/**
|
|
15898
|
-
* Vendor types from Prettier so we don't rely on the dependency.
|
|
15899
|
-
*/
|
|
15900
15902
|
type VendoredPrettierOptions = Partial<VendoredPrettierOptionsRequired>;
|
|
15901
15903
|
interface VendoredPrettierOptionsRequired {
|
|
15902
15904
|
/**
|
|
@@ -16346,6 +16348,7 @@ declare const defaultPluginRenaming: {
|
|
|
16346
16348
|
vitest: string;
|
|
16347
16349
|
yml: string;
|
|
16348
16350
|
};
|
|
16351
|
+
type ResolvedOptions<T> = T extends boolean ? never : NonNullable<T>;
|
|
16349
16352
|
/**
|
|
16350
16353
|
* Construct an array of ESLint flat config items.
|
|
16351
16354
|
*
|
|
@@ -16357,7 +16360,6 @@ declare const defaultPluginRenaming: {
|
|
|
16357
16360
|
* The merged ESLint configurations.
|
|
16358
16361
|
*/
|
|
16359
16362
|
declare function vinicuncaESLint(options?: OptionsConfig & TypedFlatConfigItem, ...userConfigs: Array<Awaitable<Array<Linter.Config> | Array<TypedFlatConfigItem> | FlatConfigComposer<any, any> | TypedFlatConfigItem>>): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
|
|
16360
|
-
type ResolvedOptions<T> = T extends boolean ? never : NonNullable<T>;
|
|
16361
16363
|
|
|
16362
16364
|
declare function astro(options?: OptionsFiles & OptionsOverrides & OptionsStylistic): Promise<Array<TypedFlatConfigItem>>;
|
|
16363
16365
|
|
|
@@ -16390,7 +16392,7 @@ declare function node(): Promise<Array<TypedFlatConfigItem>>;
|
|
|
16390
16392
|
*/
|
|
16391
16393
|
declare function perfectionist(): Promise<Array<TypedFlatConfigItem>>;
|
|
16392
16394
|
|
|
16393
|
-
declare function react(options?: OptionsFiles & OptionsOverrides & OptionsTypeScriptWithTypes): Promise<Array<TypedFlatConfigItem>>;
|
|
16395
|
+
declare function react(options?: OptionsFiles & OptionsOverrides & OptionsTypeScriptParserOptions & OptionsTypeScriptWithTypes): Promise<Array<TypedFlatConfigItem>>;
|
|
16394
16396
|
|
|
16395
16397
|
declare function regexp(options?: OptionsOverrides & OptionsRegExp): Promise<Array<TypedFlatConfigItem>>;
|
|
16396
16398
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Linter } from 'eslint';
|
|
2
|
-
import { FlatConfigComposer } from 'eslint-flat-config-utils';
|
|
3
2
|
import { StylisticCustomizeOptions } from '@stylistic/eslint-plugin';
|
|
4
3
|
import { ParserOptions } from '@typescript-eslint/parser';
|
|
5
4
|
import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
|
|
6
5
|
import { Options } from 'eslint-processor-vue-blocks';
|
|
6
|
+
import { FlatConfigComposer } from 'eslint-flat-config-utils';
|
|
7
7
|
export { default as pluginComments } from '@eslint-community/eslint-plugin-eslint-comments';
|
|
8
8
|
export { default as pluginAntfu } from 'eslint-plugin-antfu';
|
|
9
9
|
import * as eslintPluginImportX from 'eslint-plugin-import-x';
|
|
@@ -11248,9 +11248,10 @@ type ReactNamingConventionFilenameExtension = []|[(("always" | "as-needed") | {
|
|
|
11248
11248
|
})]
|
|
11249
11249
|
// ----- react-refresh/only-export-components -----
|
|
11250
11250
|
type ReactRefreshOnlyExportComponents = []|[{
|
|
11251
|
+
allowExportNames?: string[]
|
|
11251
11252
|
allowConstantExport?: boolean
|
|
11253
|
+
customHOCs?: string[]
|
|
11252
11254
|
checkJS?: boolean
|
|
11253
|
-
allowExportNames?: string[]
|
|
11254
11255
|
}]
|
|
11255
11256
|
// ----- react/no-useless-fragment -----
|
|
11256
11257
|
type ReactNoUselessFragment = []|[{
|
|
@@ -14025,6 +14026,10 @@ type TsPreferOptionalChain = []|[{
|
|
|
14025
14026
|
type TsPreferPromiseRejectErrors = []|[{
|
|
14026
14027
|
|
|
14027
14028
|
allowEmptyReject?: boolean
|
|
14029
|
+
|
|
14030
|
+
allowThrowingAny?: boolean
|
|
14031
|
+
|
|
14032
|
+
allowThrowingUnknown?: boolean
|
|
14028
14033
|
}]
|
|
14029
14034
|
// ----- ts/prefer-readonly -----
|
|
14030
14035
|
type TsPreferReadonly = []|[{
|
|
@@ -15892,11 +15897,8 @@ type Yoda = []|[("always" | "never")]|[("always" | "never"), {
|
|
|
15892
15897
|
onlyEquality?: boolean
|
|
15893
15898
|
}]
|
|
15894
15899
|
// Names of all the configs
|
|
15895
|
-
type ConfigNames = 'vinicunca/astro/setup' | 'vinicunca/astro/rules' | 'vinicunca/eslint-comments/rules' | 'vinicunca/formatter/setup' | 'vinicunca/imports/rules' | 'vinicunca/imports/disables/bin' | 'vinicunca/javascript/setup' | 'vinicunca/javascript/rules' | 'vinicunca/javascript/disables' | 'vinicunca/jsx/setup' | 'vinicunca/jsdoc/rules' | 'vinicunca/jsonc/setup' | 'vinicunca/jsonc/rules' | 'vinicunca/markdown/setup' | 'vinicunca/markdown/processor' | 'vinicunca/markdown/parser' | 'vinicunca/markdown/disables' | 'vinicunca/node/rules' | 'vinicunca/perfectionist/rules' | 'vinicunca/react/setup' | 'vinicunca/react/rules' | 'vinicunca/
|
|
15900
|
+
type ConfigNames = 'vinicunca/astro/setup' | 'vinicunca/astro/rules' | 'vinicunca/eslint-comments/rules' | 'vinicunca/formatter/setup' | 'vinicunca/imports/rules' | 'vinicunca/imports/disables/bin' | 'vinicunca/javascript/setup' | 'vinicunca/javascript/rules' | 'vinicunca/javascript/disables' | 'vinicunca/jsx/setup' | 'vinicunca/jsdoc/rules' | 'vinicunca/jsonc/setup' | 'vinicunca/jsonc/rules' | 'vinicunca/markdown/setup' | 'vinicunca/markdown/processor' | 'vinicunca/markdown/parser' | 'vinicunca/markdown/disables' | 'vinicunca/node/rules' | 'vinicunca/perfectionist/rules' | 'vinicunca/react/setup' | 'vinicunca/react/rules' | 'vinicunca/solid/setup' | 'vinicunca/solid/rules' | 'vinicunca/sort/package-json' | 'vinicunca/stylistic/rules' | 'vinicunca/svelte/setup' | 'vinicunca/svelte/rules' | 'vinicunca/test/setup' | 'vinicunca/test/rules' | 'vinicunca/toml/setup' | 'vinicunca/toml/rules' | 'vinicunca/regexp/rules' | 'vinicunca/sonar/rules' | 'vinicunca/typescript/setup' | 'vinicunca/typescript/parser' | 'vinicunca/typescript/rules' | 'vinicunca/typescript/disables/dts' | 'vinicunca/typescript/disables/tests' | 'vinicunca/typescript/disables/javascript' | 'vinicunca/unicorn/rules' | 'vinicunca/unocss' | 'vinicunca/vue/setup' | 'vinicunca/vue/rules' | 'vinicunca/yaml/setup' | 'vinicunca/yaml/rules'
|
|
15896
15901
|
|
|
15897
|
-
/**
|
|
15898
|
-
* Vendor types from Prettier so we don't rely on the dependency.
|
|
15899
|
-
*/
|
|
15900
15902
|
type VendoredPrettierOptions = Partial<VendoredPrettierOptionsRequired>;
|
|
15901
15903
|
interface VendoredPrettierOptionsRequired {
|
|
15902
15904
|
/**
|
|
@@ -16346,6 +16348,7 @@ declare const defaultPluginRenaming: {
|
|
|
16346
16348
|
vitest: string;
|
|
16347
16349
|
yml: string;
|
|
16348
16350
|
};
|
|
16351
|
+
type ResolvedOptions<T> = T extends boolean ? never : NonNullable<T>;
|
|
16349
16352
|
/**
|
|
16350
16353
|
* Construct an array of ESLint flat config items.
|
|
16351
16354
|
*
|
|
@@ -16357,7 +16360,6 @@ declare const defaultPluginRenaming: {
|
|
|
16357
16360
|
* The merged ESLint configurations.
|
|
16358
16361
|
*/
|
|
16359
16362
|
declare function vinicuncaESLint(options?: OptionsConfig & TypedFlatConfigItem, ...userConfigs: Array<Awaitable<Array<Linter.Config> | Array<TypedFlatConfigItem> | FlatConfigComposer<any, any> | TypedFlatConfigItem>>): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
|
|
16360
|
-
type ResolvedOptions<T> = T extends boolean ? never : NonNullable<T>;
|
|
16361
16363
|
|
|
16362
16364
|
declare function astro(options?: OptionsFiles & OptionsOverrides & OptionsStylistic): Promise<Array<TypedFlatConfigItem>>;
|
|
16363
16365
|
|
|
@@ -16390,7 +16392,7 @@ declare function node(): Promise<Array<TypedFlatConfigItem>>;
|
|
|
16390
16392
|
*/
|
|
16391
16393
|
declare function perfectionist(): Promise<Array<TypedFlatConfigItem>>;
|
|
16392
16394
|
|
|
16393
|
-
declare function react(options?: OptionsFiles & OptionsOverrides & OptionsTypeScriptWithTypes): Promise<Array<TypedFlatConfigItem>>;
|
|
16395
|
+
declare function react(options?: OptionsFiles & OptionsOverrides & OptionsTypeScriptParserOptions & OptionsTypeScriptWithTypes): Promise<Array<TypedFlatConfigItem>>;
|
|
16394
16396
|
|
|
16395
16397
|
declare function regexp(options?: OptionsOverrides & OptionsRegExp): Promise<Array<TypedFlatConfigItem>>;
|
|
16396
16398
|
|
package/dist/index.js
CHANGED
|
@@ -1231,10 +1231,10 @@ async function perfectionist() {
|
|
|
1231
1231
|
{
|
|
1232
1232
|
groups: [
|
|
1233
1233
|
"type",
|
|
1234
|
-
["parent-type", "sibling-type", "index-type"],
|
|
1234
|
+
["parent-type", "sibling-type", "index-type", "internal-type"],
|
|
1235
1235
|
"builtin",
|
|
1236
1236
|
"external",
|
|
1237
|
-
|
|
1237
|
+
"internal",
|
|
1238
1238
|
["parent", "sibling", "index"],
|
|
1239
1239
|
"side-effect",
|
|
1240
1240
|
"object",
|
|
@@ -1276,20 +1276,26 @@ var NextJsPackages = [
|
|
|
1276
1276
|
async function react(options = {}) {
|
|
1277
1277
|
const {
|
|
1278
1278
|
files = [GLOB_SRC],
|
|
1279
|
-
|
|
1279
|
+
filesTypeAware = [GLOB_TS, GLOB_TSX],
|
|
1280
|
+
ignoresTypeAware = [
|
|
1281
|
+
`${GLOB_MARKDOWN}/**`,
|
|
1282
|
+
GLOB_ASTRO_TS
|
|
1283
|
+
],
|
|
1284
|
+
overrides = {},
|
|
1285
|
+
tsconfigPath
|
|
1280
1286
|
} = options;
|
|
1281
|
-
const tsconfigPath = options?.tsconfigPath ? toArray(options.tsconfigPath) : void 0;
|
|
1282
1287
|
const isTypeAware = !!tsconfigPath;
|
|
1288
|
+
const typeAwareRules = {
|
|
1289
|
+
"react/no-leaked-conditional-rendering": "warn"
|
|
1290
|
+
};
|
|
1283
1291
|
const [
|
|
1284
1292
|
pluginReact,
|
|
1285
1293
|
pluginReactHooks,
|
|
1286
|
-
pluginReactRefresh
|
|
1287
|
-
parserTs
|
|
1294
|
+
pluginReactRefresh
|
|
1288
1295
|
] = await Promise.all([
|
|
1289
1296
|
interopDefault(import("@eslint-react/eslint-plugin")),
|
|
1290
1297
|
interopDefault(import("eslint-plugin-react-hooks")),
|
|
1291
|
-
interopDefault(import("eslint-plugin-react-refresh"))
|
|
1292
|
-
interopDefault(import("@typescript-eslint/parser"))
|
|
1298
|
+
interopDefault(import("eslint-plugin-react-refresh"))
|
|
1293
1299
|
]);
|
|
1294
1300
|
const isAllowConstantExport = ReactRefreshAllowConstantExportPackages.some((i) => isPackageExists3(i));
|
|
1295
1301
|
const isUsingRemix = RemixPackages.some((i) => isPackageExists3(i));
|
|
@@ -1310,12 +1316,10 @@ async function react(options = {}) {
|
|
|
1310
1316
|
{
|
|
1311
1317
|
files,
|
|
1312
1318
|
languageOptions: {
|
|
1313
|
-
parser: parserTs,
|
|
1314
1319
|
parserOptions: {
|
|
1315
1320
|
ecmaFeatures: {
|
|
1316
1321
|
jsx: true
|
|
1317
|
-
}
|
|
1318
|
-
...isTypeAware ? { project: tsconfigPath } : {}
|
|
1322
|
+
}
|
|
1319
1323
|
},
|
|
1320
1324
|
sourceType: "module"
|
|
1321
1325
|
},
|
|
@@ -1397,13 +1401,18 @@ async function react(options = {}) {
|
|
|
1397
1401
|
"react/prefer-destructuring-assignment": WARN,
|
|
1398
1402
|
"react/prefer-shorthand-boolean": WARN,
|
|
1399
1403
|
"react/prefer-shorthand-fragment": WARN,
|
|
1400
|
-
...isTypeAware ? {
|
|
1401
|
-
"react/no-leaked-conditional-rendering": WARN
|
|
1402
|
-
} : {},
|
|
1403
1404
|
// overrides
|
|
1404
1405
|
...overrides
|
|
1405
1406
|
}
|
|
1406
|
-
}
|
|
1407
|
+
},
|
|
1408
|
+
...isTypeAware ? [{
|
|
1409
|
+
files: filesTypeAware,
|
|
1410
|
+
ignores: ignoresTypeAware,
|
|
1411
|
+
name: "antfu/react/type-aware-rules",
|
|
1412
|
+
rules: {
|
|
1413
|
+
...typeAwareRules
|
|
1414
|
+
}
|
|
1415
|
+
}] : []
|
|
1407
1416
|
];
|
|
1408
1417
|
}
|
|
1409
1418
|
|
|
@@ -2425,8 +2434,7 @@ async function yaml(options = {}) {
|
|
|
2425
2434
|
"yaml/indent": [ERROR, indent === "tab" ? 2 : indent],
|
|
2426
2435
|
"yaml/key-spacing": ERROR,
|
|
2427
2436
|
"yaml/no-tab-indent": ERROR,
|
|
2428
|
-
|
|
2429
|
-
"yaml/quotes": [ERROR, { avoidEscape: false, prefer: quotes }],
|
|
2437
|
+
"yaml/quotes": [ERROR, { avoidEscape: true, prefer: quotes === "backtick" ? "single" : quotes }],
|
|
2430
2438
|
"yaml/spaced-comment": ERROR
|
|
2431
2439
|
} : {},
|
|
2432
2440
|
...overrides
|
|
@@ -2576,6 +2584,7 @@ function vinicuncaESLint(options = {}, ...userConfigs) {
|
|
|
2576
2584
|
}
|
|
2577
2585
|
if (enableReact) {
|
|
2578
2586
|
configs2.push(react({
|
|
2587
|
+
...typescriptOptions,
|
|
2579
2588
|
overrides: getOverrides(options, "react"),
|
|
2580
2589
|
tsconfigPath
|
|
2581
2590
|
}));
|
|
@@ -2668,15 +2677,15 @@ function vinicuncaESLint(options = {}, ...userConfigs) {
|
|
|
2668
2677
|
}
|
|
2669
2678
|
return composer;
|
|
2670
2679
|
}
|
|
2671
|
-
function resolveSubOptions(options, key) {
|
|
2672
|
-
return e(options[key]) ? {} : options[key] || {};
|
|
2673
|
-
}
|
|
2674
2680
|
function getOverrides(options, key) {
|
|
2675
2681
|
const sub = resolveSubOptions(options, key);
|
|
2676
2682
|
return {
|
|
2677
2683
|
..."overrides" in sub ? sub.overrides : {}
|
|
2678
2684
|
};
|
|
2679
2685
|
}
|
|
2686
|
+
function resolveSubOptions(options, key) {
|
|
2687
|
+
return e(options[key]) ? {} : options[key] || {};
|
|
2688
|
+
}
|
|
2680
2689
|
export {
|
|
2681
2690
|
GLOB_ALL_SRC,
|
|
2682
2691
|
GLOB_ASTRO,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vinicunca/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.14.0",
|
|
5
5
|
"description": "Vinicunca ESLint config",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "praburangki",
|
|
@@ -55,15 +55,15 @@
|
|
|
55
55
|
"node": ">=20.0.0"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"@eslint-react/eslint-plugin": "^1.17.
|
|
58
|
+
"@eslint-react/eslint-plugin": "^1.17.3",
|
|
59
59
|
"@prettier/plugin-xml": "^3.4.1",
|
|
60
60
|
"astro-eslint-parser": "^1.1.0",
|
|
61
|
-
"eslint": "^9.
|
|
61
|
+
"eslint": "^9.16.0",
|
|
62
62
|
"eslint-plugin-astro": "^1.3.1",
|
|
63
63
|
"eslint-plugin-react-hooks": "^5.0.0",
|
|
64
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
64
|
+
"eslint-plugin-react-refresh": "^0.4.16",
|
|
65
65
|
"eslint-plugin-solid": "^0.14.4",
|
|
66
|
-
"eslint-plugin-svelte": ">=2.46.
|
|
66
|
+
"eslint-plugin-svelte": ">=2.46.1",
|
|
67
67
|
"prettier-plugin-astro": "^0.14.1",
|
|
68
68
|
"prettier-plugin-slidev": "^1.0.5",
|
|
69
69
|
"svelte-eslint-parser": ">=0.43.0"
|
|
@@ -75,12 +75,18 @@
|
|
|
75
75
|
"@prettier/plugin-xml": {
|
|
76
76
|
"optional": true
|
|
77
77
|
},
|
|
78
|
+
"@unocss/eslint-plugin": {
|
|
79
|
+
"optional": true
|
|
80
|
+
},
|
|
78
81
|
"astro-eslint-parser": {
|
|
79
82
|
"optional": true
|
|
80
83
|
},
|
|
81
84
|
"eslint-plugin-astro": {
|
|
82
85
|
"optional": true
|
|
83
86
|
},
|
|
87
|
+
"eslint-plugin-format": {
|
|
88
|
+
"optional": true
|
|
89
|
+
},
|
|
84
90
|
"eslint-plugin-react-hooks": {
|
|
85
91
|
"optional": true
|
|
86
92
|
},
|
|
@@ -109,10 +115,10 @@
|
|
|
109
115
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
|
|
110
116
|
"@eslint/markdown": "^6.2.1",
|
|
111
117
|
"@stylistic/eslint-plugin": "^2.11.0",
|
|
112
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
113
|
-
"@typescript-eslint/parser": "^8.
|
|
114
|
-
"@unocss/eslint-plugin": "^0.
|
|
115
|
-
"@vitest/eslint-plugin": "^1.1.
|
|
118
|
+
"@typescript-eslint/eslint-plugin": "^8.17.0",
|
|
119
|
+
"@typescript-eslint/parser": "^8.17.0",
|
|
120
|
+
"@unocss/eslint-plugin": "^0.65.0",
|
|
121
|
+
"@vitest/eslint-plugin": "^1.1.14",
|
|
116
122
|
"eslint-config-flat-gitignore": "^0.3.0",
|
|
117
123
|
"eslint-flat-config-utils": "^0.4.0",
|
|
118
124
|
"eslint-merge-processors": "^0.1.0",
|