@daopk/eslint-config 0.4.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.
@@ -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,3 @@
1
+ import { t as daopk } from "./src-BEal04_4.mjs";
2
+
3
+ export { daopk as default };
@@ -0,0 +1,6 @@
1
+ import { n as Options, t as LinterConfig } from "../types-BBjqzb35.mjs";
2
+
3
+ //#region src/presets/nestjs.d.ts
4
+ declare function presetNestjs(options?: Options): Promise<LinterConfig[]>;
5
+ //#endregion
6
+ export { presetNestjs };
@@ -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 };
@@ -8,8 +8,6 @@ import perfectionistPlugin from "eslint-plugin-perfectionist";
8
8
  import stylisticPlugin from "@stylistic/eslint-plugin";
9
9
  import typescriptPlugin from "@typescript-eslint/eslint-plugin";
10
10
  import tsParser from "@typescript-eslint/parser";
11
- import vuePlugin from "eslint-plugin-vue";
12
- import globals from "globals";
13
11
 
14
12
  //#region src/configs/antfu.ts
15
13
  function antfu() {
@@ -187,42 +185,15 @@ function typescript({ rules } = {}) {
187
185
  }
188
186
 
189
187
  //#endregion
190
- //#region src/configs/vue.ts
191
- function vue() {
192
- return [...vuePlugin.configs["flat/recommended"], {
193
- name: "daopk/vue",
194
- files: ["**/*.vue"],
195
- languageOptions: {
196
- ecmaVersion: "latest",
197
- sourceType: "module",
198
- globals: globals.browser,
199
- parserOptions: { parser: tsParser }
200
- }
201
- }];
202
- }
203
-
204
- //#endregion
205
- //#region src/presets/nestjs.ts
206
- function presetNestjs(options = {}) {
207
- return [
208
- ignores(options.ignores),
209
- builtin(),
210
- stylistic({
211
- semi: true,
212
- jsx: false,
213
- ...options.stylistic
214
- }),
215
- typescript({ rules: { "typescript/consistent-type-imports": ["warn", { prefer: "no-type-imports" }] } }),
216
- imports(),
217
- antfu(),
218
- node(),
219
- perfectionist()
220
- ];
188
+ //#region src/utils.ts
189
+ async function interopDefault(m) {
190
+ const resolved = await m;
191
+ return resolved.default || resolved;
221
192
  }
222
193
 
223
194
  //#endregion
224
195
  //#region src/index.ts
225
- function daopk(options = {}, ...userConfigs) {
196
+ async function daopk(options = {}, ...userConfigs) {
226
197
  const { vue: enableVue = isPackageExists("vue") } = options;
227
198
  const configs = [
228
199
  ignores(options.ignores),
@@ -234,7 +205,7 @@ function daopk(options = {}, ...userConfigs) {
234
205
  node(),
235
206
  perfectionist()
236
207
  ];
237
- if (enableVue) configs.push(...vue());
208
+ if (enableVue) configs.push(...await interopDefault((await import("./vue-A9YP-IN_.mjs")).vue()));
238
209
  if (options.rules) configs.push({
239
210
  name: "daopk/rules",
240
211
  rules: { ...options.rules }
@@ -244,4 +215,4 @@ function daopk(options = {}, ...userConfigs) {
244
215
  }
245
216
 
246
217
  //#endregion
247
- export { daopk as default, presetNestjs };
218
+ export { daopk as t };
@@ -11713,10 +11713,4 @@ type LinterConfig = Omit<Linter.Config, 'plugins'> & {
11713
11713
  plugins?: Record<string, any>;
11714
11714
  };
11715
11715
  //#endregion
11716
- //#region src/presets/nestjs.d.ts
11717
- declare function presetNestjs(options?: Options): LinterConfig[];
11718
- //#endregion
11719
- //#region src/index.d.ts
11720
- declare function daopk(options?: Options, ...userConfigs: Linter.Config[]): LinterConfig[];
11721
- //#endregion
11722
- export { daopk as default, presetNestjs };
11716
+ export { Options as n, LinterConfig as t };
@@ -0,0 +1,20 @@
1
+ import tsParser from "@typescript-eslint/parser";
2
+ import vuePlugin from "eslint-plugin-vue";
3
+ import globals from "globals";
4
+
5
+ //#region src/configs/vue.ts
6
+ function vue() {
7
+ return [...vuePlugin.configs["flat/recommended"], {
8
+ name: "daopk/vue",
9
+ files: ["**/*.vue"],
10
+ languageOptions: {
11
+ ecmaVersion: "latest",
12
+ sourceType: "module",
13
+ globals: globals.browser,
14
+ parserOptions: { parser: tsParser }
15
+ }
16
+ }];
17
+ }
18
+
19
+ //#endregion
20
+ export { vue };
package/package.json CHANGED
@@ -1,21 +1,25 @@
1
1
  {
2
2
  "name": "@daopk/eslint-config",
3
3
  "type": "module",
4
- "version": "0.4.0",
4
+ "version": "0.5.0",
5
5
  "license": "ISC",
6
6
  "repository": "github:daopk/eslint-config",
7
7
  "exports": {
8
- ".": "./dist/index.js"
8
+ ".": "./dist/index.mjs",
9
+ "./nestjs": {
10
+ "import": "./dist/presets/nestjs.mjs",
11
+ "types": "./dist/presets/nestjs.d.mts"
12
+ }
9
13
  },
10
- "main": "./dist/index.js",
11
- "types": "./dist/index.d.ts",
14
+ "main": "./dist/index.mjs",
15
+ "types": "./dist/index.d.mts",
12
16
  "files": [
13
17
  "dist"
14
18
  ],
15
19
  "dependencies": {
16
20
  "@stylistic/eslint-plugin": "^5.5.0",
17
- "@typescript-eslint/eslint-plugin": "^8.46.3",
18
- "@typescript-eslint/parser": "^8.46.3",
21
+ "@typescript-eslint/eslint-plugin": "^8.46.4",
22
+ "@typescript-eslint/parser": "^8.46.4",
19
23
  "eslint-config-flat-gitignore": "^2.1.0",
20
24
  "eslint-plugin-antfu": "^3.1.1",
21
25
  "eslint-plugin-import-x": "^4.16.1",
@@ -28,12 +32,12 @@
28
32
  },
29
33
  "devDependencies": {
30
34
  "@eslint/config-inspector": "^1.3.0",
31
- "@types/node": "^24.10.0",
35
+ "@types/node": "^24.10.1",
32
36
  "bumpp": "^10.3.1",
33
37
  "eslint": "^9.39.1",
34
38
  "eslint-typegen": "^2.3.0",
35
39
  "jiti": "^2.6.1",
36
- "tsdown": "^0.15.12",
40
+ "tsdown": "^0.16.3",
37
41
  "tsx": "^4.20.6",
38
42
  "typescript": "^5.9.3"
39
43
  },