@vinicunca/eslint-config 2.7.1 → 2.7.3
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 +12 -22
- package/dist/index.d.cts +475 -323
- package/dist/index.d.ts +475 -323
- package/dist/index.js +11 -22
- package/package.json +16 -16
package/dist/index.cjs
CHANGED
|
@@ -61,6 +61,7 @@ __export(src_exports, {
|
|
|
61
61
|
ignores: () => ignores,
|
|
62
62
|
imports: () => imports,
|
|
63
63
|
interopDefault: () => interopDefault,
|
|
64
|
+
isInEditorEnv: () => isInEditorEnv,
|
|
64
65
|
javascript: () => javascript,
|
|
65
66
|
jsdoc: () => jsdoc,
|
|
66
67
|
jsonc: () => jsonc,
|
|
@@ -110,8 +111,6 @@ function e(o) {
|
|
|
110
111
|
// src/base.ts
|
|
111
112
|
var import_eslint_flat_config_utils = require("eslint-flat-config-utils");
|
|
112
113
|
var import_local_pkg = require("local-pkg");
|
|
113
|
-
var import_node_fs = __toESM(require("fs"), 1);
|
|
114
|
-
var import_node_process2 = __toESM(require("process"), 1);
|
|
115
114
|
|
|
116
115
|
// src/flags.ts
|
|
117
116
|
var ERROR = "error";
|
|
@@ -221,6 +220,7 @@ var GLOB_EXCLUDE = [
|
|
|
221
220
|
];
|
|
222
221
|
|
|
223
222
|
// src/utils.ts
|
|
223
|
+
var import_node_process = __toESM(require("process"), 1);
|
|
224
224
|
async function combineConfigs(...configs2) {
|
|
225
225
|
const resolved = await Promise.all(configs2);
|
|
226
226
|
return resolved.flat();
|
|
@@ -280,6 +280,9 @@ var parserPlain = {
|
|
|
280
280
|
}
|
|
281
281
|
})
|
|
282
282
|
};
|
|
283
|
+
function isInEditorEnv() {
|
|
284
|
+
return !!((import_node_process.default.env.VSCODE_PID || import_node_process.default.env.VSCODE_CWD || import_node_process.default.env.JETBRAINS_IDE || import_node_process.default.env.VIM || import_node_process.default.env.NVIM) && !import_node_process.default.env.CI);
|
|
285
|
+
}
|
|
283
286
|
|
|
284
287
|
// src/configs/stylistic.ts
|
|
285
288
|
var STR_PARENS_NEW_LINE = "parens-new-line";
|
|
@@ -1096,23 +1099,11 @@ async function perfectionist() {
|
|
|
1096
1099
|
"perfectionist/sort-imports": [
|
|
1097
1100
|
ERROR,
|
|
1098
1101
|
{
|
|
1099
|
-
|
|
1100
|
-
"type",
|
|
1101
|
-
["builtin", "external"],
|
|
1102
|
-
"internal-type",
|
|
1103
|
-
"internal",
|
|
1104
|
-
["parent-type", "sibling-type", "index-type"],
|
|
1105
|
-
["parent", "sibling", "index"],
|
|
1106
|
-
"object",
|
|
1107
|
-
"unknown"
|
|
1108
|
-
],
|
|
1109
|
-
"internal-pattern": [
|
|
1102
|
+
internalPattern: [
|
|
1110
1103
|
"~/**",
|
|
1111
1104
|
"~~/**"
|
|
1112
1105
|
],
|
|
1113
|
-
|
|
1114
|
-
"order": "asc",
|
|
1115
|
-
"type": "natural"
|
|
1106
|
+
type: "natural"
|
|
1116
1107
|
}
|
|
1117
1108
|
],
|
|
1118
1109
|
"perfectionist/sort-vue-attributes": [OFF]
|
|
@@ -1519,7 +1510,7 @@ async function test(options = {}) {
|
|
|
1519
1510
|
}
|
|
1520
1511
|
|
|
1521
1512
|
// src/configs/typescript.ts
|
|
1522
|
-
var
|
|
1513
|
+
var import_node_process2 = __toESM(require("process"), 1);
|
|
1523
1514
|
async function typescript(options = {}) {
|
|
1524
1515
|
const {
|
|
1525
1516
|
componentExts = [],
|
|
@@ -1581,7 +1572,7 @@ async function typescript(options = {}) {
|
|
|
1581
1572
|
allowDefaultProject: ["./*.js"],
|
|
1582
1573
|
defaultProject: tsconfigPath
|
|
1583
1574
|
},
|
|
1584
|
-
tsconfigRootDir:
|
|
1575
|
+
tsconfigRootDir: import_node_process2.default.cwd()
|
|
1585
1576
|
} : {},
|
|
1586
1577
|
...parserOptions
|
|
1587
1578
|
}
|
|
@@ -2001,7 +1992,7 @@ function vinicuncaESLint(options = {}, ...userConfigs) {
|
|
|
2001
1992
|
autoRenamePlugins = true,
|
|
2002
1993
|
componentExts = [],
|
|
2003
1994
|
gitignore: enableGitignore = true,
|
|
2004
|
-
isInEditor =
|
|
1995
|
+
isInEditor = isInEditorEnv(),
|
|
2005
1996
|
jsx: enableJsx = true,
|
|
2006
1997
|
react: enableReact = false,
|
|
2007
1998
|
regexp: enableRegexp = true,
|
|
@@ -2026,9 +2017,7 @@ function vinicuncaESLint(options = {}, ...userConfigs) {
|
|
|
2026
2017
|
if (typeof enableGitignore !== "boolean") {
|
|
2027
2018
|
configs2.push(interopDefault(import("eslint-config-flat-gitignore")).then((r2) => [r2(enableGitignore)]));
|
|
2028
2019
|
} else {
|
|
2029
|
-
|
|
2030
|
-
configs2.push(interopDefault(import("eslint-config-flat-gitignore")).then((r2) => [r2()]));
|
|
2031
|
-
}
|
|
2020
|
+
configs2.push(interopDefault(import("eslint-config-flat-gitignore")).then((r2) => [r2()]));
|
|
2032
2021
|
}
|
|
2033
2022
|
}
|
|
2034
2023
|
const typescriptOptions = resolveSubOptions(options, "typescript");
|
|
@@ -2192,6 +2181,7 @@ function resolveSubOptions(options, key) {
|
|
|
2192
2181
|
ignores,
|
|
2193
2182
|
imports,
|
|
2194
2183
|
interopDefault,
|
|
2184
|
+
isInEditorEnv,
|
|
2195
2185
|
javascript,
|
|
2196
2186
|
jsdoc,
|
|
2197
2187
|
jsonc,
|