@eslint-sets/eslint-config 6.2.0-beta.2 → 6.2.0-beta.4
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 +9 -5
- package/dist/cli/index.js +6 -29
- package/dist/index.js +93 -220
- package/package.json +3 -4
- package/dist/cli/index.mjs +0 -240
- package/dist/index.mjs +0 -2723
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,9 @@ 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 ESM format (`eslint.config.ts` or `eslint.config.mjs`)
|
|
88
|
+
|
|
89
|
+
> **Note**: This package is ESM-only. CommonJS config files (`eslint.config.cjs`, `eslint.config.js` without `"type": "module"`) are not supported. This is required because core dependencies like `@stylistic/eslint-plugin` are ESM-only.
|
|
87
90
|
|
|
88
91
|
> 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
92
|
|
|
@@ -849,10 +852,11 @@ export default eslintConfig({
|
|
|
849
852
|
### Key Changes in v6
|
|
850
853
|
|
|
851
854
|
1. **Flat Config**: v6 uses ESLint's new flat config format (`eslint.config.ts` instead of `.eslintrc.js`)
|
|
852
|
-
2. **
|
|
853
|
-
3. **
|
|
854
|
-
4. **
|
|
855
|
-
5. **
|
|
855
|
+
2. **ESM-only**: Package is now pure ESM, requires `eslint.config.ts` or `eslint.config.mjs`
|
|
856
|
+
3. **Single Package**: All sub-packages merged into one package
|
|
857
|
+
4. **Auto-detection**: Frameworks are auto-detected by default
|
|
858
|
+
5. **Stylistic**: Default formatting uses `@stylistic/eslint-plugin` instead of Prettier
|
|
859
|
+
6. **TypeScript Types**: Auto-generated types for all rules
|
|
856
860
|
|
|
857
861
|
## VS Code Integration
|
|
858
862
|
|
package/dist/cli/index.js
CHANGED
|
@@ -1,32 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
var __create = Object.create;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
18
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
19
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
20
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
21
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
22
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
23
|
-
mod
|
|
24
|
-
));
|
|
25
2
|
|
|
26
3
|
// src/cli/index.ts
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
4
|
+
import { existsSync, writeFileSync } from "node:fs";
|
|
5
|
+
import { resolve } from "node:path";
|
|
6
|
+
import * as p from "@clack/prompts";
|
|
30
7
|
async function main() {
|
|
31
8
|
console.clear();
|
|
32
9
|
p.intro(" @eslint-sets/eslint-config ");
|
|
@@ -133,8 +110,8 @@ async function main() {
|
|
|
133
110
|
answers.sortTsconfig = sortTsconfig;
|
|
134
111
|
const config = generateConfig(answers);
|
|
135
112
|
const cwd = process.cwd();
|
|
136
|
-
const configPath =
|
|
137
|
-
if (
|
|
113
|
+
const configPath = resolve(cwd, "eslint.config.ts");
|
|
114
|
+
if (existsSync(configPath)) {
|
|
138
115
|
const overwrite = await p.confirm({
|
|
139
116
|
initialValue: false,
|
|
140
117
|
message: "eslint.config.ts already exists. Overwrite?"
|
|
@@ -144,7 +121,7 @@ async function main() {
|
|
|
144
121
|
process.exit(0);
|
|
145
122
|
}
|
|
146
123
|
}
|
|
147
|
-
|
|
124
|
+
writeFileSync(configPath, config, "utf-8");
|
|
148
125
|
p.note(`Created ${configPath}`, "Success!");
|
|
149
126
|
const packageManager = await p.select({
|
|
150
127
|
message: "Choose a package manager",
|