@lincy/eslint-config 3.0.7 → 3.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 +51 -51
- package/dist/index.cjs +5 -4
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -3
- package/package.json +2 -8
package/README.md
CHANGED
|
@@ -115,11 +115,11 @@ export default eslintConfig()
|
|
|
115
115
|
import eslintConfig from '@lincy/eslint-config'
|
|
116
116
|
|
|
117
117
|
export default eslintConfig({
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
118
|
+
stylistic: true, // enable stylistic formatting rules
|
|
119
|
+
typescript: true,
|
|
120
|
+
vue: true,
|
|
121
|
+
jsonc: false,
|
|
122
|
+
yml: false,
|
|
123
123
|
})
|
|
124
124
|
```
|
|
125
125
|
|
|
@@ -130,18 +130,18 @@ export default eslintConfig({
|
|
|
130
130
|
import eslintConfig from '@lincy/eslint-config'
|
|
131
131
|
|
|
132
132
|
export default eslintConfig(
|
|
133
|
-
|
|
133
|
+
{
|
|
134
134
|
// Configures for config
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
135
|
+
},
|
|
136
|
+
|
|
137
|
+
// From the second arguments they are ESLint Flat Configs
|
|
138
|
+
// you can have multiple configs
|
|
139
|
+
{
|
|
140
|
+
rules: {},
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
rules: {},
|
|
144
|
+
},
|
|
145
145
|
)
|
|
146
146
|
```
|
|
147
147
|
|
|
@@ -150,41 +150,41 @@ export default eslintConfig(
|
|
|
150
150
|
```js
|
|
151
151
|
// eslint.config.js
|
|
152
152
|
import {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
153
|
+
comments,
|
|
154
|
+
ignores,
|
|
155
|
+
imports,
|
|
156
|
+
javascript,
|
|
157
|
+
javascriptStylistic,
|
|
158
|
+
jsdoc,
|
|
159
|
+
jsonc,
|
|
160
|
+
markdown,
|
|
161
|
+
node,
|
|
162
|
+
sortPackageJson,
|
|
163
|
+
sortTsconfig,
|
|
164
|
+
typescript,
|
|
165
|
+
typescriptStylistic,
|
|
166
|
+
unicorn,
|
|
167
|
+
vue,
|
|
168
|
+
yml,
|
|
169
169
|
} from '@lincy/eslint-config'
|
|
170
170
|
|
|
171
171
|
export default [
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
172
|
+
...ignores,
|
|
173
|
+
...javascript(),
|
|
174
|
+
...comments,
|
|
175
|
+
...node,
|
|
176
|
+
...jsdoc,
|
|
177
|
+
...imports,
|
|
178
|
+
...unicorn,
|
|
179
|
+
...javascriptStylistic,
|
|
180
|
+
|
|
181
|
+
...typescript(),
|
|
182
|
+
...typescriptStylistic,
|
|
183
|
+
|
|
184
|
+
...vue(),
|
|
185
|
+
...jsonc,
|
|
186
|
+
...yml,
|
|
187
|
+
...markdown(),
|
|
188
188
|
]
|
|
189
189
|
```
|
|
190
190
|
|
|
@@ -221,9 +221,9 @@ type foo = { bar: 2 }
|
|
|
221
221
|
import eslintConfig from '@lincy/eslint-config'
|
|
222
222
|
|
|
223
223
|
export default eslintConfig({
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
224
|
+
typescript: {
|
|
225
|
+
tsconfigPath: 'tsconfig.json',
|
|
226
|
+
},
|
|
227
227
|
})
|
|
228
228
|
```
|
|
229
229
|
|
package/dist/index.cjs
CHANGED
|
@@ -33,13 +33,13 @@ __export(src_exports, {
|
|
|
33
33
|
combine: () => combine,
|
|
34
34
|
comments: () => comments,
|
|
35
35
|
default: () => src_default,
|
|
36
|
-
factoryFunc: () => factoryFunc,
|
|
37
36
|
ignores: () => ignores,
|
|
38
37
|
imports: () => imports,
|
|
39
38
|
javascript: () => javascript,
|
|
40
39
|
javascriptStylistic: () => javascriptStylistic,
|
|
41
40
|
jsdoc: () => jsdoc,
|
|
42
41
|
jsonc: () => jsonc,
|
|
42
|
+
lincy: () => lincy,
|
|
43
43
|
markdown: () => markdown,
|
|
44
44
|
node: () => node,
|
|
45
45
|
parserJsonc: () => import_jsonc_eslint_parser.default,
|
|
@@ -1038,6 +1038,7 @@ function typescript(options) {
|
|
|
1038
1038
|
"ts/no-non-null-assertion": OFF,
|
|
1039
1039
|
"ts/no-redeclare": "error",
|
|
1040
1040
|
"ts/no-require-imports": "error",
|
|
1041
|
+
"ts/unified-signatures": OFF,
|
|
1041
1042
|
"ts/no-unused-vars": OFF,
|
|
1042
1043
|
"ts/no-use-before-define": ["error", { classes: false, functions: false, variables: true }],
|
|
1043
1044
|
"ts/parameter-properties": OFF,
|
|
@@ -1324,7 +1325,7 @@ function test(options = {}) {
|
|
|
1324
1325
|
}
|
|
1325
1326
|
|
|
1326
1327
|
// src/factory.ts
|
|
1327
|
-
function
|
|
1328
|
+
function lincy(options = {}, ...userConfigs) {
|
|
1328
1329
|
const isInEditor = options.isInEditor ?? !!((import_node_process2.default.env.VSCODE_PID || import_node_process2.default.env.JETBRAINS_IDE) && !import_node_process2.default.env.CI);
|
|
1329
1330
|
const enableVue = options.vue ?? (isPackageExists("vue") || isPackageExists("nuxt") || isPackageExists("vitepress") || isPackageExists("@slidev/cli"));
|
|
1330
1331
|
const enableTypeScript = options.typescript ?? isPackageExists("typescript");
|
|
@@ -1376,18 +1377,18 @@ function factoryFunc(options = {}, ...userConfigs) {
|
|
|
1376
1377
|
}
|
|
1377
1378
|
|
|
1378
1379
|
// src/index.ts
|
|
1379
|
-
var src_default =
|
|
1380
|
+
var src_default = lincy;
|
|
1380
1381
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1381
1382
|
0 && (module.exports = {
|
|
1382
1383
|
combine,
|
|
1383
1384
|
comments,
|
|
1384
|
-
factoryFunc,
|
|
1385
1385
|
ignores,
|
|
1386
1386
|
imports,
|
|
1387
1387
|
javascript,
|
|
1388
1388
|
javascriptStylistic,
|
|
1389
1389
|
jsdoc,
|
|
1390
1390
|
jsonc,
|
|
1391
|
+
lincy,
|
|
1391
1392
|
markdown,
|
|
1392
1393
|
node,
|
|
1393
1394
|
parserJsonc,
|
package/dist/index.d.cts
CHANGED
|
@@ -93,7 +93,7 @@ interface OptionsConfig {
|
|
|
93
93
|
/**
|
|
94
94
|
* Construct an array of ESLint flat config items.
|
|
95
95
|
*/
|
|
96
|
-
declare function
|
|
96
|
+
declare function lincy(options?: OptionsConfig, ...userConfigs: (FlatESLintConfigItem | FlatESLintConfigItem[])[]): FlatESLintConfigItem[];
|
|
97
97
|
|
|
98
98
|
declare const comments: FlatESLintConfigItem[];
|
|
99
99
|
|
|
@@ -146,4 +146,4 @@ declare function renameRules(rules: Record<string, any>, from: string, to: strin
|
|
|
146
146
|
[k: string]: any;
|
|
147
147
|
};
|
|
148
148
|
|
|
149
|
-
export { OptionsComponentExts, OptionsConfig, OptionsHasTypeScript, OptionsIsInEditor, OptionsTypeScriptWithLanguageServer, combine, comments,
|
|
149
|
+
export { OptionsComponentExts, OptionsConfig, OptionsHasTypeScript, OptionsIsInEditor, OptionsTypeScriptWithLanguageServer, combine, comments, lincy as default, ignores, imports, javascript, javascriptStylistic, jsdoc, jsonc, lincy, markdown, node, renameRules, sortPackageJson, sortTsconfig, test, typescript, typescriptStylistic, typescriptWithLanguageServer, unicorn, vue, yml };
|
package/dist/index.d.ts
CHANGED
|
@@ -93,7 +93,7 @@ interface OptionsConfig {
|
|
|
93
93
|
/**
|
|
94
94
|
* Construct an array of ESLint flat config items.
|
|
95
95
|
*/
|
|
96
|
-
declare function
|
|
96
|
+
declare function lincy(options?: OptionsConfig, ...userConfigs: (FlatESLintConfigItem | FlatESLintConfigItem[])[]): FlatESLintConfigItem[];
|
|
97
97
|
|
|
98
98
|
declare const comments: FlatESLintConfigItem[];
|
|
99
99
|
|
|
@@ -146,4 +146,4 @@ declare function renameRules(rules: Record<string, any>, from: string, to: strin
|
|
|
146
146
|
[k: string]: any;
|
|
147
147
|
};
|
|
148
148
|
|
|
149
|
-
export { OptionsComponentExts, OptionsConfig, OptionsHasTypeScript, OptionsIsInEditor, OptionsTypeScriptWithLanguageServer, combine, comments,
|
|
149
|
+
export { OptionsComponentExts, OptionsConfig, OptionsHasTypeScript, OptionsIsInEditor, OptionsTypeScriptWithLanguageServer, combine, comments, lincy as default, ignores, imports, javascript, javascriptStylistic, jsdoc, jsonc, lincy, markdown, node, renameRules, sortPackageJson, sortTsconfig, test, typescript, typescriptStylistic, typescriptWithLanguageServer, unicorn, vue, yml };
|
package/dist/index.js
CHANGED
|
@@ -958,6 +958,7 @@ function typescript(options) {
|
|
|
958
958
|
"ts/no-non-null-assertion": OFF,
|
|
959
959
|
"ts/no-redeclare": "error",
|
|
960
960
|
"ts/no-require-imports": "error",
|
|
961
|
+
"ts/unified-signatures": OFF,
|
|
961
962
|
"ts/no-unused-vars": OFF,
|
|
962
963
|
"ts/no-use-before-define": ["error", { classes: false, functions: false, variables: true }],
|
|
963
964
|
"ts/parameter-properties": OFF,
|
|
@@ -1244,7 +1245,7 @@ function test(options = {}) {
|
|
|
1244
1245
|
}
|
|
1245
1246
|
|
|
1246
1247
|
// src/factory.ts
|
|
1247
|
-
function
|
|
1248
|
+
function lincy(options = {}, ...userConfigs) {
|
|
1248
1249
|
const isInEditor = options.isInEditor ?? !!((process2.env.VSCODE_PID || process2.env.JETBRAINS_IDE) && !process2.env.CI);
|
|
1249
1250
|
const enableVue = options.vue ?? (isPackageExists("vue") || isPackageExists("nuxt") || isPackageExists("vitepress") || isPackageExists("@slidev/cli"));
|
|
1250
1251
|
const enableTypeScript = options.typescript ?? isPackageExists("typescript");
|
|
@@ -1296,18 +1297,18 @@ function factoryFunc(options = {}, ...userConfigs) {
|
|
|
1296
1297
|
}
|
|
1297
1298
|
|
|
1298
1299
|
// src/index.ts
|
|
1299
|
-
var src_default =
|
|
1300
|
+
var src_default = lincy;
|
|
1300
1301
|
export {
|
|
1301
1302
|
combine,
|
|
1302
1303
|
comments,
|
|
1303
1304
|
src_default as default,
|
|
1304
|
-
factoryFunc,
|
|
1305
1305
|
ignores,
|
|
1306
1306
|
imports,
|
|
1307
1307
|
javascript,
|
|
1308
1308
|
javascriptStylistic,
|
|
1309
1309
|
jsdoc,
|
|
1310
1310
|
jsonc,
|
|
1311
|
+
lincy,
|
|
1311
1312
|
markdown,
|
|
1312
1313
|
node,
|
|
1313
1314
|
default20 as parserJsonc,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lincy/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.9",
|
|
5
5
|
"packageManager": "pnpm@8.7.6",
|
|
6
6
|
"description": "LinCenYing's ESLint config",
|
|
7
7
|
"author": "LinCenYing <lincenying@gmail.com> (https://github.com/lincenying/)",
|
|
@@ -13,13 +13,6 @@
|
|
|
13
13
|
"main": "dist/index.cjs",
|
|
14
14
|
"module": "dist/index.js",
|
|
15
15
|
"types": "dist/index.d.ts",
|
|
16
|
-
"exports": {
|
|
17
|
-
".": {
|
|
18
|
-
"types": "dist/index.d.ts",
|
|
19
|
-
"require": "dist/index.cjs",
|
|
20
|
-
"import": "dist/index.js"
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
16
|
"files": [
|
|
24
17
|
"dist"
|
|
25
18
|
],
|
|
@@ -27,6 +20,7 @@
|
|
|
27
20
|
"build": "tsup src/index.ts --format esm,cjs --shims --clean --dts",
|
|
28
21
|
"stub": "tsup src/index.ts --format esm,cjs --shims --clean",
|
|
29
22
|
"lint": "pnpm run stub && eslint .",
|
|
23
|
+
"lint:fix": "eslint . --fix",
|
|
30
24
|
"postpublish": "open https://npmmirror.com/package/@lincy/eslint-config",
|
|
31
25
|
"prepublishOnly": "nr build",
|
|
32
26
|
"release": "bumpp && npm publish -r --access public",
|