@wongxy/eslint-config 0.0.26 → 0.0.28
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/dist/index.cjs +27 -26
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +27 -26
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -24,49 +24,50 @@ __export(src_exports, {
|
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(src_exports);
|
|
26
26
|
var import_eslint_config = require("@antfu/eslint-config");
|
|
27
|
-
function wongxy(options, ...userConfigs) {
|
|
28
|
-
const
|
|
29
|
-
const react = options?.react || reactnative;
|
|
27
|
+
function wongxy(options = {}, ...userConfigs) {
|
|
28
|
+
const finalOptions = { ...options, react: options.react || options.reactnative };
|
|
30
29
|
const configs = [];
|
|
31
|
-
configs.push(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"newlines-between": "always"
|
|
42
|
-
}],
|
|
43
|
-
"style/brace-style": ["error", "1tbs", { allowSingleLine: true }]
|
|
44
|
-
}
|
|
30
|
+
configs.push({
|
|
31
|
+
name: "wongxy/general",
|
|
32
|
+
rules: {
|
|
33
|
+
"no-console": "off",
|
|
34
|
+
"no-alert": "off",
|
|
35
|
+
"no-multiple-empty-lines": "warn",
|
|
36
|
+
"antfu/top-level-function": "off",
|
|
37
|
+
"antfu/if-newline": "off",
|
|
38
|
+
"import/order": ["error", { "newlines-between": "always" }],
|
|
39
|
+
"style/brace-style": ["error", "1tbs", { allowSingleLine: true }]
|
|
45
40
|
}
|
|
46
|
-
);
|
|
47
|
-
if (options
|
|
41
|
+
});
|
|
42
|
+
if (options.vue) {
|
|
48
43
|
configs.push({
|
|
49
|
-
name: "wongxy
|
|
44
|
+
name: "wongxy/vue",
|
|
50
45
|
files: ["**/*.vue"],
|
|
51
46
|
rules: {
|
|
52
47
|
"vue/singleline-html-element-content-newline": "off",
|
|
53
48
|
"vue/valid-template-root": "off",
|
|
54
|
-
"vue/block-order": ["warn", {
|
|
55
|
-
order: [["script", "template"], "style"]
|
|
56
|
-
}],
|
|
49
|
+
"vue/block-order": ["warn", { order: [["script", "template"], "style"] }],
|
|
57
50
|
"vue/custom-event-name-casing": "off"
|
|
58
51
|
}
|
|
59
52
|
});
|
|
60
53
|
}
|
|
61
|
-
if (
|
|
54
|
+
if (options.react) {
|
|
55
|
+
configs.push({
|
|
56
|
+
name: "wongxy/react",
|
|
57
|
+
rules: {
|
|
58
|
+
"react/prefer-destructuring-assignment": "off"
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
if (options.reactnative) {
|
|
62
63
|
configs.push({
|
|
63
|
-
name: "wongxy
|
|
64
|
+
name: "wongxy/reactnative",
|
|
64
65
|
rules: {
|
|
65
66
|
"ts/no-require-imports": "off",
|
|
66
67
|
"ts/no-use-before-define": "off"
|
|
67
68
|
}
|
|
68
69
|
});
|
|
69
70
|
}
|
|
70
|
-
return (0, import_eslint_config.antfu)(
|
|
71
|
+
return (0, import_eslint_config.antfu)(finalOptions, ...configs, ...userConfigs);
|
|
71
72
|
}
|
|
72
73
|
var src_default = wongxy;
|
package/dist/index.d.cts
CHANGED
|
@@ -4,6 +4,6 @@ import { FlatConfigComposer } from 'eslint-flat-config-utils';
|
|
|
4
4
|
|
|
5
5
|
declare function wongxy(options?: OptionsConfig & TypedFlatConfigItem & {
|
|
6
6
|
reactnative?: boolean;
|
|
7
|
-
}, ...userConfigs: Awaitable<TypedFlatConfigItem | TypedFlatConfigItem[] | FlatConfigComposer<any, any> | Linter.
|
|
7
|
+
}, ...userConfigs: Awaitable<TypedFlatConfigItem | TypedFlatConfigItem[] | FlatConfigComposer<any, any> | Linter.Config[]>[]): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
|
|
8
8
|
|
|
9
9
|
export { wongxy as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,6 @@ import { FlatConfigComposer } from 'eslint-flat-config-utils';
|
|
|
4
4
|
|
|
5
5
|
declare function wongxy(options?: OptionsConfig & TypedFlatConfigItem & {
|
|
6
6
|
reactnative?: boolean;
|
|
7
|
-
}, ...userConfigs: Awaitable<TypedFlatConfigItem | TypedFlatConfigItem[] | FlatConfigComposer<any, any> | Linter.
|
|
7
|
+
}, ...userConfigs: Awaitable<TypedFlatConfigItem | TypedFlatConfigItem[] | FlatConfigComposer<any, any> | Linter.Config[]>[]): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
|
|
8
8
|
|
|
9
9
|
export { wongxy as default };
|
package/dist/index.js
CHANGED
|
@@ -1,49 +1,50 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
2
|
import { antfu } from "@antfu/eslint-config";
|
|
3
|
-
function wongxy(options, ...userConfigs) {
|
|
4
|
-
const
|
|
5
|
-
const react = options?.react || reactnative;
|
|
3
|
+
function wongxy(options = {}, ...userConfigs) {
|
|
4
|
+
const finalOptions = { ...options, react: options.react || options.reactnative };
|
|
6
5
|
const configs = [];
|
|
7
|
-
configs.push(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"newlines-between": "always"
|
|
18
|
-
}],
|
|
19
|
-
"style/brace-style": ["error", "1tbs", { allowSingleLine: true }]
|
|
20
|
-
}
|
|
6
|
+
configs.push({
|
|
7
|
+
name: "wongxy/general",
|
|
8
|
+
rules: {
|
|
9
|
+
"no-console": "off",
|
|
10
|
+
"no-alert": "off",
|
|
11
|
+
"no-multiple-empty-lines": "warn",
|
|
12
|
+
"antfu/top-level-function": "off",
|
|
13
|
+
"antfu/if-newline": "off",
|
|
14
|
+
"import/order": ["error", { "newlines-between": "always" }],
|
|
15
|
+
"style/brace-style": ["error", "1tbs", { allowSingleLine: true }]
|
|
21
16
|
}
|
|
22
|
-
);
|
|
23
|
-
if (options
|
|
17
|
+
});
|
|
18
|
+
if (options.vue) {
|
|
24
19
|
configs.push({
|
|
25
|
-
name: "wongxy
|
|
20
|
+
name: "wongxy/vue",
|
|
26
21
|
files: ["**/*.vue"],
|
|
27
22
|
rules: {
|
|
28
23
|
"vue/singleline-html-element-content-newline": "off",
|
|
29
24
|
"vue/valid-template-root": "off",
|
|
30
|
-
"vue/block-order": ["warn", {
|
|
31
|
-
order: [["script", "template"], "style"]
|
|
32
|
-
}],
|
|
25
|
+
"vue/block-order": ["warn", { order: [["script", "template"], "style"] }],
|
|
33
26
|
"vue/custom-event-name-casing": "off"
|
|
34
27
|
}
|
|
35
28
|
});
|
|
36
29
|
}
|
|
37
|
-
if (
|
|
30
|
+
if (options.react) {
|
|
31
|
+
configs.push({
|
|
32
|
+
name: "wongxy/react",
|
|
33
|
+
rules: {
|
|
34
|
+
"react/prefer-destructuring-assignment": "off"
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
if (options.reactnative) {
|
|
38
39
|
configs.push({
|
|
39
|
-
name: "wongxy
|
|
40
|
+
name: "wongxy/reactnative",
|
|
40
41
|
rules: {
|
|
41
42
|
"ts/no-require-imports": "off",
|
|
42
43
|
"ts/no-use-before-define": "off"
|
|
43
44
|
}
|
|
44
45
|
});
|
|
45
46
|
}
|
|
46
|
-
return antfu(
|
|
47
|
+
return antfu(finalOptions, ...configs, ...userConfigs);
|
|
47
48
|
}
|
|
48
49
|
var src_default = wongxy;
|
|
49
50
|
export {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wongxy/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.28",
|
|
5
5
|
"description": "xiyaowong's eslint config",
|
|
6
6
|
"author": "xiyaowong (https://github.com/xiyaowong)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
"eslint-plugin-react-refresh": "^0.4.4"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@antfu/eslint-config": "^2.
|
|
26
|
+
"@antfu/eslint-config": "^2.24.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@types/eslint": "^
|
|
30
|
-
"bumpp": "^9.4.
|
|
31
|
-
"eslint": "^9.
|
|
29
|
+
"@types/eslint": "^9.6.0",
|
|
30
|
+
"bumpp": "^9.4.2",
|
|
31
|
+
"eslint": "^9.8.0",
|
|
32
32
|
"eslint-flat-config-viewer": "^0.1.20",
|
|
33
|
-
"tsup": "^8.2.
|
|
33
|
+
"tsup": "^8.2.4",
|
|
34
34
|
"typescript": "5.4.5"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|