@vinicunca/eslint-config 4.3.0 → 4.4.1
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 +1 -1
- package/dist/index.mjs +45 -51
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -19716,7 +19716,7 @@ type Yoda = [] | [("always" | "never")] | [("always" | "never"), {
|
|
|
19716
19716
|
onlyEquality?: boolean;
|
|
19717
19717
|
}];
|
|
19718
19718
|
// Names of all the configs
|
|
19719
|
-
type ConfigNames = 'vinicunca/astro/setup' | 'vinicunca/astro/rules' | 'vinicunca/eslint-comments/rules' | 'vinicunca/formatter/setup' | 'vinicunca/imports/rules' | 'vinicunca/javascript/setup' | 'vinicunca/javascript/rules' | 'antfu/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/
|
|
19719
|
+
type ConfigNames = 'vinicunca/astro/setup' | 'vinicunca/astro/rules' | 'vinicunca/eslint-comments/rules' | 'vinicunca/formatter/setup' | 'vinicunca/imports/rules' | 'vinicunca/javascript/setup' | 'vinicunca/javascript/rules' | 'antfu/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/unicorn/rules' | 'vinicunca/unocss' | 'vinicunca/vue/setup' | 'vinicunca/vue/rules' | 'vinicunca/yaml/setup' | 'vinicunca/yaml/rules';
|
|
19720
19720
|
//#endregion
|
|
19721
19721
|
//#region src/vendor/prettier-types.d.ts
|
|
19722
19722
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
2
2
|
import process from "node:process";
|
|
3
|
-
import
|
|
3
|
+
import fs from "node:fs/promises";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
|
-
import fs from "node:fs";
|
|
5
|
+
import fs$1 from "node:fs";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { isPackageExists } from "local-pkg";
|
|
8
8
|
import createCommand from "eslint-plugin-command/config";
|
|
@@ -46,7 +46,7 @@ async function findUp(name, { cwd = process.cwd(), type = "file", stopAt } = {})
|
|
|
46
46
|
while (directory) {
|
|
47
47
|
const filePath = isAbsoluteName ? name : path.join(directory, name);
|
|
48
48
|
try {
|
|
49
|
-
const stats = await
|
|
49
|
+
const stats = await fs.stat(filePath);
|
|
50
50
|
if (type === "file" && stats.isFile() || type === "directory" && stats.isDirectory()) return filePath;
|
|
51
51
|
} catch {}
|
|
52
52
|
if (directory === stopAt || directory === root) break;
|
|
@@ -61,7 +61,7 @@ function findUpSync(name, { cwd = process.cwd(), type = "file", stopAt } = {}) {
|
|
|
61
61
|
while (directory) {
|
|
62
62
|
const filePath = isAbsoluteName ? name : path.join(directory, name);
|
|
63
63
|
try {
|
|
64
|
-
const stats = fs.statSync(filePath, { throwIfNoEntry: false });
|
|
64
|
+
const stats = fs$1.statSync(filePath, { throwIfNoEntry: false });
|
|
65
65
|
if (type === "file" && stats?.isFile() || type === "directory" && stats?.isDirectory()) return filePath;
|
|
66
66
|
} catch {}
|
|
67
67
|
if (directory === stopAt || directory === root) break;
|
|
@@ -701,32 +701,43 @@ async function javascript(options = {}) {
|
|
|
701
701
|
setWithoutGet: true
|
|
702
702
|
}],
|
|
703
703
|
"antfu/no-top-level-await": ERROR,
|
|
704
|
-
"array-callback-return": ERROR,
|
|
704
|
+
"array-callback-return": [ERROR, { checkForEach: true }],
|
|
705
705
|
"block-scoped-var": ERROR,
|
|
706
|
+
"camelcase": [ERROR, {
|
|
707
|
+
allow: ["^UNSAFE_"],
|
|
708
|
+
ignoreGlobals: true,
|
|
709
|
+
properties: NEVER
|
|
710
|
+
}],
|
|
706
711
|
"constructor-super": ERROR,
|
|
707
712
|
"default-case-last": ERROR,
|
|
708
713
|
"dot-notation": [ERROR, { allowKeywords: true }],
|
|
709
714
|
"eqeqeq": [ERROR, "smart"],
|
|
715
|
+
"for-direction": ERROR,
|
|
710
716
|
"new-cap": [ERROR, {
|
|
711
717
|
capIsNew: false,
|
|
712
718
|
newIsCap: true,
|
|
713
719
|
properties: true
|
|
714
720
|
}],
|
|
715
|
-
"no-alert":
|
|
721
|
+
"no-alert": WARN,
|
|
716
722
|
"no-array-constructor": ERROR,
|
|
717
723
|
"no-async-promise-executor": ERROR,
|
|
724
|
+
"no-await-in-loop": ERROR,
|
|
718
725
|
"no-caller": ERROR,
|
|
719
726
|
"no-case-declarations": ERROR,
|
|
720
727
|
"no-class-assign": ERROR,
|
|
721
728
|
"no-compare-neg-zero": ERROR,
|
|
722
|
-
"no-cond-assign": [ERROR,
|
|
723
|
-
"no-console": [ERROR, { allow: [
|
|
729
|
+
"no-cond-assign": [ERROR, ALWAYS],
|
|
730
|
+
"no-console": [ERROR, { allow: [WARN, ERROR] }],
|
|
724
731
|
"no-const-assign": ERROR,
|
|
732
|
+
"no-constant-binary-expression": ERROR,
|
|
733
|
+
"no-constant-condition": [ERROR, { checkLoops: false }],
|
|
734
|
+
"no-constructor-return": ERROR,
|
|
725
735
|
"no-control-regex": ERROR,
|
|
726
736
|
"no-debugger": ERROR,
|
|
727
737
|
"no-delete-var": ERROR,
|
|
728
738
|
"no-dupe-args": ERROR,
|
|
729
739
|
"no-dupe-class-members": ERROR,
|
|
740
|
+
"no-dupe-else-if": ERROR,
|
|
730
741
|
"no-dupe-keys": ERROR,
|
|
731
742
|
"no-duplicate-case": ERROR,
|
|
732
743
|
"no-empty": [ERROR, { allowEmptyCatch: true }],
|
|
@@ -753,13 +764,16 @@ async function javascript(options = {}) {
|
|
|
753
764
|
"no-loss-of-precision": ERROR,
|
|
754
765
|
"no-misleading-character-class": ERROR,
|
|
755
766
|
"no-multi-str": ERROR,
|
|
767
|
+
"no-nested-ternary": ERROR,
|
|
756
768
|
"no-new": ERROR,
|
|
757
769
|
"no-new-func": ERROR,
|
|
758
770
|
"no-new-native-nonconstructor": ERROR,
|
|
759
771
|
"no-new-wrappers": ERROR,
|
|
760
772
|
"no-obj-calls": ERROR,
|
|
773
|
+
"no-object-constructor": ERROR,
|
|
761
774
|
"no-octal": ERROR,
|
|
762
775
|
"no-octal-escape": ERROR,
|
|
776
|
+
"no-promise-executor-return": ERROR,
|
|
763
777
|
"no-proto": ERROR,
|
|
764
778
|
"no-prototype-builtins": ERROR,
|
|
765
779
|
"no-redeclare": [ERROR, { builtinGlobals: false }],
|
|
@@ -800,9 +814,11 @@ async function javascript(options = {}) {
|
|
|
800
814
|
],
|
|
801
815
|
"no-restricted-syntax": [
|
|
802
816
|
ERROR,
|
|
817
|
+
"ForInStatement",
|
|
803
818
|
"TSEnumDeclaration[const=true]",
|
|
804
819
|
"TSExportAssignment"
|
|
805
820
|
],
|
|
821
|
+
"no-return-assign": [ERROR, ALWAYS],
|
|
806
822
|
"no-self-assign": [ERROR, { props: true }],
|
|
807
823
|
"no-self-compare": ERROR,
|
|
808
824
|
"no-sequences": ERROR,
|
|
@@ -847,18 +863,18 @@ async function javascript(options = {}) {
|
|
|
847
863
|
"no-with": ERROR,
|
|
848
864
|
"object-shorthand": [
|
|
849
865
|
ERROR,
|
|
850
|
-
|
|
866
|
+
ALWAYS,
|
|
851
867
|
{
|
|
852
868
|
avoidQuotes: true,
|
|
853
869
|
ignoreConstructors: false
|
|
854
870
|
}
|
|
855
871
|
],
|
|
856
|
-
"one-var": [ERROR, { initialized:
|
|
872
|
+
"one-var": [ERROR, { initialized: NEVER }],
|
|
857
873
|
"prefer-arrow-callback": [ERROR, {
|
|
858
874
|
allowNamedFunctions: false,
|
|
859
875
|
allowUnboundThis: true
|
|
860
876
|
}],
|
|
861
|
-
"prefer-const": [isInEditor ?
|
|
877
|
+
"prefer-const": [isInEditor ? WARN : ERROR, {
|
|
862
878
|
destructuring: "all",
|
|
863
879
|
ignoreReadBeforeAssign: true
|
|
864
880
|
}],
|
|
@@ -869,9 +885,9 @@ async function javascript(options = {}) {
|
|
|
869
885
|
"prefer-spread": ERROR,
|
|
870
886
|
"prefer-template": ERROR,
|
|
871
887
|
"symbol-description": ERROR,
|
|
872
|
-
"unicode-bom": [ERROR,
|
|
873
|
-
"unused-imports/no-unused-imports": isInEditor ?
|
|
874
|
-
"unused-imports/no-unused-vars": [
|
|
888
|
+
"unicode-bom": [ERROR, NEVER],
|
|
889
|
+
"unused-imports/no-unused-imports": isInEditor ? WARN : ERROR,
|
|
890
|
+
"unused-imports/no-unused-vars": [WARN, {
|
|
875
891
|
args: "after-used",
|
|
876
892
|
argsIgnorePattern: "^_",
|
|
877
893
|
ignoreRestSiblings: true,
|
|
@@ -884,7 +900,7 @@ async function javascript(options = {}) {
|
|
|
884
900
|
}],
|
|
885
901
|
"valid-typeof": [ERROR, { requireStringLiterals: true }],
|
|
886
902
|
"vars-on-top": ERROR,
|
|
887
|
-
"yoda": [ERROR,
|
|
903
|
+
"yoda": [ERROR, NEVER],
|
|
888
904
|
...overrides
|
|
889
905
|
}
|
|
890
906
|
}];
|
|
@@ -1192,7 +1208,7 @@ async function perfectionist() {
|
|
|
1192
1208
|
async function detectCatalogUsage() {
|
|
1193
1209
|
const workspaceFile = await findUp("pnpm-workspace.yaml");
|
|
1194
1210
|
if (!workspaceFile) return false;
|
|
1195
|
-
const yaml$1 = await
|
|
1211
|
+
const yaml$1 = await fs.readFile(workspaceFile, "utf-8");
|
|
1196
1212
|
return yaml$1.includes("catalog:") || yaml$1.includes("catalogs:");
|
|
1197
1213
|
}
|
|
1198
1214
|
async function pnpm(options) {
|
|
@@ -1988,7 +2004,7 @@ async function typescript(options = {}) {
|
|
|
1988
2004
|
"ts/no-floating-promises": ERROR,
|
|
1989
2005
|
"ts/no-for-in-array": ERROR,
|
|
1990
2006
|
"ts/no-implied-eval": ERROR,
|
|
1991
|
-
"ts/no-misused-promises":
|
|
2007
|
+
"ts/no-misused-promises": ERROR,
|
|
1992
2008
|
"ts/no-unnecessary-type-assertion": ERROR,
|
|
1993
2009
|
"ts/no-unsafe-argument": ERROR,
|
|
1994
2010
|
"ts/no-unsafe-assignment": ERROR,
|
|
@@ -2038,13 +2054,12 @@ async function typescript(options = {}) {
|
|
|
2038
2054
|
}
|
|
2039
2055
|
},
|
|
2040
2056
|
...isTypeAware ? [makeParser({
|
|
2057
|
+
files,
|
|
2058
|
+
typeAware: false
|
|
2059
|
+
}), makeParser({
|
|
2041
2060
|
files: filesTypeAware,
|
|
2042
2061
|
ignores: ignoresTypeAware,
|
|
2043
2062
|
typeAware: true
|
|
2044
|
-
}), makeParser({
|
|
2045
|
-
files,
|
|
2046
|
-
ignores: filesTypeAware,
|
|
2047
|
-
typeAware: false
|
|
2048
2063
|
})] : [makeParser({
|
|
2049
2064
|
files,
|
|
2050
2065
|
typeAware: false
|
|
@@ -2056,9 +2071,7 @@ async function typescript(options = {}) {
|
|
|
2056
2071
|
...renameRules(pluginTs.configs["eslint-recommended"].overrides[0].rules, { "@typescript-eslint": "ts" }),
|
|
2057
2072
|
...renameRules(pluginTs.configs.strict.rules, { "@typescript-eslint": "ts" }),
|
|
2058
2073
|
"no-dupe-class-members": OFF,
|
|
2059
|
-
"no-invalid-this": OFF,
|
|
2060
2074
|
"no-redeclare": OFF,
|
|
2061
|
-
"no-unused-vars": OFF,
|
|
2062
2075
|
"no-use-before-define": OFF,
|
|
2063
2076
|
"no-useless-constructor": OFF,
|
|
2064
2077
|
"ts/array-type": [ERROR, { default: "generic" }],
|
|
@@ -2123,31 +2136,12 @@ async function typescript(options = {}) {
|
|
|
2123
2136
|
name: "antfu/typescript/erasable-syntax-only",
|
|
2124
2137
|
plugins: { "erasable-syntax-only": await interopDefault(import("./lib-DHxUIJ7x.mjs")) },
|
|
2125
2138
|
rules: {
|
|
2126
|
-
"erasable-syntax-only/enums":
|
|
2127
|
-
"erasable-syntax-only/import-aliases":
|
|
2128
|
-
"erasable-syntax-only/namespaces":
|
|
2129
|
-
"erasable-syntax-only/parameter-properties":
|
|
2130
|
-
}
|
|
2131
|
-
}] : [],
|
|
2132
|
-
{
|
|
2133
|
-
files: ["**/*.d.?([cm])ts"],
|
|
2134
|
-
name: "vinicunca/typescript/disables/dts",
|
|
2135
|
-
rules: {
|
|
2136
|
-
"eslint-comments/no-unlimited-disable": OFF,
|
|
2137
|
-
"no-restricted-syntax": OFF,
|
|
2138
|
-
"unused-imports/no-unused-vars": OFF
|
|
2139
|
+
"erasable-syntax-only/enums": ERROR,
|
|
2140
|
+
"erasable-syntax-only/import-aliases": ERROR,
|
|
2141
|
+
"erasable-syntax-only/namespaces": ERROR,
|
|
2142
|
+
"erasable-syntax-only/parameter-properties": ERROR
|
|
2139
2143
|
}
|
|
2140
|
-
}
|
|
2141
|
-
{
|
|
2142
|
-
files: ["**/*.{test,spec}.ts?(x)"],
|
|
2143
|
-
name: "vinicunca/typescript/disables/tests",
|
|
2144
|
-
rules: { "no-unused-expressions": OFF }
|
|
2145
|
-
},
|
|
2146
|
-
{
|
|
2147
|
-
files: ["**/*.js", "**/*.cjs"],
|
|
2148
|
-
name: "vinicunca/typescript/disables/javascript",
|
|
2149
|
-
rules: { "ts/no-require-imports": OFF }
|
|
2150
|
-
}
|
|
2144
|
+
}] : []
|
|
2151
2145
|
];
|
|
2152
2146
|
}
|
|
2153
2147
|
|
|
@@ -2272,6 +2266,7 @@ async function vue(options = {}) {
|
|
|
2272
2266
|
] }],
|
|
2273
2267
|
"vue/component-name-in-template-casing": [ERROR, "PascalCase"],
|
|
2274
2268
|
"vue/component-options-name-casing": [ERROR, "PascalCase"],
|
|
2269
|
+
"vue/component-tags-order": OFF,
|
|
2275
2270
|
"vue/custom-event-name-casing": [
|
|
2276
2271
|
ERROR,
|
|
2277
2272
|
"camelCase",
|
|
@@ -2287,13 +2282,12 @@ async function vue(options = {}) {
|
|
|
2287
2282
|
"vue/dot-notation": [ERROR, { allowKeywords: true }],
|
|
2288
2283
|
"vue/eqeqeq": [ERROR, "smart"],
|
|
2289
2284
|
"vue/html-indent": [ERROR, indent],
|
|
2290
|
-
"vue/html-quotes": [
|
|
2285
|
+
"vue/html-quotes": [ERROR, "double"],
|
|
2291
2286
|
"vue/max-attributes-per-line": [ERROR],
|
|
2292
2287
|
"vue/multi-word-component-names": OFF,
|
|
2293
2288
|
"vue/no-constant-condition": WARN,
|
|
2294
2289
|
"vue/no-dupe-keys": OFF,
|
|
2295
2290
|
"vue/no-empty-pattern": ERROR,
|
|
2296
|
-
"vue/no-extra-parens": [ERROR, "functions"],
|
|
2297
2291
|
"vue/no-irregular-whitespace": ERROR,
|
|
2298
2292
|
"vue/no-loss-of-precision": ERROR,
|
|
2299
2293
|
"vue/no-restricted-syntax": [
|
|
@@ -2320,7 +2314,7 @@ async function vue(options = {}) {
|
|
|
2320
2314
|
"vue/prefer-import-from-vue": OFF,
|
|
2321
2315
|
"vue/prefer-separate-static-class": ERROR,
|
|
2322
2316
|
"vue/prefer-template": ERROR,
|
|
2323
|
-
"vue/prop-name-casing": [
|
|
2317
|
+
"vue/prop-name-casing": [ERROR, "camelCase"],
|
|
2324
2318
|
"vue/require-default-prop": OFF,
|
|
2325
2319
|
"vue/require-prop-types": OFF,
|
|
2326
2320
|
"vue/space-infix-ops": ERROR,
|
|
@@ -2368,7 +2362,7 @@ async function vue(options = {}) {
|
|
|
2368
2362
|
multiline: true
|
|
2369
2363
|
}],
|
|
2370
2364
|
"vue/object-curly-spacing": [ERROR, ALWAYS],
|
|
2371
|
-
"vue/object-property-newline": [ERROR, {
|
|
2365
|
+
"vue/object-property-newline": [ERROR, { allowAllPropertiesOnSameLine: true }],
|
|
2372
2366
|
"vue/operator-linebreak": [ERROR, "before"],
|
|
2373
2367
|
"vue/padding-line-between-blocks": [ERROR, ALWAYS],
|
|
2374
2368
|
"vue/quote-props": [ERROR, "consistent-as-needed"],
|