@fast-china/eslint-config 1.0.7 → 1.0.9
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 +15 -0
- package/README.zh.md +15 -0
- package/dist/flat/index.d.ts +153 -0
- package/dist/flat/index.js +972 -0
- package/dist/flat/index.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +458 -0
- package/dist/index.js.map +1 -0
- package/package.json +89 -69
- package/src/files/index.js +0 -78
- package/src/flat-index.js +0 -69
- package/src/index.js +0 -57
- package/src/rules/best.js +0 -48
- package/src/rules/import.js +0 -88
- package/src/rules/javascript.js +0 -93
- package/src/rules/typescript.js +0 -46
- package/src/rules/use-lodash-unified.js +0 -20
- package/src/rules/use-lodash.js +0 -20
- package/src/rules/vue.js +0 -66
package/README.md
CHANGED
|
@@ -36,6 +36,14 @@ pnpm install @fast-china/eslint-config --save-dev
|
|
|
36
36
|
|
|
37
37
|
```typescript
|
|
38
38
|
// < v9.x version. The following is an example of '.eslintrc.cjs'.
|
|
39
|
+
|
|
40
|
+
// Simple.
|
|
41
|
+
module.exports = {
|
|
42
|
+
root: true,
|
|
43
|
+
extends: ["@fast-china"],
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
// With TypeScript type hints.
|
|
39
47
|
const { defineConfig } = require("eslint-define-config");
|
|
40
48
|
|
|
41
49
|
module.exports = defineConfig({
|
|
@@ -44,6 +52,13 @@ module.exports = defineConfig({
|
|
|
44
52
|
});
|
|
45
53
|
|
|
46
54
|
// >= v9.x version. The following is an example of 'eslint.config.mjs'.
|
|
55
|
+
|
|
56
|
+
// Simple.
|
|
57
|
+
import fastChinaFlat from "@fast-china/eslint-config/flat";
|
|
58
|
+
|
|
59
|
+
export default [...fastChinaFlat];
|
|
60
|
+
|
|
61
|
+
// With TypeScript type hints.
|
|
47
62
|
import tseslint from "typescript-eslint";
|
|
48
63
|
import fastChinaFlat from "@fast-china/eslint-config/flat";
|
|
49
64
|
|
package/README.zh.md
CHANGED
|
@@ -36,6 +36,14 @@ pnpm install @fast-china/eslint-config --save-dev
|
|
|
36
36
|
|
|
37
37
|
```typescript
|
|
38
38
|
// < v9.x 版本。以下已 ‘.eslintrc.cjs’ 为示例。
|
|
39
|
+
|
|
40
|
+
// 简洁。
|
|
41
|
+
module.exports = {
|
|
42
|
+
root: true,
|
|
43
|
+
extends: ["@fast-china"],
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
// 带 TypeScript 类型提示。
|
|
39
47
|
const { defineConfig } = require("eslint-define-config");
|
|
40
48
|
|
|
41
49
|
module.exports = defineConfig({
|
|
@@ -44,6 +52,13 @@ module.exports = defineConfig({
|
|
|
44
52
|
});
|
|
45
53
|
|
|
46
54
|
// >= v9.x 版本。以下已 ‘eslint.config.mjs’ 未实例。
|
|
55
|
+
|
|
56
|
+
// 简洁。
|
|
57
|
+
import fastChinaFlat from "@fast-china/eslint-config/flat";
|
|
58
|
+
|
|
59
|
+
export default [...fastChinaFlat];
|
|
60
|
+
|
|
61
|
+
// 带 TypeScript 类型提示。
|
|
47
62
|
import tseslint from "typescript-eslint";
|
|
48
63
|
import fastChinaFlat from "@fast-china/eslint-config/flat";
|
|
49
64
|
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import * as _typescript_eslint_utils_dist_ts_eslint from '@typescript-eslint/utils/dist/ts-eslint';
|
|
2
|
+
import { Linter } from 'eslint';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 公共配置
|
|
6
|
+
* @description 最佳实践
|
|
7
|
+
*/
|
|
8
|
+
declare const commonConfigs: _typescript_eslint_utils_dist_ts_eslint.FlatConfig.ConfigArray;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* 忽略配置
|
|
12
|
+
*/
|
|
13
|
+
declare const ignoresConfigs: _typescript_eslint_utils_dist_ts_eslint.FlatConfig.ConfigArray;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 导入使用 lodash-unified 模块规则
|
|
17
|
+
*/
|
|
18
|
+
declare const importUseLodashUnifiedRules: Linter.RulesRecord;
|
|
19
|
+
/**
|
|
20
|
+
* 导入使用 lodash 模块规则
|
|
21
|
+
*/
|
|
22
|
+
declare const importUseLodashRules: Linter.RulesRecord;
|
|
23
|
+
/**
|
|
24
|
+
* import配置
|
|
25
|
+
*/
|
|
26
|
+
declare const importConfigs: _typescript_eslint_utils_dist_ts_eslint.FlatConfig.ConfigArray;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* JavaScript配置
|
|
30
|
+
*/
|
|
31
|
+
declare const javascriptConfigs: _typescript_eslint_utils_dist_ts_eslint.FlatConfig.ConfigArray;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Json配置
|
|
35
|
+
*/
|
|
36
|
+
declare const jsonConfigs: _typescript_eslint_utils_dist_ts_eslint.FlatConfig.ConfigArray;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* markdown配置
|
|
40
|
+
*/
|
|
41
|
+
declare const markdownConfigs: _typescript_eslint_utils_dist_ts_eslint.FlatConfig.ConfigArray;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* prettier配置
|
|
45
|
+
*/
|
|
46
|
+
declare const prettierConfigs: _typescript_eslint_utils_dist_ts_eslint.FlatConfig.ConfigArray;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* regexp配置
|
|
50
|
+
*/
|
|
51
|
+
declare const regexpConfigs: _typescript_eslint_utils_dist_ts_eslint.FlatConfig.ConfigArray;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* package.json 属性排序
|
|
55
|
+
*/
|
|
56
|
+
declare const packageJsonSortConfigs: _typescript_eslint_utils_dist_ts_eslint.FlatConfig.ConfigArray;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* tsconfig.json 属性排序
|
|
60
|
+
*/
|
|
61
|
+
declare const tsconfigJsonSortConfigs: _typescript_eslint_utils_dist_ts_eslint.FlatConfig.ConfigArray;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* TypeScript 核心配置
|
|
65
|
+
*/
|
|
66
|
+
declare const typescriptCoreConfigs: _typescript_eslint_utils_dist_ts_eslint.FlatConfig.ConfigArray;
|
|
67
|
+
/**
|
|
68
|
+
* TypeScript配置
|
|
69
|
+
*/
|
|
70
|
+
declare const typescriptConfigs: _typescript_eslint_utils_dist_ts_eslint.FlatConfig.ConfigArray;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* vue配置
|
|
74
|
+
*/
|
|
75
|
+
declare const vueConfigs: _typescript_eslint_utils_dist_ts_eslint.FlatConfig.ConfigArray;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* JS
|
|
79
|
+
*/
|
|
80
|
+
declare const CONST_JS = "**/*.?([cm])js";
|
|
81
|
+
/**
|
|
82
|
+
* JSX
|
|
83
|
+
*/
|
|
84
|
+
declare const CONST_JSX = "**/*.?([cm])jsx";
|
|
85
|
+
/**
|
|
86
|
+
* TS
|
|
87
|
+
*/
|
|
88
|
+
declare const CONST_TS = "**/*.?([cm])ts";
|
|
89
|
+
/**
|
|
90
|
+
* TSX
|
|
91
|
+
*/
|
|
92
|
+
declare const CONST_TSX = "**/*.?([cm])tsx";
|
|
93
|
+
/**
|
|
94
|
+
* JSON
|
|
95
|
+
*/
|
|
96
|
+
declare const CONST_JSON = "**/*.json";
|
|
97
|
+
/**
|
|
98
|
+
* JSONC
|
|
99
|
+
*/
|
|
100
|
+
declare const CONST_JSONC = "**/*.jsonc";
|
|
101
|
+
/**
|
|
102
|
+
* JSON5
|
|
103
|
+
*/
|
|
104
|
+
declare const CONST_JSON5 = "**/*.json5";
|
|
105
|
+
/**
|
|
106
|
+
* JSON6
|
|
107
|
+
*/
|
|
108
|
+
declare const CONST_JSON6 = "**/*.json6";
|
|
109
|
+
/**
|
|
110
|
+
* MD
|
|
111
|
+
*/
|
|
112
|
+
declare const CONST_MD = "**/*.md";
|
|
113
|
+
/**
|
|
114
|
+
* VUE
|
|
115
|
+
*/
|
|
116
|
+
declare const CONST_VUE = "**/*.vue";
|
|
117
|
+
/**
|
|
118
|
+
* YAML
|
|
119
|
+
*/
|
|
120
|
+
declare const CONST_YAML = "**/*.y?(a)ml";
|
|
121
|
+
/**
|
|
122
|
+
* node_modules
|
|
123
|
+
*/
|
|
124
|
+
declare const CONST_NODE_MODULES = "**/node_modules";
|
|
125
|
+
/**
|
|
126
|
+
* 打包目录 dist
|
|
127
|
+
*/
|
|
128
|
+
declare const CONST_DIST = "**/dist";
|
|
129
|
+
/**
|
|
130
|
+
* 包管理 lock 文件
|
|
131
|
+
*/
|
|
132
|
+
declare const CONST_LOCKFILE: string[];
|
|
133
|
+
/**
|
|
134
|
+
* public
|
|
135
|
+
*/
|
|
136
|
+
declare const CONST_PUBLIC = "**/public";
|
|
137
|
+
/**
|
|
138
|
+
* TS 配置文件
|
|
139
|
+
*/
|
|
140
|
+
declare const CONST_TSCONFIG: string[];
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* 是否包含 vue
|
|
144
|
+
*/
|
|
145
|
+
declare const hasVue: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* 是否为 vue3 版本
|
|
148
|
+
*/
|
|
149
|
+
declare const isVue3: boolean;
|
|
150
|
+
|
|
151
|
+
declare const _default: _typescript_eslint_utils_dist_ts_eslint.FlatConfig.Config[];
|
|
152
|
+
|
|
153
|
+
export { CONST_DIST, CONST_JS, CONST_JSON, CONST_JSON5, CONST_JSON6, CONST_JSONC, CONST_JSX, CONST_LOCKFILE, CONST_MD, CONST_NODE_MODULES, CONST_PUBLIC, CONST_TS, CONST_TSCONFIG, CONST_TSX, CONST_VUE, CONST_YAML, commonConfigs, _default as default, hasVue, ignoresConfigs, importConfigs, importUseLodashRules, importUseLodashUnifiedRules, isVue3, javascriptConfigs, jsonConfigs, markdownConfigs, packageJsonSortConfigs, prettierConfigs, regexpConfigs, tsconfigJsonSortConfigs, typescriptConfigs, typescriptCoreConfigs, vueConfigs };
|