@daopk/eslint-config 0.3.0 → 0.5.0
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.mts +7 -0
- package/dist/index.mjs +3 -0
- package/dist/presets/nestjs.d.mts +6 -0
- package/dist/presets/nestjs.mjs +20 -0
- package/dist/{index.js → src-BEal04_4.mjs} +9 -18
- package/dist/{index.d.ts → types-BBjqzb35.d.mts} +3307 -809
- package/dist/vue-A9YP-IN_.mjs +20 -0
- package/package.json +25 -18
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { n as Options, t as LinterConfig } from "./types-BBjqzb35.mjs";
|
|
2
|
+
import { Linter } from "eslint";
|
|
3
|
+
|
|
4
|
+
//#region src/index.d.ts
|
|
5
|
+
declare function daopk(options?: Options, ...userConfigs: Linter.Config[]): Promise<LinterConfig[]>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { daopk as default };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { t as daopk } from "../src-BEal04_4.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/presets/nestjs.ts
|
|
4
|
+
async function presetNestjs(options = {}) {
|
|
5
|
+
return daopk({
|
|
6
|
+
stylistic: {
|
|
7
|
+
semi: true,
|
|
8
|
+
jsx: false,
|
|
9
|
+
...options.stylistic
|
|
10
|
+
},
|
|
11
|
+
rules: {
|
|
12
|
+
"typescript/consistent-type-imports": ["warn", { prefer: "no-type-imports" }],
|
|
13
|
+
...options.rules
|
|
14
|
+
},
|
|
15
|
+
...options
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { presetNestjs };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isPackageExists } from "local-pkg";
|
|
1
2
|
import antfuPlugin from "eslint-plugin-antfu";
|
|
2
3
|
import gitignore from "eslint-config-flat-gitignore";
|
|
3
4
|
import importX from "eslint-plugin-import-x";
|
|
@@ -184,27 +185,16 @@ function typescript({ rules } = {}) {
|
|
|
184
185
|
}
|
|
185
186
|
|
|
186
187
|
//#endregion
|
|
187
|
-
//#region src/
|
|
188
|
-
function
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
builtin(),
|
|
192
|
-
stylistic({
|
|
193
|
-
semi: true,
|
|
194
|
-
jsx: false,
|
|
195
|
-
...options.stylistic
|
|
196
|
-
}),
|
|
197
|
-
typescript({ rules: { "typescript/consistent-type-imports": ["warn", { prefer: "no-type-imports" }] } }),
|
|
198
|
-
imports(),
|
|
199
|
-
antfu(),
|
|
200
|
-
node(),
|
|
201
|
-
perfectionist()
|
|
202
|
-
];
|
|
188
|
+
//#region src/utils.ts
|
|
189
|
+
async function interopDefault(m) {
|
|
190
|
+
const resolved = await m;
|
|
191
|
+
return resolved.default || resolved;
|
|
203
192
|
}
|
|
204
193
|
|
|
205
194
|
//#endregion
|
|
206
195
|
//#region src/index.ts
|
|
207
|
-
function daopk(options = {}, ...userConfigs) {
|
|
196
|
+
async function daopk(options = {}, ...userConfigs) {
|
|
197
|
+
const { vue: enableVue = isPackageExists("vue") } = options;
|
|
208
198
|
const configs = [
|
|
209
199
|
ignores(options.ignores),
|
|
210
200
|
builtin(),
|
|
@@ -215,6 +205,7 @@ function daopk(options = {}, ...userConfigs) {
|
|
|
215
205
|
node(),
|
|
216
206
|
perfectionist()
|
|
217
207
|
];
|
|
208
|
+
if (enableVue) configs.push(...await interopDefault((await import("./vue-A9YP-IN_.mjs")).vue()));
|
|
218
209
|
if (options.rules) configs.push({
|
|
219
210
|
name: "daopk/rules",
|
|
220
211
|
rules: { ...options.rules }
|
|
@@ -224,4 +215,4 @@ function daopk(options = {}, ...userConfigs) {
|
|
|
224
215
|
}
|
|
225
216
|
|
|
226
217
|
//#endregion
|
|
227
|
-
export { daopk as
|
|
218
|
+
export { daopk as t };
|