@eslint-sets/eslint-config 6.2.0-beta.1 → 6.2.0-beta.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/README.md +6 -5
- package/dist/cli/index.js +12 -13
- package/dist/cli/index.mjs +0 -1
- package/dist/configs/stylistic.d.ts +1 -1
- package/dist/configs/stylistic.d.ts.map +1 -1
- package/dist/configs/unocss.d.ts.map +1 -1
- package/dist/index.js +16 -20
- package/dist/index.mjs +7 -12
- package/dist/utils/git.d.ts.map +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -41,7 +41,7 @@ Try it online with StackBlitz:
|
|
|
41
41
|
- 🔍 **Editor Detection** - Automatically detect editor environment
|
|
42
42
|
- 🔎 **Config Inspector** - Visual tool for inspecting your ESLint config
|
|
43
43
|
- 📊 **Perfectionist Sorting** - Import/export sorting with natural ordering
|
|
44
|
-
-
|
|
44
|
+
- 🚀 **ESM-only** - Modern ESM package for optimal compatibility
|
|
45
45
|
|
|
46
46
|
## Supported Frameworks
|
|
47
47
|
|
|
@@ -84,6 +84,7 @@ bun add -D @eslint-sets/eslint-config eslint
|
|
|
84
84
|
|
|
85
85
|
- **Node.js**: `^18.18.0` or `^20.9.0` or `>=21.1.0`
|
|
86
86
|
- **ESLint**: `^9.10.0` or `^9.22.0`
|
|
87
|
+
- **Config file**: Must use `eslint.config.ts` or `eslint.config.mjs` (ESM format required)
|
|
87
88
|
|
|
88
89
|
> Note: `eslint-plugin-toml` requires Node.js `^20.19.0 || ^22.13.0 || >=24`. If you need TOML support on Node.js 18, consider downgrading to `eslint-plugin-toml@0.13.1`.
|
|
89
90
|
|
|
@@ -338,7 +339,7 @@ export default eslintConfig({
|
|
|
338
339
|
This config follows modern best practices with sensible defaults:
|
|
339
340
|
|
|
340
341
|
- **No line length limit**: `@stylistic/max-len` is not configured by default, allowing flexible line lengths
|
|
341
|
-
- **
|
|
342
|
+
- **Use global Buffer/process**: `n/prefer-global/buffer` and `n/prefer-global/process` are set to `'always'`, allowing direct use of global variables
|
|
342
343
|
- **Flexible unused expressions**: `ts/no-unused-expressions` allows short-circuit evaluation, ternary expressions, and tagged templates
|
|
343
344
|
- **Mixed operators grouping**: `@stylistic/no-mixed-operators` groups operators by category (comparison, logical, in/instanceof) for clearer code
|
|
344
345
|
|
|
@@ -350,9 +351,9 @@ export default eslintConfig({
|
|
|
350
351
|
// Add line length limit if needed
|
|
351
352
|
'@stylistic/max-len': ['error', { code: 120 }],
|
|
352
353
|
|
|
353
|
-
// Prefer
|
|
354
|
-
'n/prefer-global/buffer': ['error', '
|
|
355
|
-
'n/prefer-global/process': ['error', '
|
|
354
|
+
// Prefer imports over globals
|
|
355
|
+
'n/prefer-global/buffer': ['error', 'never'],
|
|
356
|
+
'n/prefer-global/process': ['error', 'never'],
|
|
356
357
|
},
|
|
357
358
|
})
|
|
358
359
|
```
|
package/dist/cli/index.js
CHANGED
|
@@ -26,7 +26,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
// src/cli/index.ts
|
|
27
27
|
var import_node_fs = require("node:fs");
|
|
28
28
|
var import_node_path = require("node:path");
|
|
29
|
-
var import_node_process = __toESM(require("node:process"));
|
|
30
29
|
var p = __toESM(require("@clack/prompts"));
|
|
31
30
|
async function main() {
|
|
32
31
|
console.clear();
|
|
@@ -50,7 +49,7 @@ async function main() {
|
|
|
50
49
|
});
|
|
51
50
|
if (p.isCancel(projectType)) {
|
|
52
51
|
p.cancel("Operation cancelled.");
|
|
53
|
-
|
|
52
|
+
process.exit(0);
|
|
54
53
|
}
|
|
55
54
|
answers.type = projectType;
|
|
56
55
|
const typescript = await p.confirm({
|
|
@@ -59,7 +58,7 @@ async function main() {
|
|
|
59
58
|
});
|
|
60
59
|
if (p.isCancel(typescript)) {
|
|
61
60
|
p.cancel("Operation cancelled.");
|
|
62
|
-
|
|
61
|
+
process.exit(0);
|
|
63
62
|
}
|
|
64
63
|
answers.typescript = typescript;
|
|
65
64
|
const frameworks = await p.multiselect({
|
|
@@ -79,7 +78,7 @@ async function main() {
|
|
|
79
78
|
});
|
|
80
79
|
if (p.isCancel(frameworks)) {
|
|
81
80
|
p.cancel("Operation cancelled.");
|
|
82
|
-
|
|
81
|
+
process.exit(0);
|
|
83
82
|
}
|
|
84
83
|
answers.frameworks = frameworks;
|
|
85
84
|
if (answers.frameworks.includes("vue") || answers.frameworks.includes("react")) {
|
|
@@ -89,7 +88,7 @@ async function main() {
|
|
|
89
88
|
});
|
|
90
89
|
if (p.isCancel(a11y)) {
|
|
91
90
|
p.cancel("Operation cancelled.");
|
|
92
|
-
|
|
91
|
+
process.exit(0);
|
|
93
92
|
}
|
|
94
93
|
answers.a11y = a11y;
|
|
95
94
|
}
|
|
@@ -102,7 +101,7 @@ async function main() {
|
|
|
102
101
|
});
|
|
103
102
|
if (p.isCancel(formatter)) {
|
|
104
103
|
p.cancel("Operation cancelled.");
|
|
105
|
-
|
|
104
|
+
process.exit(0);
|
|
106
105
|
}
|
|
107
106
|
answers.formatter = formatter;
|
|
108
107
|
const gitignore = await p.confirm({
|
|
@@ -111,7 +110,7 @@ async function main() {
|
|
|
111
110
|
});
|
|
112
111
|
if (p.isCancel(gitignore)) {
|
|
113
112
|
p.cancel("Operation cancelled.");
|
|
114
|
-
|
|
113
|
+
process.exit(0);
|
|
115
114
|
}
|
|
116
115
|
answers.gitignore = gitignore;
|
|
117
116
|
const sortPackageJson = await p.confirm({
|
|
@@ -120,7 +119,7 @@ async function main() {
|
|
|
120
119
|
});
|
|
121
120
|
if (p.isCancel(sortPackageJson)) {
|
|
122
121
|
p.cancel("Operation cancelled.");
|
|
123
|
-
|
|
122
|
+
process.exit(0);
|
|
124
123
|
}
|
|
125
124
|
answers.sortPackageJson = sortPackageJson;
|
|
126
125
|
const sortTsconfig = await p.confirm({
|
|
@@ -129,11 +128,11 @@ async function main() {
|
|
|
129
128
|
});
|
|
130
129
|
if (p.isCancel(sortTsconfig)) {
|
|
131
130
|
p.cancel("Operation cancelled.");
|
|
132
|
-
|
|
131
|
+
process.exit(0);
|
|
133
132
|
}
|
|
134
133
|
answers.sortTsconfig = sortTsconfig;
|
|
135
134
|
const config = generateConfig(answers);
|
|
136
|
-
const cwd =
|
|
135
|
+
const cwd = process.cwd();
|
|
137
136
|
const configPath = (0, import_node_path.resolve)(cwd, "eslint.config.ts");
|
|
138
137
|
if ((0, import_node_fs.existsSync)(configPath)) {
|
|
139
138
|
const overwrite = await p.confirm({
|
|
@@ -142,7 +141,7 @@ async function main() {
|
|
|
142
141
|
});
|
|
143
142
|
if (p.isCancel(overwrite) || !overwrite) {
|
|
144
143
|
p.cancel("Operation cancelled.");
|
|
145
|
-
|
|
144
|
+
process.exit(0);
|
|
146
145
|
}
|
|
147
146
|
}
|
|
148
147
|
(0, import_node_fs.writeFileSync)(configPath, config, "utf-8");
|
|
@@ -158,7 +157,7 @@ async function main() {
|
|
|
158
157
|
});
|
|
159
158
|
if (p.isCancel(packageManager)) {
|
|
160
159
|
p.cancel("Operation cancelled.");
|
|
161
|
-
|
|
160
|
+
process.exit(0);
|
|
162
161
|
}
|
|
163
162
|
const deps = getDependencies(answers);
|
|
164
163
|
const installCommand = getInstallCommand(packageManager, deps);
|
|
@@ -260,5 +259,5 @@ function getInstallCommand(packageManager, deps) {
|
|
|
260
259
|
}
|
|
261
260
|
main().catch((error) => {
|
|
262
261
|
console.error(error);
|
|
263
|
-
|
|
262
|
+
process.exit(1);
|
|
264
263
|
});
|
package/dist/cli/index.mjs
CHANGED
|
@@ -65,5 +65,5 @@ export declare const StylisticConfigDefaults: StylisticOptions;
|
|
|
65
65
|
/**
|
|
66
66
|
* Stylistic configuration
|
|
67
67
|
*/
|
|
68
|
-
export declare function stylistic(options?: StylisticOptions): Linter.Config[]
|
|
68
|
+
export declare function stylistic(options?: StylisticOptions): Promise<Linter.Config[]>;
|
|
69
69
|
//# sourceMappingURL=stylistic.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stylistic.d.ts","sourceRoot":"","sources":["../../src/configs/stylistic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAIpC;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IAErB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,YAAY,GAAG,QAAQ,CAAA;IAE7C;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IAExB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAA;IAEvB;;;OAGG;IACH,GAAG,CAAC,EAAE,OAAO,CAAA;IAEb;;;OAGG;IACH,SAAS,CAAC,EAAE,eAAe,GAAG,eAAe,CAAA;IAE7C;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,WAAW,CAAA;IAE9B;;;OAGG;IACH,UAAU,CAAC,EAAE,QAAQ,GAAG,WAAW,GAAG,YAAY,GAAG,sBAAsB,CAAA;IAE3E;;;OAGG;IACH,MAAM,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAA;IAE5B;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;IAEd;;;OAGG;IACH,aAAa,CAAC,EAAE,kBAAkB,GAAG,QAAQ,GAAG,OAAO,GAAG,gBAAgB,CAAA;CAC1E;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,gBAWrC,CAAA;AAED;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"stylistic.d.ts","sourceRoot":"","sources":["../../src/configs/stylistic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAIpC;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IAErB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,YAAY,GAAG,QAAQ,CAAA;IAE7C;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IAExB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAA;IAEvB;;;OAGG;IACH,GAAG,CAAC,EAAE,OAAO,CAAA;IAEb;;;OAGG;IACH,SAAS,CAAC,EAAE,eAAe,GAAG,eAAe,CAAA;IAE7C;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,WAAW,CAAA;IAE9B;;;OAGG;IACH,UAAU,CAAC,EAAE,QAAQ,GAAG,WAAW,GAAG,YAAY,GAAG,sBAAsB,CAAA;IAE3E;;;OAGG;IACH,MAAM,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAA;IAE5B;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;IAEd;;;OAGG;IACH,aAAa,CAAC,EAAE,kBAAkB,GAAG,QAAQ,GAAG,OAAO,GAAG,gBAAgB,CAAA;CAC1E;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,gBAWrC,CAAA;AAED;;GAEG;AACH,wBAAsB,SAAS,CAAC,OAAO,GAAE,gBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAyHxF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unocss.d.ts","sourceRoot":"","sources":["../../src/configs/unocss.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"unocss.d.ts","sourceRoot":"","sources":["../../src/configs/unocss.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAMhD;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,gBAAgB;IACtD;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;CAChB;AAgBD;;GAEG;AACH,wBAAsB,MAAM,CAAC,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAwClF"}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const __importMetaUrl=require('url').pathToFileURL(__filename).href;
|
|
1
2
|
"use strict";
|
|
2
3
|
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
@@ -263,17 +264,13 @@ async function ensurePackages(packages) {
|
|
|
263
264
|
}
|
|
264
265
|
}
|
|
265
266
|
|
|
266
|
-
// src/utils/index.ts
|
|
267
|
-
var import_node_process2 = __toESM(require("node:process"));
|
|
268
|
-
|
|
269
267
|
// src/utils/git.ts
|
|
270
268
|
var import_node_fs = require("node:fs");
|
|
271
269
|
var import_promises = require("node:fs/promises");
|
|
272
270
|
var import_node_path = __toESM(require("node:path"));
|
|
273
|
-
var import_node_process = __toESM(require("node:process"));
|
|
274
271
|
var { resolve } = import_node_path.default;
|
|
275
272
|
async function findUp(name, options) {
|
|
276
|
-
let directory = import_node_path.default.resolve(options?.cwd ??
|
|
273
|
+
let directory = import_node_path.default.resolve(options?.cwd ?? process.cwd());
|
|
277
274
|
const { root } = import_node_path.default.parse(directory);
|
|
278
275
|
while (true) {
|
|
279
276
|
const filePath = import_node_path.default.join(directory, name);
|
|
@@ -305,7 +302,7 @@ function parseGitignore(content) {
|
|
|
305
302
|
return line;
|
|
306
303
|
});
|
|
307
304
|
}
|
|
308
|
-
async function findGitignore(cwd =
|
|
305
|
+
async function findGitignore(cwd = process.cwd()) {
|
|
309
306
|
const gitignorePath = await findUp(".gitignore", { cwd });
|
|
310
307
|
if (!gitignorePath) {
|
|
311
308
|
return [];
|
|
@@ -317,7 +314,7 @@ async function findGitignore(cwd = import_node_process.default.cwd()) {
|
|
|
317
314
|
return [];
|
|
318
315
|
}
|
|
319
316
|
}
|
|
320
|
-
async function getGitignorePatterns(cwd =
|
|
317
|
+
async function getGitignorePatterns(cwd = process.cwd()) {
|
|
321
318
|
const patterns = [];
|
|
322
319
|
const gitignorePath = await findUp(".gitignore", { cwd });
|
|
323
320
|
if (gitignorePath) {
|
|
@@ -379,7 +376,7 @@ function filterNil(array) {
|
|
|
379
376
|
return array.filter((item) => item !== void 0 && item !== null);
|
|
380
377
|
}
|
|
381
378
|
function isInEditorEnv() {
|
|
382
|
-
return EDITOR_ENV_KEYS.some((key) =>
|
|
379
|
+
return EDITOR_ENV_KEYS.some((key) => process.env[key]);
|
|
383
380
|
}
|
|
384
381
|
async function interopDefault(promise) {
|
|
385
382
|
const result = await promise;
|
|
@@ -1334,9 +1331,9 @@ function node() {
|
|
|
1334
1331
|
"n/no-sync": "off",
|
|
1335
1332
|
"n/no-unpublished-import": "off",
|
|
1336
1333
|
"n/no-unpublished-require": "off",
|
|
1337
|
-
"n/prefer-global/buffer": ["error", "
|
|
1334
|
+
"n/prefer-global/buffer": ["error", "always"],
|
|
1338
1335
|
"n/prefer-global/console": ["error", "always"],
|
|
1339
|
-
"n/prefer-global/process": ["error", "
|
|
1336
|
+
"n/prefer-global/process": ["error", "always"],
|
|
1340
1337
|
"n/prefer-global/text-decoder": ["error", "always"],
|
|
1341
1338
|
"n/prefer-global/text-encoder": ["error", "always"],
|
|
1342
1339
|
"n/prefer-global/url": ["error", "always"],
|
|
@@ -1861,7 +1858,6 @@ async function sortTsconfig(options = {}) {
|
|
|
1861
1858
|
}
|
|
1862
1859
|
|
|
1863
1860
|
// src/configs/stylistic.ts
|
|
1864
|
-
var import_eslint_plugin = __toESM(require("@stylistic/eslint-plugin"));
|
|
1865
1861
|
var StylisticConfigDefaults = {
|
|
1866
1862
|
arrowParens: true,
|
|
1867
1863
|
braceStyle: "1tbs",
|
|
@@ -1874,7 +1870,7 @@ var StylisticConfigDefaults = {
|
|
|
1874
1870
|
semi: false,
|
|
1875
1871
|
trailingComma: "always-multiline"
|
|
1876
1872
|
};
|
|
1877
|
-
function stylistic(options = {}) {
|
|
1873
|
+
async function stylistic(options = {}) {
|
|
1878
1874
|
const {
|
|
1879
1875
|
arrowParens,
|
|
1880
1876
|
braceStyle,
|
|
@@ -1891,7 +1887,8 @@ function stylistic(options = {}) {
|
|
|
1891
1887
|
...StylisticConfigDefaults,
|
|
1892
1888
|
...options
|
|
1893
1889
|
};
|
|
1894
|
-
const
|
|
1890
|
+
const stylisticPlugin = await interopDefault(import("@stylistic/eslint-plugin"));
|
|
1891
|
+
const config2 = stylisticPlugin.configs.customize({
|
|
1895
1892
|
arrowParens,
|
|
1896
1893
|
blockSpacing: true,
|
|
1897
1894
|
braceStyle,
|
|
@@ -1909,7 +1906,7 @@ function stylistic(options = {}) {
|
|
|
1909
1906
|
files: [GLOB_SRC],
|
|
1910
1907
|
name: "eslint-sets/stylistic",
|
|
1911
1908
|
plugins: {
|
|
1912
|
-
"@stylistic":
|
|
1909
|
+
"@stylistic": stylisticPlugin
|
|
1913
1910
|
},
|
|
1914
1911
|
rules: {
|
|
1915
1912
|
// Base rules from customize
|
|
@@ -2039,17 +2036,17 @@ async function svelte(options = {}) {
|
|
|
2039
2036
|
}
|
|
2040
2037
|
|
|
2041
2038
|
// src/configs/test.ts
|
|
2042
|
-
var
|
|
2039
|
+
var import_eslint_plugin = __toESM(require("@vitest/eslint-plugin"));
|
|
2043
2040
|
function test(options = {}) {
|
|
2044
2041
|
const { overrides = {} } = options;
|
|
2045
2042
|
return {
|
|
2046
2043
|
files: [GLOB_TESTS],
|
|
2047
2044
|
name: "eslint-sets/test",
|
|
2048
2045
|
plugins: {
|
|
2049
|
-
vitest:
|
|
2046
|
+
vitest: import_eslint_plugin.default
|
|
2050
2047
|
},
|
|
2051
2048
|
rules: {
|
|
2052
|
-
...
|
|
2049
|
+
...import_eslint_plugin.default.configs.recommended.rules,
|
|
2053
2050
|
// Relax rules for test files
|
|
2054
2051
|
"no-console": "off",
|
|
2055
2052
|
"ts/no-explicit-any": "off",
|
|
@@ -2329,7 +2326,6 @@ function unicorn(options = {}) {
|
|
|
2329
2326
|
// src/configs/unocss.ts
|
|
2330
2327
|
var import_node_fs2 = require("node:fs");
|
|
2331
2328
|
var import_node_path2 = require("node:path");
|
|
2332
|
-
var import_node_process3 = __toESM(require("node:process"));
|
|
2333
2329
|
function hasUnoCSSConfig() {
|
|
2334
2330
|
const configFiles = [
|
|
2335
2331
|
"uno.config.ts",
|
|
@@ -2337,7 +2333,7 @@ function hasUnoCSSConfig() {
|
|
|
2337
2333
|
"unocss.config.ts",
|
|
2338
2334
|
"unocss.config.js"
|
|
2339
2335
|
];
|
|
2340
|
-
return configFiles.some((file) => (0, import_node_fs2.existsSync)((0, import_node_path2.resolve)(
|
|
2336
|
+
return configFiles.some((file) => (0, import_node_fs2.existsSync)((0, import_node_path2.resolve)(process.cwd(), file)));
|
|
2341
2337
|
}
|
|
2342
2338
|
async function unocss(options = {}) {
|
|
2343
2339
|
const { overrides = {}, strict = false } = options;
|
|
@@ -2737,7 +2733,7 @@ async function config(options = {}) {
|
|
|
2737
2733
|
}
|
|
2738
2734
|
if (stylisticOption !== false && stylisticOption !== void 0) {
|
|
2739
2735
|
const stylisticOpts = typeof stylisticOption === "object" ? stylisticOption : {};
|
|
2740
|
-
configs.push(...stylistic(stylisticOpts));
|
|
2736
|
+
configs.push(...await stylistic(stylisticOpts));
|
|
2741
2737
|
}
|
|
2742
2738
|
if (prettierOption !== false && stylisticOption === false) {
|
|
2743
2739
|
const prettierOpts = typeof prettierOption === "object" ? prettierOption : {};
|
package/dist/index.mjs
CHANGED
|
@@ -134,14 +134,10 @@ async function ensurePackages(packages) {
|
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
// src/utils/index.ts
|
|
138
|
-
import process2 from "node:process";
|
|
139
|
-
|
|
140
137
|
// src/utils/git.ts
|
|
141
138
|
import { existsSync, readFileSync } from "node:fs";
|
|
142
139
|
import { stat } from "node:fs/promises";
|
|
143
140
|
import path from "node:path";
|
|
144
|
-
import process from "node:process";
|
|
145
141
|
var { resolve } = path;
|
|
146
142
|
async function findUp(name, options) {
|
|
147
143
|
let directory = path.resolve(options?.cwd ?? process.cwd());
|
|
@@ -250,7 +246,7 @@ function filterNil(array) {
|
|
|
250
246
|
return array.filter((item) => item !== void 0 && item !== null);
|
|
251
247
|
}
|
|
252
248
|
function isInEditorEnv() {
|
|
253
|
-
return EDITOR_ENV_KEYS.some((key) =>
|
|
249
|
+
return EDITOR_ENV_KEYS.some((key) => process.env[key]);
|
|
254
250
|
}
|
|
255
251
|
async function interopDefault(promise) {
|
|
256
252
|
const result = await promise;
|
|
@@ -1205,9 +1201,9 @@ function node() {
|
|
|
1205
1201
|
"n/no-sync": "off",
|
|
1206
1202
|
"n/no-unpublished-import": "off",
|
|
1207
1203
|
"n/no-unpublished-require": "off",
|
|
1208
|
-
"n/prefer-global/buffer": ["error", "
|
|
1204
|
+
"n/prefer-global/buffer": ["error", "always"],
|
|
1209
1205
|
"n/prefer-global/console": ["error", "always"],
|
|
1210
|
-
"n/prefer-global/process": ["error", "
|
|
1206
|
+
"n/prefer-global/process": ["error", "always"],
|
|
1211
1207
|
"n/prefer-global/text-decoder": ["error", "always"],
|
|
1212
1208
|
"n/prefer-global/text-encoder": ["error", "always"],
|
|
1213
1209
|
"n/prefer-global/url": ["error", "always"],
|
|
@@ -1732,7 +1728,6 @@ async function sortTsconfig(options = {}) {
|
|
|
1732
1728
|
}
|
|
1733
1729
|
|
|
1734
1730
|
// src/configs/stylistic.ts
|
|
1735
|
-
import stylisticPlugin from "@stylistic/eslint-plugin";
|
|
1736
1731
|
var StylisticConfigDefaults = {
|
|
1737
1732
|
arrowParens: true,
|
|
1738
1733
|
braceStyle: "1tbs",
|
|
@@ -1745,7 +1740,7 @@ var StylisticConfigDefaults = {
|
|
|
1745
1740
|
semi: false,
|
|
1746
1741
|
trailingComma: "always-multiline"
|
|
1747
1742
|
};
|
|
1748
|
-
function stylistic(options = {}) {
|
|
1743
|
+
async function stylistic(options = {}) {
|
|
1749
1744
|
const {
|
|
1750
1745
|
arrowParens,
|
|
1751
1746
|
braceStyle,
|
|
@@ -1762,6 +1757,7 @@ function stylistic(options = {}) {
|
|
|
1762
1757
|
...StylisticConfigDefaults,
|
|
1763
1758
|
...options
|
|
1764
1759
|
};
|
|
1760
|
+
const stylisticPlugin = await interopDefault(import("@stylistic/eslint-plugin"));
|
|
1765
1761
|
const config2 = stylisticPlugin.configs.customize({
|
|
1766
1762
|
arrowParens,
|
|
1767
1763
|
blockSpacing: true,
|
|
@@ -2200,7 +2196,6 @@ function unicorn(options = {}) {
|
|
|
2200
2196
|
// src/configs/unocss.ts
|
|
2201
2197
|
import { existsSync as existsSync2 } from "node:fs";
|
|
2202
2198
|
import { resolve as resolve2 } from "node:path";
|
|
2203
|
-
import process3 from "node:process";
|
|
2204
2199
|
function hasUnoCSSConfig() {
|
|
2205
2200
|
const configFiles = [
|
|
2206
2201
|
"uno.config.ts",
|
|
@@ -2208,7 +2203,7 @@ function hasUnoCSSConfig() {
|
|
|
2208
2203
|
"unocss.config.ts",
|
|
2209
2204
|
"unocss.config.js"
|
|
2210
2205
|
];
|
|
2211
|
-
return configFiles.some((file) => existsSync2(resolve2(
|
|
2206
|
+
return configFiles.some((file) => existsSync2(resolve2(process.cwd(), file)));
|
|
2212
2207
|
}
|
|
2213
2208
|
async function unocss(options = {}) {
|
|
2214
2209
|
const { overrides = {}, strict = false } = options;
|
|
@@ -2608,7 +2603,7 @@ async function config(options = {}) {
|
|
|
2608
2603
|
}
|
|
2609
2604
|
if (stylisticOption !== false && stylisticOption !== void 0) {
|
|
2610
2605
|
const stylisticOpts = typeof stylisticOption === "object" ? stylisticOption : {};
|
|
2611
|
-
configs.push(...stylistic(stylisticOpts));
|
|
2606
|
+
configs.push(...await stylistic(stylisticOpts));
|
|
2612
2607
|
}
|
|
2613
2608
|
if (prettierOption !== false && stylisticOption === false) {
|
|
2614
2609
|
const prettierOpts = typeof prettierOption === "object" ? prettierOption : {};
|
package/dist/utils/git.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/utils/git.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/utils/git.ts"],"names":[],"mappings":"AAuCA;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAuBxD;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,GAAG,GAAE,MAAsB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAclF;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CAAC,GAAG,GAAE,MAAsB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CA8BzF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAIpC,cAAc,OAAO,CAAA;AAGrB,cAAc,SAAS,CAAA;AAEvB;;GAEG;AACH,wBAAgB,OAAO,CAAC,GAAG,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,CAEpE;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAC1B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,SAAS,CAAC,EACvC,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,GACX,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,SAAS,CAAC,CAYlC;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAoB7F;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,CAElD;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,EAAE,CAEjE;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAEvC;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,CAAC,EACrC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GACjB,OAAO,CAAC,CAAC,SAAS;IAAE,OAAO,EAAE,MAAM,CAAC,CAAA;CAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAIjD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,EACjD,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,GAAG,EAAE,CAAC,GACJ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAQzB;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,WAAW,CAI9F;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC7B,WAAW,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,MAAM,EAAE,CAAC,GAAG,SAAS,GACpE,MAAM,EAAE,CAYV"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-sets/eslint-config",
|
|
3
3
|
"description": "Modern ESLint config with flat config support for Vue, React, Svelte, TypeScript, Next.js, Nuxt, Astro, Angular, UnoCSS and more",
|
|
4
|
-
"version": "6.2.0-beta.
|
|
4
|
+
"version": "6.2.0-beta.3",
|
|
5
5
|
"packageManager": "pnpm@9.0.6",
|
|
6
6
|
"bin": {
|
|
7
7
|
"eslint-sets": "./dist/cli/index.js"
|