@ithinkdt/lint 4.0.0-0 → 4.0.0-2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ithinkdt/lint",
3
- "version": "4.0.0-0",
3
+ "version": "4.0.0-2",
4
4
  "type": "module",
5
5
  "description": "iThinkDT Cloud Lint",
6
6
  "keywords": [
@@ -37,17 +37,16 @@
37
37
  },
38
38
  "sideEffects": false,
39
39
  "dependencies": {
40
- "@eslint/compat": "^1.1.0",
41
- "@eslint/eslintrc": "^3.1.0",
40
+ "@eslint/compat": "^1.1.1",
42
41
  "@typescript-eslint/parser": "^8.0.0-alpha.41",
43
42
  "@vue/compiler-sfc": "^3.4.31",
43
+ "eslint-import-resolver-custom-alias": "^1.3.2",
44
+ "eslint-import-resolver-typescript": "^3.6.1",
45
+ "eslint-plugin-deprecation": "^3.0.0",
46
+ "eslint-plugin-import": "npm:eslint-plugin-import-x@^3.0.1",
44
47
  "eslint-plugin-tsdoc": "^0.3.0",
45
48
  "eslint-plugin-unicorn": "^54.0.0",
46
49
  "eslint-plugin-vue": "^9.27.0",
47
- "eslint-plugin-deprecation": "^3.0.0",
48
- "eslint-plugin-import": "npm:eslint-plugin-import-x@^3.0.1",
49
- "eslint-import-resolver-typescript": "^3.6.1",
50
- "eslint-import-resolver-custom-alias": "^1.3.2",
51
50
  "globby": "^14.0.2",
52
51
  "is-glob": "^4.0.3",
53
52
  "postcss": "^8.4.39",
package/pnpm-lock.yaml CHANGED
@@ -12,11 +12,8 @@ importers:
12
12
  .:
13
13
  dependencies:
14
14
  '@eslint/compat':
15
- specifier: ^1.1.0
15
+ specifier: ^1.1.1
16
16
  version: 1.1.1
17
- '@eslint/eslintrc':
18
- specifier: ^3.1.0
19
- version: 3.1.0
20
17
  '@typescript-eslint/parser':
21
18
  specifier: ^8.0.0-alpha.41
22
19
  version: 8.0.0-alpha.41(eslint@9.6.0)(typescript@5.5.3)
package/src/base.js CHANGED
@@ -1,3 +1,5 @@
1
+ import { env } from 'node:process'
2
+
1
3
  import { fixupPluginRules } from '@eslint/compat'
2
4
  import { config as tsconfig, configs as tsconfigs } from 'typescript-eslint'
3
5
 
@@ -16,12 +18,13 @@ export const disableJsTypeChecked = {
16
18
  ...tsconfigs.disableTypeChecked,
17
19
  }
18
20
 
21
+ export const IS_CI = !!env.CI
22
+
19
23
  export default tsconfig(
20
24
  js.configs.recommended,
21
25
  {
22
26
  plugins: { 'import-x': importx },
23
27
  settings: {
24
- 'import-x/extensions': ['.ts', '.tsx', '.js', '.jsx'],
25
28
  'import-x/external-module-folders': ['node_modules', 'node_modules/@types'],
26
29
  'import-x/parsers': {
27
30
  '@typescript-eslint/parser': ['.ts', '.tsx', '.cts', '.mts'],
@@ -36,15 +39,19 @@ export default tsconfig(
36
39
  },
37
40
  },
38
41
  rules: {
39
- 'import-x/no-unresolved': 'error',
40
- // 'import-x/named': 'error',
41
- 'import-x/namespace': 'error',
42
- 'import-x/default': 'error',
42
+ // see https://typescript-eslint.io/troubleshooting/typed-linting/performance#eslint-plugin-import
43
+ 'import-x/no-unresolved': 'off',
44
+ 'import-x/no-cycle': 'error',
45
+ 'import-x/named': 'off',
46
+ 'import-x/namespace': 'off',
47
+ 'import-x/default': 'off',
43
48
  'import-x/export': 'error',
44
- 'import-x/no-named-as-default': 'warn',
45
- 'import-x/no-named-as-default-member': 'warn',
49
+ 'import-x/no-named-as-default-member': 'off',
46
50
  'import-x/no-duplicates': 'warn',
47
- 'import-x/named': 'off',
51
+ 'import-x/no-named-as-default': IS_CI ? 'warn' : 'off',
52
+ 'import-x/no-unused-modules': IS_CI ? 'error' : 'off',
53
+ 'import-x/no-deprecated': IS_CI ? 'error' : 'off',
54
+ 'import-x/extensions': 'off',
48
55
  },
49
56
  },
50
57
  unicorn.configs['flat/recommended'],
package/src/index.js CHANGED
@@ -19,14 +19,6 @@ export default tsconfig(
19
19
  },
20
20
  },
21
21
  rules: {
22
- // 忽略虚拟模块、组件
23
- 'import-x/no-unresolved': [
24
- 'error',
25
- {
26
- ignore: ['^~', '^virtual:'],
27
- },
28
- ],
29
-
30
22
  // 关闭 vue 代码风格规则
31
23
  'vue/html-self-closing': 'off',
32
24
  'vue/max-len': 'off',
package/tsconfig.json CHANGED
@@ -4,9 +4,9 @@
4
4
  "baseUrl": ".",
5
5
  "noImplicitOverride": true,
6
6
  "target": "ESNext",
7
- "module": "Preserve",
7
+ "module": "NodeNext",
8
+ "moduleResolution": "NodeNext",
8
9
  "resolveJsonModule": true,
9
- "moduleResolution": "Bundler",
10
10
  "lib": ["ESNext"],
11
11
  "esModuleInterop": true,
12
12
  "strictNullChecks": true