@lntvow/eslint-config 9.3.10 → 9.3.12
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 +110 -25
- package/dist/index.d.cts +27 -27
- package/dist/index.d.ts +27 -27
- package/dist/{index.js → index.mjs} +108 -26
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -60,7 +60,6 @@ __export(src_exports, {
|
|
|
60
60
|
GLOB_YAML: () => GLOB_YAML,
|
|
61
61
|
StylisticConfigDefaults: () => StylisticConfigDefaults,
|
|
62
62
|
custom: () => custom,
|
|
63
|
-
default: () => src_default,
|
|
64
63
|
getVueVersion: () => getVueVersion,
|
|
65
64
|
gitignore: () => gitignore,
|
|
66
65
|
ignores: () => ignores,
|
|
@@ -77,10 +76,18 @@ __export(src_exports, {
|
|
|
77
76
|
});
|
|
78
77
|
module.exports = __toCommonJS(src_exports);
|
|
79
78
|
|
|
80
|
-
// src/
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
// src/utils/index.ts
|
|
80
|
+
function renameRules(rules, map) {
|
|
81
|
+
return Object.fromEntries(
|
|
82
|
+
Object.entries(rules).map(([key, value]) => {
|
|
83
|
+
for (const [from, to] of Object.entries(map)) {
|
|
84
|
+
if (key.startsWith(`${from}/`))
|
|
85
|
+
return [to + key.slice(from.length), value];
|
|
86
|
+
}
|
|
87
|
+
return [key, value];
|
|
88
|
+
})
|
|
89
|
+
);
|
|
90
|
+
}
|
|
84
91
|
|
|
85
92
|
// src/configs/custom.ts
|
|
86
93
|
var import_eslint_plugin = __toESM(require("@lntvow/eslint-plugin"), 1);
|
|
@@ -97,11 +104,104 @@ async function custom() {
|
|
|
97
104
|
|
|
98
105
|
// src/configs/gitignore.ts
|
|
99
106
|
var import_fs = __toESM(require("fs"), 1);
|
|
100
|
-
|
|
107
|
+
|
|
108
|
+
// node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
|
|
109
|
+
var import_node_path2 = __toESM(require("path"), 1);
|
|
110
|
+
|
|
111
|
+
// node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
|
|
112
|
+
var import_node_process = __toESM(require("process"), 1);
|
|
113
|
+
var import_node_path = __toESM(require("path"), 1);
|
|
114
|
+
var import_node_fs = __toESM(require("fs"), 1);
|
|
115
|
+
var import_node_url = require("url");
|
|
116
|
+
var typeMappings = {
|
|
117
|
+
directory: "isDirectory",
|
|
118
|
+
file: "isFile"
|
|
119
|
+
};
|
|
120
|
+
function checkType(type) {
|
|
121
|
+
if (Object.hasOwnProperty.call(typeMappings, type)) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
throw new Error(`Invalid type specified: ${type}`);
|
|
125
|
+
}
|
|
126
|
+
var matchType = (type, stat) => stat[typeMappings[type]]();
|
|
127
|
+
var toPath = (urlOrPath) => urlOrPath instanceof URL ? (0, import_node_url.fileURLToPath)(urlOrPath) : urlOrPath;
|
|
128
|
+
function locatePathSync(paths, {
|
|
129
|
+
cwd = import_node_process.default.cwd(),
|
|
130
|
+
type = "file",
|
|
131
|
+
allowSymlinks = true
|
|
132
|
+
} = {}) {
|
|
133
|
+
checkType(type);
|
|
134
|
+
cwd = toPath(cwd);
|
|
135
|
+
const statFunction = allowSymlinks ? import_node_fs.default.statSync : import_node_fs.default.lstatSync;
|
|
136
|
+
for (const path_ of paths) {
|
|
137
|
+
try {
|
|
138
|
+
const stat = statFunction(import_node_path.default.resolve(cwd, path_), {
|
|
139
|
+
throwIfNoEntry: false
|
|
140
|
+
});
|
|
141
|
+
if (!stat) {
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
if (matchType(type, stat)) {
|
|
145
|
+
return path_;
|
|
146
|
+
}
|
|
147
|
+
} catch {
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// node_modules/.pnpm/unicorn-magic@0.1.0/node_modules/unicorn-magic/node.js
|
|
153
|
+
var import_node_url2 = require("url");
|
|
154
|
+
function toPath2(urlOrPath) {
|
|
155
|
+
return urlOrPath instanceof URL ? (0, import_node_url2.fileURLToPath)(urlOrPath) : urlOrPath;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// node_modules/.pnpm/path-exists@5.0.0/node_modules/path-exists/index.js
|
|
159
|
+
var import_node_fs2 = __toESM(require("fs"), 1);
|
|
160
|
+
|
|
161
|
+
// node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
|
|
162
|
+
var findUpStop = Symbol("findUpStop");
|
|
163
|
+
function findUpMultipleSync(name, options = {}) {
|
|
164
|
+
let directory = import_node_path2.default.resolve(toPath2(options.cwd) ?? "");
|
|
165
|
+
const { root } = import_node_path2.default.parse(directory);
|
|
166
|
+
const stopAt = import_node_path2.default.resolve(directory, toPath2(options.stopAt) ?? root);
|
|
167
|
+
const limit = options.limit ?? Number.POSITIVE_INFINITY;
|
|
168
|
+
const paths = [name].flat();
|
|
169
|
+
const runMatcher = (locateOptions) => {
|
|
170
|
+
if (typeof name !== "function") {
|
|
171
|
+
return locatePathSync(paths, locateOptions);
|
|
172
|
+
}
|
|
173
|
+
const foundPath = name(locateOptions.cwd);
|
|
174
|
+
if (typeof foundPath === "string") {
|
|
175
|
+
return locatePathSync([foundPath], locateOptions);
|
|
176
|
+
}
|
|
177
|
+
return foundPath;
|
|
178
|
+
};
|
|
179
|
+
const matches = [];
|
|
180
|
+
while (true) {
|
|
181
|
+
const foundPath = runMatcher({ ...options, cwd: directory });
|
|
182
|
+
if (foundPath === findUpStop) {
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
if (foundPath) {
|
|
186
|
+
matches.push(import_node_path2.default.resolve(directory, foundPath));
|
|
187
|
+
}
|
|
188
|
+
if (directory === stopAt || matches.length >= limit) {
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
191
|
+
directory = import_node_path2.default.dirname(directory);
|
|
192
|
+
}
|
|
193
|
+
return matches;
|
|
194
|
+
}
|
|
195
|
+
function findUpSync(name, options = {}) {
|
|
196
|
+
const matches = findUpMultipleSync(name, { ...options, limit: 1 });
|
|
197
|
+
return matches[0];
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// src/configs/gitignore.ts
|
|
101
201
|
var import_utils = require("@lntvow/utils");
|
|
102
202
|
var import_parse_gitignore = __toESM(require("parse-gitignore"), 1);
|
|
103
203
|
async function gitignore(options) {
|
|
104
|
-
const { name = ".gitignore", root = false, files: _files = root ? name :
|
|
204
|
+
const { name = ".gitignore", root = false, files: _files = root ? name : findUpSync(name) || [] } = options;
|
|
105
205
|
const files = (0, import_utils.castArray)(_files);
|
|
106
206
|
const ignores2 = [];
|
|
107
207
|
for (const file of files) {
|
|
@@ -519,21 +619,6 @@ async function test(options = {}) {
|
|
|
519
619
|
// src/configs/typescript.ts
|
|
520
620
|
var import_eslint_plugin3 = __toESM(require("@typescript-eslint/eslint-plugin"), 1);
|
|
521
621
|
var import_parser = __toESM(require("@typescript-eslint/parser"), 1);
|
|
522
|
-
|
|
523
|
-
// src/utils/index.ts
|
|
524
|
-
function renameRules(rules, map) {
|
|
525
|
-
return Object.fromEntries(
|
|
526
|
-
Object.entries(rules).map(([key, value]) => {
|
|
527
|
-
for (const [from, to] of Object.entries(map)) {
|
|
528
|
-
if (key.startsWith(`${from}/`))
|
|
529
|
-
return [to + key.slice(from.length), value];
|
|
530
|
-
}
|
|
531
|
-
return [key, value];
|
|
532
|
-
})
|
|
533
|
-
);
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
// src/configs/typescript.ts
|
|
537
622
|
async function typescript(options = {}) {
|
|
538
623
|
const { componentExts = [], overrides = {}, parserOptions = {} } = options;
|
|
539
624
|
const files = [GLOB_SRC, ...componentExts.map((ext) => `**/*.${ext}`)];
|
|
@@ -876,6 +961,9 @@ function getVueVersion() {
|
|
|
876
961
|
}
|
|
877
962
|
|
|
878
963
|
// src/factory.ts
|
|
964
|
+
var import_eslint_flat_config_utils = require("eslint-flat-config-utils");
|
|
965
|
+
var import_utils3 = require("@lntvow/utils");
|
|
966
|
+
var import_local_pkg2 = require("local-pkg");
|
|
879
967
|
var flatConfigProps = [
|
|
880
968
|
"name",
|
|
881
969
|
"files",
|
|
@@ -963,9 +1051,6 @@ function lntvow(options = {}, ...userConfigs) {
|
|
|
963
1051
|
function resolveSubOptions(options, key) {
|
|
964
1052
|
return (0, import_utils3.isBoolean)(options[key]) ? {} : options[key] || {};
|
|
965
1053
|
}
|
|
966
|
-
|
|
967
|
-
// src/index.ts
|
|
968
|
-
var src_default = lntvow;
|
|
969
1054
|
// Annotate the CommonJS export names for ESM import in node:
|
|
970
1055
|
0 && (module.exports = {
|
|
971
1056
|
GLOB_ALL_SRC,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,30 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AnyObject } from '@lntvow/utils';
|
|
2
2
|
import { Linter } from 'eslint';
|
|
3
3
|
import { ParserOptions } from '@typescript-eslint/parser';
|
|
4
4
|
import { StylisticCustomizeOptions } from '@stylistic/eslint-plugin';
|
|
5
|
-
import {
|
|
5
|
+
import { FlatConfigComposer } from 'eslint-flat-config-utils';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Rename plugin prefixes in a rule object.
|
|
9
|
+
* Accepts a map of prefixes to rename.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { renameRules } from '@lntvow/eslint-config'
|
|
14
|
+
*
|
|
15
|
+
* export default [{
|
|
16
|
+
* rules: renameRules(
|
|
17
|
+
* {
|
|
18
|
+
* '@typescript-eslint/indent': 'error'
|
|
19
|
+
* },
|
|
20
|
+
* { '@typescript-eslint': 'ts' }
|
|
21
|
+
* )
|
|
22
|
+
* }]
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
declare function renameRules(rules: AnyObject, map: Record<string, string>): {
|
|
26
|
+
[k: string]: any;
|
|
27
|
+
};
|
|
6
28
|
|
|
7
29
|
/* eslint-disable */
|
|
8
30
|
/* prettier-ignore */
|
|
@@ -15219,30 +15241,6 @@ interface OptionsConfig extends OptionsComponentExts {
|
|
|
15219
15241
|
autoRenamePlugins?: boolean;
|
|
15220
15242
|
}
|
|
15221
15243
|
|
|
15222
|
-
declare function lntvow(options?: OptionsConfig & TypedFlatConfigItem, ...userConfigs: Awaitable<TypedFlatConfigItem>[]): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
|
|
15223
|
-
|
|
15224
|
-
/**
|
|
15225
|
-
* Rename plugin prefixes in a rule object.
|
|
15226
|
-
* Accepts a map of prefixes to rename.
|
|
15227
|
-
*
|
|
15228
|
-
* @example
|
|
15229
|
-
* ```ts
|
|
15230
|
-
* import { renameRules } from '@lntvow/eslint-config'
|
|
15231
|
-
*
|
|
15232
|
-
* export default [{
|
|
15233
|
-
* rules: renameRules(
|
|
15234
|
-
* {
|
|
15235
|
-
* '@typescript-eslint/indent': 'error'
|
|
15236
|
-
* },
|
|
15237
|
-
* { '@typescript-eslint': 'ts' }
|
|
15238
|
-
* )
|
|
15239
|
-
* }]
|
|
15240
|
-
* ```
|
|
15241
|
-
*/
|
|
15242
|
-
declare function renameRules(rules: AnyObject, map: Record<string, string>): {
|
|
15243
|
-
[k: string]: any;
|
|
15244
|
-
};
|
|
15245
|
-
|
|
15246
15244
|
declare function custom(): Promise<TypedFlatConfigItem[]>;
|
|
15247
15245
|
|
|
15248
15246
|
declare function gitignore(options: FlatGitignoreOptions): Promise<TypedFlatConfigItem[]>;
|
|
@@ -15296,4 +15294,6 @@ declare const GLOB_TESTS: string[];
|
|
|
15296
15294
|
declare const GLOB_ALL_SRC: string[];
|
|
15297
15295
|
declare const GLOB_EXCLUDE: string[];
|
|
15298
15296
|
|
|
15299
|
-
|
|
15297
|
+
declare function lntvow(options?: OptionsConfig & TypedFlatConfigItem, ...userConfigs: Awaitable<TypedFlatConfigItem>[]): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
|
|
15298
|
+
|
|
15299
|
+
export { GLOB_ALL_SRC, GLOB_ASTRO, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, StylisticConfigDefaults, custom, getVueVersion, gitignore, ignores, imports, javascript, lntvow, prettier, regexp, renameRules, stylistic, test, typescript, vue };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,30 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AnyObject } from '@lntvow/utils';
|
|
2
2
|
import { Linter } from 'eslint';
|
|
3
3
|
import { ParserOptions } from '@typescript-eslint/parser';
|
|
4
4
|
import { StylisticCustomizeOptions } from '@stylistic/eslint-plugin';
|
|
5
|
-
import {
|
|
5
|
+
import { FlatConfigComposer } from 'eslint-flat-config-utils';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Rename plugin prefixes in a rule object.
|
|
9
|
+
* Accepts a map of prefixes to rename.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { renameRules } from '@lntvow/eslint-config'
|
|
14
|
+
*
|
|
15
|
+
* export default [{
|
|
16
|
+
* rules: renameRules(
|
|
17
|
+
* {
|
|
18
|
+
* '@typescript-eslint/indent': 'error'
|
|
19
|
+
* },
|
|
20
|
+
* { '@typescript-eslint': 'ts' }
|
|
21
|
+
* )
|
|
22
|
+
* }]
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
declare function renameRules(rules: AnyObject, map: Record<string, string>): {
|
|
26
|
+
[k: string]: any;
|
|
27
|
+
};
|
|
6
28
|
|
|
7
29
|
/* eslint-disable */
|
|
8
30
|
/* prettier-ignore */
|
|
@@ -15219,30 +15241,6 @@ interface OptionsConfig extends OptionsComponentExts {
|
|
|
15219
15241
|
autoRenamePlugins?: boolean;
|
|
15220
15242
|
}
|
|
15221
15243
|
|
|
15222
|
-
declare function lntvow(options?: OptionsConfig & TypedFlatConfigItem, ...userConfigs: Awaitable<TypedFlatConfigItem>[]): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
|
|
15223
|
-
|
|
15224
|
-
/**
|
|
15225
|
-
* Rename plugin prefixes in a rule object.
|
|
15226
|
-
* Accepts a map of prefixes to rename.
|
|
15227
|
-
*
|
|
15228
|
-
* @example
|
|
15229
|
-
* ```ts
|
|
15230
|
-
* import { renameRules } from '@lntvow/eslint-config'
|
|
15231
|
-
*
|
|
15232
|
-
* export default [{
|
|
15233
|
-
* rules: renameRules(
|
|
15234
|
-
* {
|
|
15235
|
-
* '@typescript-eslint/indent': 'error'
|
|
15236
|
-
* },
|
|
15237
|
-
* { '@typescript-eslint': 'ts' }
|
|
15238
|
-
* )
|
|
15239
|
-
* }]
|
|
15240
|
-
* ```
|
|
15241
|
-
*/
|
|
15242
|
-
declare function renameRules(rules: AnyObject, map: Record<string, string>): {
|
|
15243
|
-
[k: string]: any;
|
|
15244
|
-
};
|
|
15245
|
-
|
|
15246
15244
|
declare function custom(): Promise<TypedFlatConfigItem[]>;
|
|
15247
15245
|
|
|
15248
15246
|
declare function gitignore(options: FlatGitignoreOptions): Promise<TypedFlatConfigItem[]>;
|
|
@@ -15296,4 +15294,6 @@ declare const GLOB_TESTS: string[];
|
|
|
15296
15294
|
declare const GLOB_ALL_SRC: string[];
|
|
15297
15295
|
declare const GLOB_EXCLUDE: string[];
|
|
15298
15296
|
|
|
15299
|
-
|
|
15297
|
+
declare function lntvow(options?: OptionsConfig & TypedFlatConfigItem, ...userConfigs: Awaitable<TypedFlatConfigItem>[]): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
|
|
15298
|
+
|
|
15299
|
+
export { GLOB_ALL_SRC, GLOB_ASTRO, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, StylisticConfigDefaults, custom, getVueVersion, gitignore, ignores, imports, javascript, lntvow, prettier, regexp, renameRules, stylistic, test, typescript, vue };
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
// src/
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
// src/utils/index.ts
|
|
2
|
+
function renameRules(rules, map) {
|
|
3
|
+
return Object.fromEntries(
|
|
4
|
+
Object.entries(rules).map(([key, value]) => {
|
|
5
|
+
for (const [from, to] of Object.entries(map)) {
|
|
6
|
+
if (key.startsWith(`${from}/`))
|
|
7
|
+
return [to + key.slice(from.length), value];
|
|
8
|
+
}
|
|
9
|
+
return [key, value];
|
|
10
|
+
})
|
|
11
|
+
);
|
|
12
|
+
}
|
|
5
13
|
|
|
6
14
|
// src/configs/custom.ts
|
|
7
15
|
import lntvowPlugin from "@lntvow/eslint-plugin";
|
|
@@ -17,8 +25,98 @@ async function custom() {
|
|
|
17
25
|
}
|
|
18
26
|
|
|
19
27
|
// src/configs/gitignore.ts
|
|
20
|
-
import
|
|
21
|
-
|
|
28
|
+
import fs2 from "fs";
|
|
29
|
+
|
|
30
|
+
// node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
|
|
31
|
+
import path2 from "node:path";
|
|
32
|
+
|
|
33
|
+
// node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
|
|
34
|
+
import process2 from "node:process";
|
|
35
|
+
import path from "node:path";
|
|
36
|
+
import fs, { promises as fsPromises } from "node:fs";
|
|
37
|
+
import { fileURLToPath } from "node:url";
|
|
38
|
+
var typeMappings = {
|
|
39
|
+
directory: "isDirectory",
|
|
40
|
+
file: "isFile"
|
|
41
|
+
};
|
|
42
|
+
function checkType(type) {
|
|
43
|
+
if (Object.hasOwnProperty.call(typeMappings, type)) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
throw new Error(`Invalid type specified: ${type}`);
|
|
47
|
+
}
|
|
48
|
+
var matchType = (type, stat) => stat[typeMappings[type]]();
|
|
49
|
+
var toPath = (urlOrPath) => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;
|
|
50
|
+
function locatePathSync(paths, {
|
|
51
|
+
cwd = process2.cwd(),
|
|
52
|
+
type = "file",
|
|
53
|
+
allowSymlinks = true
|
|
54
|
+
} = {}) {
|
|
55
|
+
checkType(type);
|
|
56
|
+
cwd = toPath(cwd);
|
|
57
|
+
const statFunction = allowSymlinks ? fs.statSync : fs.lstatSync;
|
|
58
|
+
for (const path_ of paths) {
|
|
59
|
+
try {
|
|
60
|
+
const stat = statFunction(path.resolve(cwd, path_), {
|
|
61
|
+
throwIfNoEntry: false
|
|
62
|
+
});
|
|
63
|
+
if (!stat) {
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
if (matchType(type, stat)) {
|
|
67
|
+
return path_;
|
|
68
|
+
}
|
|
69
|
+
} catch {
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// node_modules/.pnpm/unicorn-magic@0.1.0/node_modules/unicorn-magic/node.js
|
|
75
|
+
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
76
|
+
function toPath2(urlOrPath) {
|
|
77
|
+
return urlOrPath instanceof URL ? fileURLToPath2(urlOrPath) : urlOrPath;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
|
|
81
|
+
var findUpStop = Symbol("findUpStop");
|
|
82
|
+
function findUpMultipleSync(name, options = {}) {
|
|
83
|
+
let directory = path2.resolve(toPath2(options.cwd) ?? "");
|
|
84
|
+
const { root } = path2.parse(directory);
|
|
85
|
+
const stopAt = path2.resolve(directory, toPath2(options.stopAt) ?? root);
|
|
86
|
+
const limit = options.limit ?? Number.POSITIVE_INFINITY;
|
|
87
|
+
const paths = [name].flat();
|
|
88
|
+
const runMatcher = (locateOptions) => {
|
|
89
|
+
if (typeof name !== "function") {
|
|
90
|
+
return locatePathSync(paths, locateOptions);
|
|
91
|
+
}
|
|
92
|
+
const foundPath = name(locateOptions.cwd);
|
|
93
|
+
if (typeof foundPath === "string") {
|
|
94
|
+
return locatePathSync([foundPath], locateOptions);
|
|
95
|
+
}
|
|
96
|
+
return foundPath;
|
|
97
|
+
};
|
|
98
|
+
const matches = [];
|
|
99
|
+
while (true) {
|
|
100
|
+
const foundPath = runMatcher({ ...options, cwd: directory });
|
|
101
|
+
if (foundPath === findUpStop) {
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
if (foundPath) {
|
|
105
|
+
matches.push(path2.resolve(directory, foundPath));
|
|
106
|
+
}
|
|
107
|
+
if (directory === stopAt || matches.length >= limit) {
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
directory = path2.dirname(directory);
|
|
111
|
+
}
|
|
112
|
+
return matches;
|
|
113
|
+
}
|
|
114
|
+
function findUpSync(name, options = {}) {
|
|
115
|
+
const matches = findUpMultipleSync(name, { ...options, limit: 1 });
|
|
116
|
+
return matches[0];
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// src/configs/gitignore.ts
|
|
22
120
|
import { castArray } from "@lntvow/utils";
|
|
23
121
|
import parse from "parse-gitignore";
|
|
24
122
|
async function gitignore(options) {
|
|
@@ -27,7 +125,7 @@ async function gitignore(options) {
|
|
|
27
125
|
const ignores2 = [];
|
|
28
126
|
for (const file of files) {
|
|
29
127
|
try {
|
|
30
|
-
const content =
|
|
128
|
+
const content = fs2.readFileSync(file, "utf8");
|
|
31
129
|
const globs = parse(content).globs();
|
|
32
130
|
for (const glob of globs) {
|
|
33
131
|
if (glob.type === "ignore") {
|
|
@@ -440,21 +538,6 @@ async function test(options = {}) {
|
|
|
440
538
|
// src/configs/typescript.ts
|
|
441
539
|
import pluginTs from "@typescript-eslint/eslint-plugin";
|
|
442
540
|
import tsParser from "@typescript-eslint/parser";
|
|
443
|
-
|
|
444
|
-
// src/utils/index.ts
|
|
445
|
-
function renameRules(rules, map) {
|
|
446
|
-
return Object.fromEntries(
|
|
447
|
-
Object.entries(rules).map(([key, value]) => {
|
|
448
|
-
for (const [from, to] of Object.entries(map)) {
|
|
449
|
-
if (key.startsWith(`${from}/`))
|
|
450
|
-
return [to + key.slice(from.length), value];
|
|
451
|
-
}
|
|
452
|
-
return [key, value];
|
|
453
|
-
})
|
|
454
|
-
);
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
// src/configs/typescript.ts
|
|
458
541
|
async function typescript(options = {}) {
|
|
459
542
|
const { componentExts = [], overrides = {}, parserOptions = {} } = options;
|
|
460
543
|
const files = [GLOB_SRC, ...componentExts.map((ext) => `**/*.${ext}`)];
|
|
@@ -797,6 +880,9 @@ function getVueVersion() {
|
|
|
797
880
|
}
|
|
798
881
|
|
|
799
882
|
// src/factory.ts
|
|
883
|
+
import { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
884
|
+
import { isBoolean } from "@lntvow/utils";
|
|
885
|
+
import { isPackageExists } from "local-pkg";
|
|
800
886
|
var flatConfigProps = [
|
|
801
887
|
"name",
|
|
802
888
|
"files",
|
|
@@ -884,9 +970,6 @@ function lntvow(options = {}, ...userConfigs) {
|
|
|
884
970
|
function resolveSubOptions(options, key) {
|
|
885
971
|
return isBoolean(options[key]) ? {} : options[key] || {};
|
|
886
972
|
}
|
|
887
|
-
|
|
888
|
-
// src/index.ts
|
|
889
|
-
var src_default = lntvow;
|
|
890
973
|
export {
|
|
891
974
|
GLOB_ALL_SRC,
|
|
892
975
|
GLOB_ASTRO,
|
|
@@ -918,7 +1001,6 @@ export {
|
|
|
918
1001
|
GLOB_YAML,
|
|
919
1002
|
StylisticConfigDefaults,
|
|
920
1003
|
custom,
|
|
921
|
-
src_default as default,
|
|
922
1004
|
getVueVersion,
|
|
923
1005
|
gitignore,
|
|
924
1006
|
ignores,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lntvow/eslint-config",
|
|
3
|
-
"version": "9.3.
|
|
3
|
+
"version": "9.3.12",
|
|
4
4
|
"author": "lntvow",
|
|
5
5
|
"description": "eslint-config",
|
|
6
6
|
"type": "module",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"type": "git",
|
|
21
21
|
"url": "https://github.com/lntvow/eslint-config.git"
|
|
22
22
|
},
|
|
23
|
-
"main": "./dist/index.
|
|
24
|
-
"module": "./dist/index.
|
|
23
|
+
"main": "./dist/index.cjs",
|
|
24
|
+
"module": "./dist/index.mjs",
|
|
25
25
|
"types": "./dist/index.d.ts",
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@lntvow/dev": "^1.1.0",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"tslib": "^2.6.2",
|
|
55
55
|
"typescript": "^5.4.5",
|
|
56
56
|
"vue-eslint-parser": "^9.4.2",
|
|
57
|
-
"@lntvow/eslint-plugin": "^9.3.
|
|
57
|
+
"@lntvow/eslint-plugin": "^9.3.12"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|
|
60
60
|
"dev": "pnpm build --format esm --watch",
|