@vinicunca/eslint-config 4.0.1 → 4.1.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.d.mts +25 -6
- package/dist/index.mjs +14 -14
- package/dist/{lib-BmGFlZdP.mjs → lib-pv9DSAcX.mjs} +3941 -3944
- package/package.json +18 -18
package/dist/index.d.mts
CHANGED
|
@@ -665,6 +665,11 @@ interface RuleOptions {
|
|
|
665
665
|
* @see https://github.com/9romise/eslint-plugin-import-lite/blob/main/src/rules/consistent-type-specifier-style/README.md
|
|
666
666
|
*/
|
|
667
667
|
'import/consistent-type-specifier-style'?: Linter.RuleEntry<ImportConsistentTypeSpecifierStyle>;
|
|
668
|
+
/**
|
|
669
|
+
* Ensure all exports appear after other statements.
|
|
670
|
+
* @see https://github.com/9romise/eslint-plugin-import-lite/blob/main/src/rules/exports-last/README.md
|
|
671
|
+
*/
|
|
672
|
+
'import/exports-last'?: Linter.RuleEntry<[]>;
|
|
668
673
|
/**
|
|
669
674
|
* Ensure all imports appear before other statements.
|
|
670
675
|
* @see https://github.com/9romise/eslint-plugin-import-lite/blob/main/src/rules/first/README.md
|
|
@@ -6405,6 +6410,11 @@ interface RuleOptions {
|
|
|
6405
6410
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-test-return-statement.md
|
|
6406
6411
|
*/
|
|
6407
6412
|
'test/no-test-return-statement'?: Linter.RuleEntry<[]>;
|
|
6413
|
+
/**
|
|
6414
|
+
* Disallow unnecessary async function wrapper for expected promises
|
|
6415
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-unneeded-async-expect-function.md
|
|
6416
|
+
*/
|
|
6417
|
+
'test/no-unneeded-async-expect-function'?: Linter.RuleEntry<[]>;
|
|
6408
6418
|
/**
|
|
6409
6419
|
* Enforce padding around `afterAll` blocks
|
|
6410
6420
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-after-all-blocks.md
|
|
@@ -6514,7 +6524,7 @@ interface RuleOptions {
|
|
|
6514
6524
|
* prefer dynamic import in mock
|
|
6515
6525
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-import-in-mock.md
|
|
6516
6526
|
*/
|
|
6517
|
-
'test/prefer-import-in-mock'?: Linter.RuleEntry<
|
|
6527
|
+
'test/prefer-import-in-mock'?: Linter.RuleEntry<TestPreferImportInMock>;
|
|
6518
6528
|
/**
|
|
6519
6529
|
* enforce importing Vitest globals
|
|
6520
6530
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-importing-vitest-globals.md
|
|
@@ -6575,6 +6585,11 @@ interface RuleOptions {
|
|
|
6575
6585
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-contain.md
|
|
6576
6586
|
*/
|
|
6577
6587
|
'test/prefer-to-contain'?: Linter.RuleEntry<[]>;
|
|
6588
|
+
/**
|
|
6589
|
+
* Suggest using `toHaveBeenCalledTimes()`
|
|
6590
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-have-been-called-times.md
|
|
6591
|
+
*/
|
|
6592
|
+
'test/prefer-to-have-been-called-times'?: Linter.RuleEntry<[]>;
|
|
6578
6593
|
/**
|
|
6579
6594
|
* enforce using toHaveLength()
|
|
6580
6595
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-have-length.md
|
|
@@ -6600,11 +6615,6 @@ interface RuleOptions {
|
|
|
6600
6615
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-hook.md
|
|
6601
6616
|
*/
|
|
6602
6617
|
'test/require-hook'?: Linter.RuleEntry<TestRequireHook>;
|
|
6603
|
-
/**
|
|
6604
|
-
* require usage of import in vi.mock()
|
|
6605
|
-
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-import-vi-mock.md
|
|
6606
|
-
*/
|
|
6607
|
-
'test/require-import-vi-mock'?: Linter.RuleEntry<[]>;
|
|
6608
6618
|
/**
|
|
6609
6619
|
* require local Test Context for concurrent snapshot tests
|
|
6610
6620
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-local-test-context-for-concurrent-snapshots.md
|
|
@@ -7224,6 +7234,11 @@ interface RuleOptions {
|
|
|
7224
7234
|
* @see https://typescript-eslint.io/rules/no-useless-constructor
|
|
7225
7235
|
*/
|
|
7226
7236
|
'ts/no-useless-constructor'?: Linter.RuleEntry<[]>;
|
|
7237
|
+
/**
|
|
7238
|
+
* Disallow default values that will never be used
|
|
7239
|
+
* @see https://typescript-eslint.io/rules/no-useless-default-assignment
|
|
7240
|
+
*/
|
|
7241
|
+
'ts/no-useless-default-assignment'?: Linter.RuleEntry<[]>;
|
|
7227
7242
|
/**
|
|
7228
7243
|
* Disallow empty exports that don't change anything in a module file
|
|
7229
7244
|
* @see https://typescript-eslint.io/rules/no-useless-empty-export
|
|
@@ -16152,6 +16167,10 @@ type TestPreferExpectAssertions = [] | [{
|
|
|
16152
16167
|
onlyFunctionsWithExpectInLoop?: boolean;
|
|
16153
16168
|
onlyFunctionsWithExpectInCallback?: boolean;
|
|
16154
16169
|
}];
|
|
16170
|
+
// ----- test/prefer-import-in-mock -----
|
|
16171
|
+
type TestPreferImportInMock = [] | [{
|
|
16172
|
+
fixable?: boolean;
|
|
16173
|
+
}];
|
|
16155
16174
|
// ----- test/prefer-lowercase-title -----
|
|
16156
16175
|
type TestPreferLowercaseTitle = [] | [{
|
|
16157
16176
|
ignore?: ("describe" | "test" | "it")[];
|
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
|