@vinicunca/eslint-config 2.7.1 → 2.7.2
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 +10 -8
- package/dist/index.d.cts +475 -323
- package/dist/index.d.ts +475 -323
- package/dist/index.js +9 -8
- 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";
|
|
@@ -1519,7 +1522,7 @@ async function test(options = {}) {
|
|
|
1519
1522
|
}
|
|
1520
1523
|
|
|
1521
1524
|
// src/configs/typescript.ts
|
|
1522
|
-
var
|
|
1525
|
+
var import_node_process2 = __toESM(require("process"), 1);
|
|
1523
1526
|
async function typescript(options = {}) {
|
|
1524
1527
|
const {
|
|
1525
1528
|
componentExts = [],
|
|
@@ -1581,7 +1584,7 @@ async function typescript(options = {}) {
|
|
|
1581
1584
|
allowDefaultProject: ["./*.js"],
|
|
1582
1585
|
defaultProject: tsconfigPath
|
|
1583
1586
|
},
|
|
1584
|
-
tsconfigRootDir:
|
|
1587
|
+
tsconfigRootDir: import_node_process2.default.cwd()
|
|
1585
1588
|
} : {},
|
|
1586
1589
|
...parserOptions
|
|
1587
1590
|
}
|
|
@@ -2001,7 +2004,7 @@ function vinicuncaESLint(options = {}, ...userConfigs) {
|
|
|
2001
2004
|
autoRenamePlugins = true,
|
|
2002
2005
|
componentExts = [],
|
|
2003
2006
|
gitignore: enableGitignore = true,
|
|
2004
|
-
isInEditor =
|
|
2007
|
+
isInEditor = isInEditorEnv(),
|
|
2005
2008
|
jsx: enableJsx = true,
|
|
2006
2009
|
react: enableReact = false,
|
|
2007
2010
|
regexp: enableRegexp = true,
|
|
@@ -2026,9 +2029,7 @@ function vinicuncaESLint(options = {}, ...userConfigs) {
|
|
|
2026
2029
|
if (typeof enableGitignore !== "boolean") {
|
|
2027
2030
|
configs2.push(interopDefault(import("eslint-config-flat-gitignore")).then((r2) => [r2(enableGitignore)]));
|
|
2028
2031
|
} else {
|
|
2029
|
-
|
|
2030
|
-
configs2.push(interopDefault(import("eslint-config-flat-gitignore")).then((r2) => [r2()]));
|
|
2031
|
-
}
|
|
2032
|
+
configs2.push(interopDefault(import("eslint-config-flat-gitignore")).then((r2) => [r2()]));
|
|
2032
2033
|
}
|
|
2033
2034
|
}
|
|
2034
2035
|
const typescriptOptions = resolveSubOptions(options, "typescript");
|
|
@@ -2192,6 +2193,7 @@ function resolveSubOptions(options, key) {
|
|
|
2192
2193
|
ignores,
|
|
2193
2194
|
imports,
|
|
2194
2195
|
interopDefault,
|
|
2196
|
+
isInEditorEnv,
|
|
2195
2197
|
javascript,
|
|
2196
2198
|
jsdoc,
|
|
2197
2199
|
jsonc,
|