@wongxy/eslint-config 0.0.27 → 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 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 reactnative = options?.reactnative;
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
- name: "wongxy:general",
34
- rules: {
35
- "no-console": "off",
36
- "no-alert": "off",
37
- "no-multiple-empty-lines": "warn",
38
- "antfu/top-level-function": "off",
39
- "antfu/if-newline": "off",
40
- "import/order": ["error", {
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?.vue) {
41
+ });
42
+ if (options.vue) {
48
43
  configs.push({
49
- name: "wongxy:vue",
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 (reactnative) {
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:reactnative",
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)({ ...options, react }, ...configs, ...userConfigs);
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.FlatConfig[]>[]): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
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.FlatConfig[]>[]): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
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 reactnative = options?.reactnative;
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
- name: "wongxy:general",
10
- rules: {
11
- "no-console": "off",
12
- "no-alert": "off",
13
- "no-multiple-empty-lines": "warn",
14
- "antfu/top-level-function": "off",
15
- "antfu/if-newline": "off",
16
- "import/order": ["error", {
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?.vue) {
17
+ });
18
+ if (options.vue) {
24
19
  configs.push({
25
- name: "wongxy:vue",
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 (reactnative) {
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:reactnative",
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({ ...options, react }, ...configs, ...userConfigs);
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.27",
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.23.2"
26
+ "@antfu/eslint-config": "^2.24.1"
27
27
  },
28
28
  "devDependencies": {
29
- "@types/eslint": "^8.56.11",
30
- "bumpp": "^9.4.1",
31
- "eslint": "^9.7.0",
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.3",
33
+ "tsup": "^8.2.4",
34
34
  "typescript": "5.4.5"
35
35
  },
36
36
  "scripts": {