@so1ve/eslint-config 3.9.0 → 3.9.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.ts +263 -191
- package/dist/index.js +60 -63
- package/package.json +17 -18
- package/dist/chunk-RDQt0V5E.js +0 -31
- package/dist/dist-CNSADWmJ.js +0 -174169
package/dist/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { __toDynamicImportESM } from "./chunk-RDQt0V5E.js";
|
|
2
1
|
import pluginComments from "@eslint-community/eslint-plugin-eslint-comments";
|
|
3
2
|
import pluginSo1ve from "@so1ve/eslint-plugin";
|
|
4
3
|
import pluginSortImports from "@so1ve/eslint-plugin-sort-imports";
|
|
@@ -17,22 +16,6 @@ import fs from "node:fs";
|
|
|
17
16
|
import { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
18
17
|
import { isPackageExists } from "local-pkg";
|
|
19
18
|
|
|
20
|
-
//#region src/configs/comments.ts
|
|
21
|
-
const comments = () => [{
|
|
22
|
-
name: "so1ve/comments/setup",
|
|
23
|
-
plugins: { "eslint-comments": pluginComments }
|
|
24
|
-
}, {
|
|
25
|
-
name: "so1ve/comments/rules",
|
|
26
|
-
rules: {
|
|
27
|
-
"eslint-comments/no-aggregating-enable": "error",
|
|
28
|
-
"eslint-comments/no-duplicate-disable": "error",
|
|
29
|
-
"eslint-comments/no-unused-enable": "error",
|
|
30
|
-
"eslint-comments/disable-enable-pair": "off",
|
|
31
|
-
"eslint-comments/no-unlimited-disable": "off"
|
|
32
|
-
}
|
|
33
|
-
}];
|
|
34
|
-
|
|
35
|
-
//#endregion
|
|
36
19
|
//#region src/globs.ts
|
|
37
20
|
const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
38
21
|
const GLOB_SRC = `**/*.${GLOB_SRC_EXT}`;
|
|
@@ -142,14 +125,70 @@ async function interopDefault(m) {
|
|
|
142
125
|
return resolved.default ?? resolved;
|
|
143
126
|
}
|
|
144
127
|
|
|
128
|
+
//#endregion
|
|
129
|
+
//#region src/configs/astro.ts
|
|
130
|
+
async function astro({ overrides = {} } = {}) {
|
|
131
|
+
const [pluginAstro, parserAstro, parserTs] = await Promise.all([
|
|
132
|
+
interopDefault(import("eslint-plugin-astro")),
|
|
133
|
+
interopDefault(import("astro-eslint-parser")),
|
|
134
|
+
interopDefault(import("@typescript-eslint/parser"))
|
|
135
|
+
]);
|
|
136
|
+
return [{
|
|
137
|
+
name: "antfu/astro/setup",
|
|
138
|
+
plugins: { astro: pluginAstro }
|
|
139
|
+
}, {
|
|
140
|
+
files: [GLOB_ASTRO],
|
|
141
|
+
languageOptions: {
|
|
142
|
+
globals: pluginAstro.environments.astro.globals,
|
|
143
|
+
parser: parserAstro,
|
|
144
|
+
parserOptions: {
|
|
145
|
+
extraFileExtensions: [".astro"],
|
|
146
|
+
parser: parserTs
|
|
147
|
+
},
|
|
148
|
+
sourceType: "module"
|
|
149
|
+
},
|
|
150
|
+
name: "antfu/astro/rules",
|
|
151
|
+
processor: "astro/client-side-ts",
|
|
152
|
+
rules: {
|
|
153
|
+
"antfu/no-top-level-await": "off",
|
|
154
|
+
"astro/missing-client-only-directive-value": "error",
|
|
155
|
+
"astro/no-conflict-set-directives": "error",
|
|
156
|
+
"astro/no-deprecated-astro-canonicalurl": "error",
|
|
157
|
+
"astro/no-deprecated-astro-fetchcontent": "error",
|
|
158
|
+
"astro/no-deprecated-astro-resolve": "error",
|
|
159
|
+
"astro/no-deprecated-getentrybyslug": "error",
|
|
160
|
+
"astro/no-set-html-directive": "off",
|
|
161
|
+
"astro/no-unused-define-vars-in-style": "error",
|
|
162
|
+
"astro/semi": "off",
|
|
163
|
+
"astro/valid-compile": "error",
|
|
164
|
+
...overrides
|
|
165
|
+
}
|
|
166
|
+
}];
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
//#endregion
|
|
170
|
+
//#region src/configs/comments.ts
|
|
171
|
+
const comments = () => [{
|
|
172
|
+
name: "so1ve/comments/setup",
|
|
173
|
+
plugins: { "eslint-comments": pluginComments }
|
|
174
|
+
}, {
|
|
175
|
+
name: "so1ve/comments/rules",
|
|
176
|
+
rules: {
|
|
177
|
+
"eslint-comments/no-aggregating-enable": "error",
|
|
178
|
+
"eslint-comments/no-duplicate-disable": "error",
|
|
179
|
+
"eslint-comments/no-unused-enable": "error",
|
|
180
|
+
"eslint-comments/disable-enable-pair": "off",
|
|
181
|
+
"eslint-comments/no-unlimited-disable": "off"
|
|
182
|
+
}
|
|
183
|
+
}];
|
|
184
|
+
|
|
145
185
|
//#endregion
|
|
146
186
|
//#region src/configs/formatting.ts
|
|
147
187
|
async function formatting(options) {
|
|
148
|
-
const pluginStylistic = await interopDefault(import("@stylistic/eslint-plugin"));
|
|
149
188
|
return [
|
|
150
189
|
{
|
|
151
190
|
name: "so1ve/formatting/setup",
|
|
152
|
-
plugins: { style:
|
|
191
|
+
plugins: { style: await interopDefault(import("@stylistic/eslint-plugin")) }
|
|
153
192
|
},
|
|
154
193
|
{
|
|
155
194
|
name: "so1ve/formatting/rules",
|
|
@@ -1479,47 +1518,6 @@ async function yaml({ overrides } = {}) {
|
|
|
1479
1518
|
}];
|
|
1480
1519
|
}
|
|
1481
1520
|
|
|
1482
|
-
//#endregion
|
|
1483
|
-
//#region src/configs/astro.ts
|
|
1484
|
-
async function astro({ overrides = {} } = {}) {
|
|
1485
|
-
const [pluginAstro, parserAstro, parserTs] = await Promise.all([
|
|
1486
|
-
interopDefault(import("eslint-plugin-astro")),
|
|
1487
|
-
interopDefault(import("astro-eslint-parser")),
|
|
1488
|
-
interopDefault(import("./dist-CNSADWmJ.js").then(__toDynamicImportESM(1)))
|
|
1489
|
-
]);
|
|
1490
|
-
return [{
|
|
1491
|
-
name: "antfu/astro/setup",
|
|
1492
|
-
plugins: { astro: pluginAstro }
|
|
1493
|
-
}, {
|
|
1494
|
-
files: [GLOB_ASTRO],
|
|
1495
|
-
languageOptions: {
|
|
1496
|
-
globals: pluginAstro.environments.astro.globals,
|
|
1497
|
-
parser: parserAstro,
|
|
1498
|
-
parserOptions: {
|
|
1499
|
-
extraFileExtensions: [".astro"],
|
|
1500
|
-
parser: parserTs
|
|
1501
|
-
},
|
|
1502
|
-
sourceType: "module"
|
|
1503
|
-
},
|
|
1504
|
-
name: "antfu/astro/rules",
|
|
1505
|
-
processor: "astro/client-side-ts",
|
|
1506
|
-
rules: {
|
|
1507
|
-
"antfu/no-top-level-await": "off",
|
|
1508
|
-
"astro/missing-client-only-directive-value": "error",
|
|
1509
|
-
"astro/no-conflict-set-directives": "error",
|
|
1510
|
-
"astro/no-deprecated-astro-canonicalurl": "error",
|
|
1511
|
-
"astro/no-deprecated-astro-fetchcontent": "error",
|
|
1512
|
-
"astro/no-deprecated-astro-resolve": "error",
|
|
1513
|
-
"astro/no-deprecated-getentrybyslug": "error",
|
|
1514
|
-
"astro/no-set-html-directive": "off",
|
|
1515
|
-
"astro/no-unused-define-vars-in-style": "error",
|
|
1516
|
-
"astro/semi": "off",
|
|
1517
|
-
"astro/valid-compile": "error",
|
|
1518
|
-
...overrides
|
|
1519
|
-
}
|
|
1520
|
-
}];
|
|
1521
|
-
}
|
|
1522
|
-
|
|
1523
1521
|
//#endregion
|
|
1524
1522
|
//#region src/factory.ts
|
|
1525
1523
|
const flatConfigProps = [
|
|
@@ -1586,8 +1584,7 @@ function so1ve(options = {}, ...userConfigs) {
|
|
|
1586
1584
|
return acc;
|
|
1587
1585
|
}, {});
|
|
1588
1586
|
if (Object.keys(fusedConfig).length > 0) configs.push([fusedConfig]);
|
|
1589
|
-
|
|
1590
|
-
return composer;
|
|
1587
|
+
return new FlatConfigComposer().append(...configs, ...userConfigs).renamePlugins(defaultPluginRenaming);
|
|
1591
1588
|
}
|
|
1592
1589
|
const resolveSubOptions = (options, key) => typeof options[key] === "boolean" ? {} : options[key] ?? {};
|
|
1593
1590
|
function getOverrides(options, key) {
|
|
@@ -1599,4 +1596,4 @@ function getOverrides(options, key) {
|
|
|
1599
1596
|
}
|
|
1600
1597
|
|
|
1601
1598
|
//#endregion
|
|
1602
|
-
export { GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_DTS, GLOB_ESLINTRC, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_PACKAGEJSON, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSCONFIG, GLOB_TSX, GLOB_VUE, GLOB_YAML, comments, defaultPluginRenaming, formatting, getOverrides, html, ignores, imports, interopDefault, javascript, jsonc, mdx, node, onlyError, pnpm, promise, renameRules, resolveSubOptions, so1ve, solid, sortImports, test, toml, typescript, unicorn, vue, yaml };
|
|
1599
|
+
export { GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_DTS, GLOB_ESLINTRC, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_PACKAGEJSON, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSCONFIG, GLOB_TSX, GLOB_VUE, GLOB_YAML, astro, comments, defaultPluginRenaming, formatting, getOverrides, html, ignores, imports, interopDefault, javascript, jsonc, mdx, node, onlyError, pnpm, promise, renameRules, resolveSubOptions, so1ve, solid, sortImports, test, toml, typescript, unicorn, vue, yaml };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@so1ve/eslint-config",
|
|
3
|
-
"version": "3.9.
|
|
3
|
+
"version": "3.9.1",
|
|
4
4
|
"author": "Ray <i@mk1.io> (https://github.com/so1ve/)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Ray's eslint config.",
|
|
@@ -33,11 +33,13 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
36
|
-
"@html-eslint/eslint-plugin": "^0.
|
|
37
|
-
"@html-eslint/parser": "^0.
|
|
38
|
-
"@stylistic/eslint-plugin": "^5.
|
|
39
|
-
"@
|
|
40
|
-
"@
|
|
36
|
+
"@html-eslint/eslint-plugin": "^0.46.2",
|
|
37
|
+
"@html-eslint/parser": "^0.46.2",
|
|
38
|
+
"@stylistic/eslint-plugin": "^5.3.1",
|
|
39
|
+
"@typescript-eslint/parser": "^8.44.0",
|
|
40
|
+
"@typescript-eslint/utils": "^8.44.0",
|
|
41
|
+
"@unocss/eslint-config": "^66.5.1",
|
|
42
|
+
"@vitest/eslint-plugin": "^1.3.10",
|
|
41
43
|
"astro-eslint-parser": "^1.2.2",
|
|
42
44
|
"eslint-config-flat-gitignore": "^2.1.0",
|
|
43
45
|
"eslint-flat-config-utils": "^2.1.1",
|
|
@@ -51,8 +53,8 @@
|
|
|
51
53
|
"eslint-plugin-jest-formatting": "^3.1.0",
|
|
52
54
|
"eslint-plugin-jsonc": "^2.20.1",
|
|
53
55
|
"eslint-plugin-mdx": "^3.6.2",
|
|
54
|
-
"eslint-plugin-n": "^17.
|
|
55
|
-
"eslint-plugin-no-await-in-promise": "^3.0.
|
|
56
|
+
"eslint-plugin-n": "^17.23.0",
|
|
57
|
+
"eslint-plugin-no-await-in-promise": "^3.0.1",
|
|
56
58
|
"eslint-plugin-no-explicit-type-exports": "^0.12.1",
|
|
57
59
|
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
58
60
|
"eslint-plugin-only-error": "^1.0.2",
|
|
@@ -61,26 +63,23 @@
|
|
|
61
63
|
"eslint-plugin-regexp": "^2.10.0",
|
|
62
64
|
"eslint-plugin-solid": "^0.14.5",
|
|
63
65
|
"eslint-plugin-toml": "^0.12.0",
|
|
64
|
-
"eslint-plugin-unicorn": "^
|
|
66
|
+
"eslint-plugin-unicorn": "^61.0.2",
|
|
65
67
|
"eslint-plugin-unused-imports": "^4.2.0",
|
|
66
68
|
"eslint-plugin-vue": "^10.4.0",
|
|
67
69
|
"eslint-plugin-yml": "^1.18.0",
|
|
68
|
-
"globals": "^16.
|
|
70
|
+
"globals": "^16.4.0",
|
|
69
71
|
"jsonc-eslint-parser": "^2.4.0",
|
|
70
72
|
"local-pkg": "^1.1.2",
|
|
71
73
|
"toml-eslint-parser": "^0.10.0",
|
|
72
|
-
"typescript-eslint": "^8.
|
|
74
|
+
"typescript-eslint": "^8.44.0",
|
|
73
75
|
"vue-eslint-parser": "^10.2.0",
|
|
74
76
|
"yaml-eslint-parser": "^1.3.0",
|
|
75
|
-
"@so1ve/eslint-plugin": "3.9.
|
|
76
|
-
"@so1ve/eslint-plugin-sort-imports": "3.9.
|
|
77
|
-
},
|
|
78
|
-
"devDependencies": {
|
|
79
|
-
"@typescript-eslint/utils": "^8.40.0"
|
|
77
|
+
"@so1ve/eslint-plugin": "3.9.1",
|
|
78
|
+
"@so1ve/eslint-plugin-sort-imports": "3.9.1"
|
|
80
79
|
},
|
|
81
80
|
"peerDependencies": {
|
|
82
|
-
"eslint": "^9",
|
|
83
|
-
"prettier": "^3"
|
|
81
|
+
"eslint": "^9.35.0",
|
|
82
|
+
"prettier": "^3.6.2"
|
|
84
83
|
},
|
|
85
84
|
"scripts": {
|
|
86
85
|
"build": "tsdown && nr typegen",
|
package/dist/chunk-RDQt0V5E.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module";
|
|
2
|
-
|
|
3
|
-
//#region rolldown:runtime
|
|
4
|
-
var __create = Object.create;
|
|
5
|
-
var __defProp = Object.defineProperty;
|
|
6
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __commonJS = (cb, mod) => function() {
|
|
11
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
12
|
-
};
|
|
13
|
-
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
15
|
-
key = keys[i];
|
|
16
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
-
get: ((k) => from[k]).bind(null, key),
|
|
18
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
return to;
|
|
22
|
-
};
|
|
23
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
24
|
-
value: mod,
|
|
25
|
-
enumerable: true
|
|
26
|
-
}) : target, mod));
|
|
27
|
-
var __toDynamicImportESM = (isNodeMode) => (mod) => __toESM(mod.default, isNodeMode);
|
|
28
|
-
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
29
|
-
|
|
30
|
-
//#endregion
|
|
31
|
-
export { __commonJS, __require, __toDynamicImportESM };
|