@debbl/eslint-config 1.0.0-beta.9 → 1.1.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 +137 -0
- package/dist/index.cjs +1534 -0
- package/dist/index.d.cts +230 -0
- package/dist/index.d.ts +166 -75
- package/dist/index.js +1331 -69
- package/package.json +56 -14
package/README.md
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# [@debbl/eslint-config](https://github.com/Debbl/eslint-config)
|
|
2
|
+
|
|
3
|
+
[](https://npmjs.com/package/@debbl/eslint-config)
|
|
4
|
+
|
|
5
|
+
## 参考
|
|
6
|
+
|
|
7
|
+
> https://github.com/antfu/eslint-config
|
|
8
|
+
|
|
9
|
+
## 安装
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pnpm i eslint @debbl/eslint-config -D
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## 配置 `eslint.config.js`
|
|
16
|
+
|
|
17
|
+
### 默认启动配置
|
|
18
|
+
- ignores
|
|
19
|
+
- javascript
|
|
20
|
+
- comments
|
|
21
|
+
- node
|
|
22
|
+
- jsdoc
|
|
23
|
+
- imports
|
|
24
|
+
- unicorn
|
|
25
|
+
- sortKeys
|
|
26
|
+
- test
|
|
27
|
+
- jsonc
|
|
28
|
+
- yml
|
|
29
|
+
- markdown
|
|
30
|
+
- prettier
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
import { config } from "@debbl/eslint-config";
|
|
34
|
+
|
|
35
|
+
export default config();
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## 配置 `Prettier`, 会覆盖默认的规则
|
|
39
|
+
|
|
40
|
+
```js
|
|
41
|
+
import config from "./dist/index.js";
|
|
42
|
+
|
|
43
|
+
export default config({
|
|
44
|
+
typescript: true,
|
|
45
|
+
prettier: {
|
|
46
|
+
semi: false,
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## 完整的 OptionConfig
|
|
52
|
+
|
|
53
|
+
[types.ts](./src/types.ts#L56)
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
export interface OptionsConfig extends OptionsComponentExts {
|
|
57
|
+
/**
|
|
58
|
+
* Enable gitignore support.
|
|
59
|
+
* Passing an object to configure the options.
|
|
60
|
+
* @default true
|
|
61
|
+
*/
|
|
62
|
+
gitignore?:
|
|
63
|
+
| boolean
|
|
64
|
+
| {
|
|
65
|
+
ignorePath: string;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Enable TypeScript support.
|
|
70
|
+
*
|
|
71
|
+
* Passing an object to enable TypeScript Language Server support.
|
|
72
|
+
*
|
|
73
|
+
* @default false
|
|
74
|
+
*/
|
|
75
|
+
typescript?: boolean | OptionsTypeScriptWithTypes;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Enable test support.
|
|
79
|
+
*
|
|
80
|
+
* @default true
|
|
81
|
+
*/
|
|
82
|
+
test?: boolean;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Enable Vue support.
|
|
86
|
+
*
|
|
87
|
+
* @default false
|
|
88
|
+
*/
|
|
89
|
+
vue?: boolean;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Enable React support, Passing an object to enable Next.js support.
|
|
93
|
+
*
|
|
94
|
+
* @default false
|
|
95
|
+
*/
|
|
96
|
+
react?: boolean | ReactOptions;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Enable JSONC support.
|
|
100
|
+
*
|
|
101
|
+
* @default true
|
|
102
|
+
*/
|
|
103
|
+
jsonc?: boolean;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Enable YML support.
|
|
107
|
+
*
|
|
108
|
+
* @default true
|
|
109
|
+
*/
|
|
110
|
+
yml?: boolean;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Enable Markdown support.
|
|
114
|
+
*
|
|
115
|
+
* @default true
|
|
116
|
+
*/
|
|
117
|
+
markdown?: boolean;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Enable prettier rules.
|
|
121
|
+
*
|
|
122
|
+
* @default true
|
|
123
|
+
*/
|
|
124
|
+
prettier?: boolean | PrettierRequiredOptions;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Enable Tailwind CSS support.
|
|
128
|
+
* @default false
|
|
129
|
+
*/
|
|
130
|
+
tailwindcss?: boolean;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Custom config
|
|
134
|
+
*/
|
|
135
|
+
customConfig?: ConfigItem[] | ConfigItem;
|
|
136
|
+
}
|
|
137
|
+
```
|