@cuiqg/eslint-config 2.5.9 → 2.5.11

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.
@@ -1,8 +1,14 @@
1
1
  {
2
2
  "editor.formatOnSave": false,
3
- "eslint.format.enable": true,
4
3
  "editor.codeActionsOnSave": {
5
4
  "source.fixAll.eslint": "explicit",
6
5
  "source.organizeImports": "never"
7
- }
6
+ },
7
+ "eslint.runtime": "node",
8
+ "eslint.validate": [
9
+ "javascript",
10
+ "vue",
11
+ "html",
12
+ "jsonc"
13
+ ]
8
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuiqg/eslint-config",
3
- "version": "2.5.9",
3
+ "version": "2.5.11",
4
4
  "description": "Eslint config for @cuiqg",
5
5
  "keywords": [
6
6
  "eslint-config"
@@ -17,8 +17,7 @@
17
17
  "main": "./dist/index.mjs",
18
18
  "module": "./dist/index.mjs",
19
19
  "exports": {
20
- ".": "./dist/index.mjs",
21
- "./package.json": "./package.json"
20
+ ".": "./dist/index.mjs"
22
21
  },
23
22
  "devDependencies": {
24
23
  "@cuiqg/prettier-config": "latest",
@@ -40,10 +39,12 @@
40
39
  "eslint-config-prettier": "^10.1.8",
41
40
  "eslint-flat-config-utils": "^2.1.4",
42
41
  "eslint-plugin-compat": "^6.0.2",
42
+ "eslint-plugin-import": "^2.32.0",
43
43
  "eslint-plugin-jsdoc": "^61.4.1",
44
44
  "eslint-plugin-package-json": "^0.85.0",
45
45
  "eslint-plugin-perfectionist": "^4.15.1",
46
46
  "eslint-plugin-prettier": "^5.5.4",
47
+ "eslint-plugin-promise": "^7.2.1",
47
48
  "eslint-plugin-unicorn": "^62.0.0",
48
49
  "eslint-plugin-vue": "^10.6.2",
49
50
  "globals": "^16.5.0",
@@ -51,12 +52,13 @@
51
52
  "local-pkg": "^1.1.2",
52
53
  "vue-eslint-parser": "^10.2.0"
53
54
  },
55
+ "prettier": "@cuiqg/prettier-config",
54
56
  "scripts": {
55
57
  "build": "tsdown",
56
58
  "dev": "tsdown --watch",
57
- "build:inspect": "eslint-config-inspector build --config eslint-inspector.config.js",
59
+ "build:inspect": "pnpx @eslint/config-inspector build --config eslint-inspector.config.js",
58
60
  "lint": "eslint .",
59
- "lint:inspect": "eslint-config-inspector --open false --config eslint-inspector.config.js",
61
+ "lint:inspect": "pnpx @eslint/config-inspector --open false --config eslint-inspector.config.js",
60
62
  "release": "bumpp && pnpm publish"
61
63
  }
62
64
  }
@@ -1,5 +1,6 @@
1
1
  import { GLOB_EXCLUDE } from '../globs'
2
2
  import { interopDefault } from '../utils'
3
+
3
4
  export async function ignores() {
4
5
  const configGitignore = await interopDefault(import('eslint-config-flat-gitignore'))
5
6
 
@@ -0,0 +1,12 @@
1
+ import { interopDefault } from '../utils'
2
+
3
+ export async function imports() {
4
+ const pluginImport = await interopDefault(import('eslint-plugin-import'))
5
+
6
+ return [
7
+ {
8
+ ...pluginImport.flatConfigs.recommended,
9
+ name: 'cuiqg/imports'
10
+ }
11
+ ]
12
+ }
@@ -9,3 +9,5 @@ export * from './unocss'
9
9
  export * from './vue'
10
10
  export * from './compat'
11
11
  export * from './unicorn'
12
+ export * from './promise'
13
+ export * from './imports'
@@ -1,29 +1,16 @@
1
1
  import { interopDefault } from '../utils'
2
2
 
3
3
  export async function packageJson() {
4
- const [pluginPackageJson, parserJsonc] = await Promise.all([
5
- interopDefault(import('eslint-plugin-package-json')),
6
- interopDefault(import('jsonc-eslint-parser'))
7
- ])
4
+ const pluginPackageJson = await interopDefault(import('eslint-plugin-package-json'))
8
5
 
9
6
  return [
10
7
  {
11
- files: ['**/package.json'],
12
- languageOptions: {
13
- parser: parserJsonc
14
- },
15
- name: 'cuiqg/package-json',
16
- plugins: {
17
- 'package-json': pluginPackageJson
18
- },
8
+ ...pluginPackageJson.configs.recommended,
19
9
  rules: {
20
- ...pluginPackageJson.configs.recommended.rules
10
+ ...pluginPackageJson.configs.recommended.rules,
11
+ ...pluginPackageJson.configs.stylistic.rules
21
12
  },
22
- settings: {
23
- packageJson: {
24
- enforceForPrivate: false
25
- }
26
- }
13
+ name: 'cuiqg/package-json'
27
14
  }
28
15
  ]
29
16
  }
@@ -0,0 +1,12 @@
1
+ import { interopDefault } from '../utils'
2
+
3
+ export async function promise() {
4
+ const pluginPromise = await interopDefault(import('eslint-plugin-promise'))
5
+
6
+ return [
7
+ {
8
+ ...pluginPromise.configs['flat/recommended'],
9
+ name: 'cuiqg/promise'
10
+ }
11
+ ]
12
+ }
package/src/presets.js CHANGED
@@ -3,6 +3,7 @@ import { FlatConfigComposer } from 'eslint-flat-config-utils'
3
3
  import {
4
4
  compat,
5
5
  ignores,
6
+ imports,
6
7
  javascript,
7
8
  jsdoc,
8
9
  macros,
@@ -11,13 +12,15 @@ import {
11
12
  stylistic,
12
13
  unocss,
13
14
  vue,
14
- unicorn
15
+ unicorn,
16
+ promise
15
17
  } from './configs'
16
18
 
17
19
  import { hasUnoCss, hasVue } from './env'
18
20
 
19
21
  export const defaultPluginRenaming = {
20
- '@stylistic': 'style'
22
+ '@stylistic': 'style',
23
+ '@typescript-eslint': 'ts'
21
24
  }
22
25
 
23
26
  /**
@@ -42,10 +45,12 @@ export function cuiqg(
42
45
  compat(),
43
46
  ignores(),
44
47
  javascript(),
48
+ imports(),
45
49
  jsdoc(),
46
50
  stylistic(),
47
51
  packageJson(),
48
- unicorn()
52
+ unicorn(),
53
+ promise()
49
54
  )
50
55
 
51
56
  if (enableVue) {
package/tsdown.config.js CHANGED
@@ -1,9 +1,18 @@
1
1
  import { defineConfig } from 'tsdown'
2
-
2
+ import { spawn } from 'node:child_process'
3
3
  export default defineConfig({
4
4
  entry: 'src/index.js',
5
5
  clean: true,
6
6
  shims: true,
7
7
  format: ['esm'],
8
- exports: true
8
+ hooks: {
9
+ 'build:done': async (args) => {
10
+ if (args.options?.watch) {
11
+ spawn('pnpx', ['@eslint/config-inspector', '--open', 'false', '--config', 'eslint-inspector.config.js'], {
12
+ stdio: 'inherit',
13
+ shell: true
14
+ })
15
+ }
16
+ }
17
+ }
9
18
  })