@vida0905/eslint-config 2.4.0 → 2.4.2

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/cli/index.js CHANGED
@@ -6,7 +6,7 @@ import path from "node:path";
6
6
  import { green } from "ansis";
7
7
 
8
8
  //#region package.json
9
- var version = "2.4.0";
9
+ var version = "2.4.2";
10
10
 
11
11
  //#endregion
12
12
  //#region src/cli/constants.ts
package/dist/index.d.ts CHANGED
@@ -1,15 +1,58 @@
1
- import { ConfigNames, OptionsConfig, TypedFlatConfigItem } from "@antfu/eslint-config";
1
+ import { Awaitable, ConfigNames, OptionsConfig, TypedFlatConfigItem } from "@antfu/eslint-config";
2
2
  import { FlatConfigComposer } from "eslint-flat-config-utils";
3
+ import { Linter } from "eslint";
3
4
  export * from "@antfu/eslint-config";
4
5
 
5
- //#region src/types.d.ts
6
+ //#region src/typegen.d.ts
7
+ interface RuleOptions {
8
+ /**
9
+ * Transforms the negation of a conjunction !(A && B) into the equivalent !A || !B according to De Morgan’s law
10
+ * @see https://github.com/azat-io/eslint-plugin-de-morgan/blob/main/docs/no-negated-conjunction.md
11
+ */
12
+ 'de-morgan/no-negated-conjunction'?: Linter.RuleEntry<[]>;
13
+ /**
14
+ * Transforms the negation of a disjunction !(A || B) into the equivalent !A && !B according to De Morgan’s law
15
+ * @see https://github.com/azat-io/eslint-plugin-de-morgan/blob/main/docs/no-negated-disjunction.md
16
+ */
17
+ 'de-morgan/no-negated-disjunction'?: Linter.RuleEntry<[]>;
18
+ /**
19
+ * Prefer recommended order of Nuxt config properties
20
+ * @see https://eslint.nuxt.com/packages/plugin#nuxtnuxt-config-keys-order
21
+ */
22
+ 'nuxt/nuxt-config-keys-order'?: Linter.RuleEntry<[]>;
23
+ /**
24
+ * Prefer using `import.meta.*` over `process.*`
25
+ * @see https://eslint.nuxt.com/packages/plugin#nuxtprefer-import-meta
26
+ */
27
+ 'nuxt/prefer-import-meta'?: Linter.RuleEntry<[]>;
28
+ }
29
+
30
+ /* ======= Declarations ======= */
6
31
 
7
- type OptionsConfig$1 = Omit<OptionsConfig, "overrides"> & {};
32
+ // Names of all the configs
33
+ //#endregion
34
+ //#region src/types.d.ts
35
+ interface Rules extends RuleOptions {}
36
+ type TypedFlatConfigItem$1 = Omit<Linter.Config<Linter.RulesRecord & Rules>, "plugins"> & {
37
+ /**
38
+ * An object containing a name-value mapping of plugin names to plugin objects. When `files` is specified, these plugins are only available to the matching files.
39
+ *
40
+ * @see [Using plugins in your configuration](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#using-plugins-in-your-configuration)
41
+ */
42
+ plugins?: Record<string, any>;
43
+ };
44
+ interface OptionsOverrides {
45
+ overrides?: TypedFlatConfigItem$1["rules"];
46
+ }
47
+ type OptionsConfig$1 = Omit<OptionsConfig, "overrides"> & {
48
+ deMorgan?: boolean | OptionsOverrides;
49
+ nuxt?: boolean | OptionsOverrides;
50
+ };
8
51
  //#endregion
9
52
  //#region src/utils.d.ts
10
53
  declare function deepMerge<T extends object>(target: T, source: T): T;
11
54
  //#endregion
12
55
  //#region src/index.d.ts
13
- declare function defineConfig(options?: OptionsConfig$1 & TypedFlatConfigItem, ...userConfigs: TypedFlatConfigItem[]): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
56
+ declare function defineConfig(options?: OptionsConfig$1 & Omit<TypedFlatConfigItem, "files">, ...userConfigs: Awaitable<TypedFlatConfigItem>[]): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
14
57
  //#endregion
15
58
  export { deepMerge, defineConfig as default, defineConfig };
package/dist/index.js CHANGED
@@ -42,6 +42,14 @@ const javascript = {
42
42
  //#endregion
43
43
  //#region src/overrides/stylistic.ts
44
44
  const stylistic = {
45
+ "style/quotes": [
46
+ "error",
47
+ "single",
48
+ {
49
+ avoidEscape: true,
50
+ allowTemplateLiterals: "avoidEscape"
51
+ }
52
+ ],
45
53
  "style/arrow-parens": ["error", "always"],
46
54
  "style/brace-style": [
47
55
  "error",
@@ -50,19 +58,11 @@ const stylistic = {
50
58
  ]
51
59
  };
52
60
 
53
- //#endregion
54
- //#region src/overrides/vue.ts
55
- const vue = { "vue/max-attributes-per-line": ["error", {
56
- singleline: 5,
57
- multiline: 1
58
- }] };
59
-
60
61
  //#endregion
61
62
  //#region src/overrides/index.ts
62
63
  const overrides = {
63
64
  javascript,
64
- stylistic,
65
- vue
65
+ stylistic
66
66
  };
67
67
 
68
68
  //#endregion
@@ -76,8 +76,10 @@ function deepMerge(target, source) {
76
76
  //#endregion
77
77
  //#region src/index.ts
78
78
  function defineConfig(options = {}, ...userConfigs) {
79
- const configs = [deMorgan()];
80
- if (isPackageExists("nuxt")) configs.push(nuxt());
79
+ const { deMorgan: enableDeMorgan, nuxt: enableNuxt = isPackageExists("nuxt") } = options;
80
+ const configs = [];
81
+ if (enableDeMorgan) configs.push(deMorgan());
82
+ if (enableNuxt) configs.push(nuxt());
81
83
  const antfuConfig = {
82
84
  stylistic: {
83
85
  indent: 2,
@@ -85,8 +87,7 @@ function defineConfig(options = {}, ...userConfigs) {
85
87
  semi: false,
86
88
  overrides: overrides.stylistic
87
89
  },
88
- javascript: { overrides: overrides.javascript },
89
- vue: { overrides: overrides.vue }
90
+ javascript: { overrides: overrides.javascript }
90
91
  };
91
92
  return antfu(deepMerge(antfuConfig, options), ...configs, ...userConfigs);
92
93
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vida0905/eslint-config",
3
3
  "type": "module",
4
- "version": "2.4.0",
4
+ "version": "2.4.2",
5
5
  "description": "Vida Xie's ESLint Config",
6
6
  "author": "Vida Xie <vida_2020@163.com> (https://github.com/9romise/)",
7
7
  "license": "MIT",
@@ -1 +0,0 @@
1
- export { };