@vinicunca/eslint-config 4.0.0 → 4.0.8
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 +5 -0
- package/dist/index.mjs +14 -14
- package/dist/{lib-BmGFlZdP.mjs → lib-pv9DSAcX.mjs} +3941 -3944
- package/package.json +9 -10
package/dist/index.d.mts
CHANGED
|
@@ -7224,6 +7224,11 @@ interface RuleOptions {
|
|
|
7224
7224
|
* @see https://typescript-eslint.io/rules/no-useless-constructor
|
|
7225
7225
|
*/
|
|
7226
7226
|
'ts/no-useless-constructor'?: Linter.RuleEntry<[]>;
|
|
7227
|
+
/**
|
|
7228
|
+
* Disallow default values that will never be used
|
|
7229
|
+
* @see https://typescript-eslint.io/rules/no-useless-default-assignment
|
|
7230
|
+
*/
|
|
7231
|
+
'ts/no-useless-default-assignment'?: Linter.RuleEntry<[]>;
|
|
7227
7232
|
/**
|
|
7228
7233
|
* Disallow empty exports that don't change anything in a module file
|
|
7229
7234
|
* @see https://typescript-eslint.io/rules/no-useless-empty-export
|
package/dist/index.mjs
CHANGED
|
@@ -16,7 +16,7 @@ import { mergeProcessors, processorPassThrough } from "eslint-merge-processors";
|
|
|
16
16
|
import { configs } from "eslint-plugin-regexp";
|
|
17
17
|
|
|
18
18
|
//#region node_modules/.pnpm/@vinicunca+perkakas@1.9.0/node_modules/@vinicunca/perkakas/dist/is-boolean-CZKz4ij3.js
|
|
19
|
-
function e(e$3) {
|
|
19
|
+
function e$2(e$3) {
|
|
20
20
|
return typeof e$3 == `boolean`;
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -28,7 +28,7 @@ function e$1(e$3) {
|
|
|
28
28
|
|
|
29
29
|
//#endregion
|
|
30
30
|
//#region node_modules/.pnpm/@vinicunca+perkakas@1.9.0/node_modules/@vinicunca/perkakas/dist/is-number-D5aNK4nm.js
|
|
31
|
-
function e
|
|
31
|
+
function e(e$3) {
|
|
32
32
|
return typeof e$3 == `number` && !Number.isNaN(e$3);
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -409,7 +409,7 @@ async function formatters(options = {}, stylistic$1 = {}) {
|
|
|
409
409
|
endOfLine: "auto",
|
|
410
410
|
semi,
|
|
411
411
|
singleQuote: quotes === "single",
|
|
412
|
-
tabWidth: e
|
|
412
|
+
tabWidth: e(indent) ? indent : 2,
|
|
413
413
|
trailingComma: "all",
|
|
414
414
|
useTabs: indent === "tab"
|
|
415
415
|
}, options.prettierOptions || {});
|
|
@@ -420,7 +420,7 @@ async function formatters(options = {}, stylistic$1 = {}) {
|
|
|
420
420
|
xmlWhitespaceSensitivity: "ignore"
|
|
421
421
|
};
|
|
422
422
|
const dprintOptions = Object.assign({
|
|
423
|
-
indentWidth: e
|
|
423
|
+
indentWidth: e(indent) ? indent : 2,
|
|
424
424
|
quoteStyle: quotes === "single" ? "preferSingle" : "preferDouble",
|
|
425
425
|
useTabs: indent === "tab"
|
|
426
426
|
}, options.dprintOptions || {});
|
|
@@ -859,7 +859,7 @@ async function jsonc(options = {}) {
|
|
|
859
859
|
GLOB_JSON5,
|
|
860
860
|
GLOB_JSONC
|
|
861
861
|
], overrides = {}, stylistic: stylistic$1 = true } = options;
|
|
862
|
-
const { indent = 2 } = e(stylistic$1) ? {} : stylistic$1;
|
|
862
|
+
const { indent = 2 } = e$2(stylistic$1) ? {} : stylistic$1;
|
|
863
863
|
const [pluginJsonc, parserJsonc] = await Promise.all([interopDefault(import("eslint-plugin-jsonc")), interopDefault(import("jsonc-eslint-parser"))]);
|
|
864
864
|
return [{
|
|
865
865
|
name: "vinicunca/jsonc/setup",
|
|
@@ -1727,7 +1727,7 @@ function sortTsconfig() {
|
|
|
1727
1727
|
//#region src/configs/svelte.ts
|
|
1728
1728
|
async function svelte(options = {}) {
|
|
1729
1729
|
const { files = [GLOB_SVELTE], overrides = {}, stylistic: stylistic$1 = true } = options;
|
|
1730
|
-
const { indent = 2, quotes = "single" } = e(stylistic$1) ? {} : stylistic$1;
|
|
1730
|
+
const { indent = 2, quotes = "single" } = e$2(stylistic$1) ? {} : stylistic$1;
|
|
1731
1731
|
await ensurePackages(["eslint-plugin-svelte"]);
|
|
1732
1732
|
const [pluginSvelte, parserSvelte] = await Promise.all([interopDefault(import("eslint-plugin-svelte")), interopDefault(import("svelte-eslint-parser"))]);
|
|
1733
1733
|
return [{
|
|
@@ -1842,7 +1842,7 @@ async function test(options = {}) {
|
|
|
1842
1842
|
//#region src/configs/toml.ts
|
|
1843
1843
|
async function toml(options = {}) {
|
|
1844
1844
|
const { files = [GLOB_TOML], overrides = {}, stylistic: stylistic$1 = true } = options;
|
|
1845
|
-
const { indent = 2 } = e(stylistic$1) ? {} : stylistic$1;
|
|
1845
|
+
const { indent = 2 } = e$2(stylistic$1) ? {} : stylistic$1;
|
|
1846
1846
|
const [pluginToml, parserToml] = await Promise.all([interopDefault(import("eslint-plugin-toml")), interopDefault(import("toml-eslint-parser"))]);
|
|
1847
1847
|
return [{
|
|
1848
1848
|
name: "vinicunca/toml/setup",
|
|
@@ -2033,7 +2033,7 @@ async function typescript(options = {}) {
|
|
|
2033
2033
|
}] : [],
|
|
2034
2034
|
...erasableOnly ? [{
|
|
2035
2035
|
name: "antfu/typescript/erasable-syntax-only",
|
|
2036
|
-
plugins: { "erasable-syntax-only": await interopDefault(import("./lib-
|
|
2036
|
+
plugins: { "erasable-syntax-only": await interopDefault(import("./lib-pv9DSAcX.mjs")) },
|
|
2037
2037
|
rules: {
|
|
2038
2038
|
"erasable-syntax-only/enums": "error",
|
|
2039
2039
|
"erasable-syntax-only/import-aliases": "error",
|
|
@@ -2111,7 +2111,7 @@ async function unocss(options = {}) {
|
|
|
2111
2111
|
async function vue(options = {}) {
|
|
2112
2112
|
const { a11y = false, files = [GLOB_VUE], overrides = {}, stylistic: stylistic$1 = true } = options;
|
|
2113
2113
|
const sfcBlocks = options.sfcBlocks === true ? {} : options.sfcBlocks ?? {};
|
|
2114
|
-
const { indent = 2 } = e(stylistic$1) ? {} : stylistic$1;
|
|
2114
|
+
const { indent = 2 } = e$2(stylistic$1) ? {} : stylistic$1;
|
|
2115
2115
|
if (a11y) await ensurePackages(["eslint-plugin-vuejs-accessibility"]);
|
|
2116
2116
|
const [pluginVue, parserVue, processorVueBlocks, pluginVueA11y] = await Promise.all([
|
|
2117
2117
|
interopDefault(import("eslint-plugin-vue")),
|
|
@@ -2320,7 +2320,7 @@ async function vue(options = {}) {
|
|
|
2320
2320
|
//#region src/configs/yaml.ts
|
|
2321
2321
|
async function yaml(options = {}) {
|
|
2322
2322
|
const { files = [GLOB_YAML], overrides = {}, stylistic: stylistic$1 = true } = options;
|
|
2323
|
-
const { indent = 2, quotes = "single" } = e(stylistic$1) ? {} : stylistic$1;
|
|
2323
|
+
const { indent = 2, quotes = "single" } = e$2(stylistic$1) ? {} : stylistic$1;
|
|
2324
2324
|
const [pluginYaml, parserYaml] = await Promise.all([interopDefault(import("eslint-plugin-yml")), interopDefault(import("yaml-eslint-parser"))]);
|
|
2325
2325
|
return [{
|
|
2326
2326
|
name: "vinicunca/yaml/setup",
|
|
@@ -2410,7 +2410,7 @@ function vinicuncaESLint(options = {}, ...userConfigs) {
|
|
|
2410
2410
|
const stylisticOptions = options.stylistic === false ? false : typeof options.stylistic === "object" ? options.stylistic : {};
|
|
2411
2411
|
if (stylisticOptions && !("jsx" in stylisticOptions)) stylisticOptions.jsx = typeof enableJsx === "object" ? true : enableJsx;
|
|
2412
2412
|
const configs$1 = [];
|
|
2413
|
-
if (enableGitignore) if (!e(enableGitignore)) configs$1.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r({
|
|
2413
|
+
if (enableGitignore) if (!e$2(enableGitignore)) configs$1.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r({
|
|
2414
2414
|
name: "vinicunca/gitignore",
|
|
2415
2415
|
...enableGitignore
|
|
2416
2416
|
})]));
|
|
@@ -2442,7 +2442,7 @@ function vinicuncaESLint(options = {}, ...userConfigs) {
|
|
|
2442
2442
|
lessOpinionated: options.lessOpinionated,
|
|
2443
2443
|
overrides: getOverrides(options, "stylistic")
|
|
2444
2444
|
}));
|
|
2445
|
-
if (enableRegexp) configs$1.push(regexp(e(enableRegexp) ? {} : enableRegexp));
|
|
2445
|
+
if (enableRegexp) configs$1.push(regexp(e$2(enableRegexp) ? {} : enableRegexp));
|
|
2446
2446
|
if (options.test ?? true) configs$1.push(test({
|
|
2447
2447
|
isInEditor,
|
|
2448
2448
|
overrides: getOverrides(options, "test")
|
|
@@ -2495,7 +2495,7 @@ function vinicuncaESLint(options = {}, ...userConfigs) {
|
|
|
2495
2495
|
componentExts,
|
|
2496
2496
|
overrides: getOverrides(options, "markdown")
|
|
2497
2497
|
}));
|
|
2498
|
-
if (options.formatters) configs$1.push(formatters(options.formatters, e(stylisticOptions) ? {} : stylisticOptions));
|
|
2498
|
+
if (options.formatters) configs$1.push(formatters(options.formatters, e$2(stylisticOptions) ? {} : stylisticOptions));
|
|
2499
2499
|
if ("files" in options) throw new Error("[@vinicunca/eslint-config] The first argument should not contain the \"files\" property as the options are supposed to be global. Place it in the second or later config instead.");
|
|
2500
2500
|
/**
|
|
2501
2501
|
* User can optionally pass a flat config item to the first argument.
|
|
@@ -2521,7 +2521,7 @@ function getOverrides(options, key) {
|
|
|
2521
2521
|
return { ..."overrides" in sub ? sub.overrides : {} };
|
|
2522
2522
|
}
|
|
2523
2523
|
function resolveSubOptions(options, key) {
|
|
2524
|
-
return e(options[key]) ? {} : options[key] || {};
|
|
2524
|
+
return e$2(options[key]) ? {} : options[key] || {};
|
|
2525
2525
|
}
|
|
2526
2526
|
|
|
2527
2527
|
//#endregion
|