@ithinkdt/lint 4.0.0-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/README.md ADDED
@@ -0,0 +1,71 @@
1
+ # @ithinkdt/lint
2
+
3
+ 安装 `npm i -D @ithinkdt/lint`
4
+
5
+ - 集成`@eslint/js`的`recommended`推荐规则;
6
+ - 集成`eslint-plugin-unicorn`的`flat/recommended`推荐规则;
7
+ - 集成`eslint-plugin-vue`的`flat/recommended`推荐规则;
8
+ - 集成`typescript-eslint`的`recommendedTypeChecked`,启用`Type Aware Rules 类型感知规则`,检查 ts、vue 文件的类型错误;
9
+ - 集成`eslint-plugin-tsdoc`规则;
10
+ - 集成`eslint-plugin-deprecation`规则;
11
+ - 等待集成`eslint-plugin-import-x`规则;
12
+ - 支持`StyleLint、Prettier`配置。
13
+
14
+ > 由于启用了类型感知规则,原则上 typescript 会在整个项目上执行,推测 `lint-staged` 效果不佳。
15
+
16
+ ## ESLint
17
+
18
+ 安装 `npm i -D eslint`
19
+
20
+ ```js
21
+ // eslint.config.js
22
+
23
+ import ithinkdt from '@ithinkdt/lint'
24
+
25
+ /**
26
+ * @type {import("eslint").Linter.FlatConfig[]}
27
+ */
28
+ export default [
29
+ ...ithinkdt,
30
+ // 其他配置
31
+ ]
32
+ ```
33
+
34
+ ## StyleLint
35
+
36
+ 安装 `npm i -D stylelint`
37
+
38
+ ```js
39
+ // stylelint.config.js
40
+
41
+ import ithinkdt from '@ithinkdt/lint/stylelint'
42
+
43
+ /**
44
+ * @type {import('stylelint').Config}
45
+ */
46
+ export default {
47
+ extends: [ithinkdt],
48
+ rules: {
49
+ // 覆盖配置
50
+ },
51
+ }
52
+ ```
53
+
54
+
55
+ ## Prettier
56
+
57
+ 安装 `npm i -D prettier`
58
+
59
+ ```js
60
+ // prettier.config.js
61
+
62
+ import ithinkdt from '@ithinkdt/lint/prettier'
63
+
64
+ /**
65
+ * @type {import('prettier').Config}
66
+ */
67
+ export default {
68
+ ...ithinkdt,
69
+ // 覆盖配置
70
+ }
71
+ ```
package/package.json ADDED
@@ -0,0 +1,82 @@
1
+ {
2
+ "name": "@ithinkdt/lint",
3
+ "version": "4.0.0-0",
4
+ "type": "module",
5
+ "description": "iThinkDT Cloud Lint",
6
+ "keywords": [
7
+ "vue",
8
+ "ithinkdt",
9
+ "lint",
10
+ "eslint",
11
+ "eslint-config",
12
+ "prettier",
13
+ "stylelint"
14
+ ],
15
+ "files": [
16
+ "*"
17
+ ],
18
+ "main": "./src/index.js",
19
+ "module": "./src/index.js",
20
+ "exports": {
21
+ ".": {
22
+ "types": "./src/index.d.ts",
23
+ "default": "./src/index.js"
24
+ },
25
+ "./prettier": {
26
+ "types": "./src/prettier.d.ts",
27
+ "default": "./src/prettier.js"
28
+ },
29
+ "./stylelint": {
30
+ "types": "./src/stylelint.d.ts",
31
+ "default": "./src/stylelint.js"
32
+ }
33
+ },
34
+ "publishConfig": {
35
+ "registry": " https://registry.npmjs.org/",
36
+ "access": "public"
37
+ },
38
+ "sideEffects": false,
39
+ "dependencies": {
40
+ "@eslint/compat": "^1.1.0",
41
+ "@eslint/eslintrc": "^3.1.0",
42
+ "@typescript-eslint/parser": "^8.0.0-alpha.41",
43
+ "@vue/compiler-sfc": "^3.4.31",
44
+ "eslint-plugin-tsdoc": "^0.3.0",
45
+ "eslint-plugin-unicorn": "^54.0.0",
46
+ "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
+ "globby": "^14.0.2",
52
+ "is-glob": "^4.0.3",
53
+ "postcss": "^8.4.39",
54
+ "postcss-html": "^1.7.0",
55
+ "postcss-scss": "^4.0.9",
56
+ "stylelint-config-recommended": "^14.0.1",
57
+ "stylelint-config-standard": "^36.0.1",
58
+ "stylelint-config-standard-scss": "^13.1.0",
59
+ "stylelint-config-standard-vue": "^1.0.0",
60
+ "stylelint-order": "^6.0.4",
61
+ "stylelint-scss": "^6.4.1",
62
+ "typescript-eslint": "^8.0.0-alpha.41",
63
+ "vue-eslint-parser": "^9.4.3"
64
+ },
65
+ "peerDependencies": {
66
+ "eslint": "^9.0.0",
67
+ "stylelint": "^16.0.0",
68
+ "prettier": "^3.0.0",
69
+ "typescript": "^5.0.0"
70
+ },
71
+ "devDependencies": {
72
+ "eslint": "^9.6.0",
73
+ "prettier": "^3.3.2",
74
+ "stylelint": "~16.6.1",
75
+ "typescript": "~5.5.3"
76
+ },
77
+ "license": "MIT",
78
+ "scripts": {
79
+ "format": "prettier --write \"./{src}/**/*.{js,vue,ts,jsx,tsx}\"",
80
+ "release": "pnpm publish --no-git-checks"
81
+ }
82
+ }