@luxass/eslint-config 4.0.0-beta.7 → 4.0.0-beta.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.
Files changed (95) hide show
  1. package/dist/{chunk-P4VCNFV7.mjs → chunk-24KJPXII.mjs} +1 -1
  2. package/dist/{chunk-ZCBXPKVL.mjs → chunk-3QHLEAXK.mjs} +1 -1
  3. package/dist/chunk-AL47KNVD.mjs +37 -0
  4. package/dist/{chunk-AWRK5LBF.mjs → chunk-BAKUP7QM.mjs} +1 -1
  5. package/dist/{chunk-E75NMIPT.mjs → chunk-ERFDRAGW.mjs} +1 -1
  6. package/dist/{chunk-NAAUGWPQ.mjs → chunk-FK567E7G.mjs} +1 -1
  7. package/dist/{chunk-6B53AW4K.mjs → chunk-LQLF2CMA.mjs} +11 -6
  8. package/dist/{chunk-UTGBMMZF.mjs → chunk-M5WNLLBT.mjs} +1 -1
  9. package/dist/{chunk-QPBW5YAJ.mjs → chunk-NUG6FLHN.mjs} +1 -1
  10. package/dist/{chunk-AP74CKWC.mjs → chunk-O4O6V7LI.mjs} +10 -3
  11. package/dist/{chunk-LGVH5YDV.mjs → chunk-P3N5WLFL.mjs} +1 -1
  12. package/dist/{chunk-KL4WRPMJ.mjs → chunk-QZTI72NS.mjs} +8 -3
  13. package/dist/chunk-TQ476NL2.mjs +57 -0
  14. package/dist/{chunk-ODRFH37N.mjs → chunk-UBPIYSHC.mjs} +13 -6
  15. package/dist/configs/astro.cjs +12 -5
  16. package/dist/configs/astro.d.cts +1 -1
  17. package/dist/configs/astro.d.ts +1 -1
  18. package/dist/configs/astro.mjs +2 -2
  19. package/dist/configs/comments.d.cts +1 -1
  20. package/dist/configs/comments.d.ts +1 -1
  21. package/dist/configs/ignores.d.cts +1 -1
  22. package/dist/configs/ignores.d.ts +1 -1
  23. package/dist/configs/imports.d.cts +1 -1
  24. package/dist/configs/imports.d.ts +1 -1
  25. package/dist/configs/index.cjs +77 -18
  26. package/dist/configs/index.d.cts +1 -1
  27. package/dist/configs/index.d.ts +1 -1
  28. package/dist/configs/index.mjs +14 -14
  29. package/dist/configs/javascript.d.cts +1 -1
  30. package/dist/configs/javascript.d.ts +1 -1
  31. package/dist/configs/jsdoc.cjs +2 -0
  32. package/dist/configs/jsdoc.d.cts +1 -1
  33. package/dist/configs/jsdoc.d.ts +1 -1
  34. package/dist/configs/jsdoc.mjs +2 -2
  35. package/dist/configs/jsonc.cjs +2 -0
  36. package/dist/configs/jsonc.d.cts +1 -1
  37. package/dist/configs/jsonc.d.ts +1 -1
  38. package/dist/configs/jsonc.mjs +2 -2
  39. package/dist/configs/markdown.cjs +2 -0
  40. package/dist/configs/markdown.d.cts +1 -1
  41. package/dist/configs/markdown.d.ts +1 -1
  42. package/dist/configs/markdown.mjs +2 -2
  43. package/dist/configs/nextjs.cjs +33 -2
  44. package/dist/configs/nextjs.d.cts +1 -1
  45. package/dist/configs/nextjs.d.ts +1 -1
  46. package/dist/configs/nextjs.mjs +2 -2
  47. package/dist/configs/node.d.cts +1 -1
  48. package/dist/configs/node.d.ts +1 -1
  49. package/dist/configs/perfectionist.d.cts +1 -1
  50. package/dist/configs/perfectionist.d.ts +1 -1
  51. package/dist/configs/react.cjs +38 -5
  52. package/dist/configs/react.d.cts +1 -1
  53. package/dist/configs/react.d.ts +1 -1
  54. package/dist/configs/react.mjs +2 -2
  55. package/dist/configs/sort.d.cts +1 -1
  56. package/dist/configs/sort.d.ts +1 -1
  57. package/dist/configs/stylistic.cjs +2 -0
  58. package/dist/configs/stylistic.d.cts +1 -1
  59. package/dist/configs/stylistic.d.ts +1 -1
  60. package/dist/configs/stylistic.mjs +2 -2
  61. package/dist/configs/tailwindcss.cjs +35 -2
  62. package/dist/configs/tailwindcss.d.cts +2 -2
  63. package/dist/configs/tailwindcss.d.ts +2 -2
  64. package/dist/configs/tailwindcss.mjs +2 -2
  65. package/dist/configs/test.cjs +2 -0
  66. package/dist/configs/test.d.cts +1 -1
  67. package/dist/configs/test.d.ts +1 -1
  68. package/dist/configs/test.mjs +2 -2
  69. package/dist/configs/typescript.cjs +4 -2
  70. package/dist/configs/typescript.d.cts +1 -1
  71. package/dist/configs/typescript.d.ts +1 -1
  72. package/dist/configs/typescript.mjs +2 -2
  73. package/dist/configs/unicorn.d.cts +1 -1
  74. package/dist/configs/unicorn.d.ts +1 -1
  75. package/dist/configs/unocss.cjs +46 -2
  76. package/dist/configs/unocss.d.cts +2 -2
  77. package/dist/configs/unocss.d.ts +2 -2
  78. package/dist/configs/unocss.mjs +3 -2
  79. package/dist/configs/vue.cjs +2 -0
  80. package/dist/configs/vue.d.cts +1 -1
  81. package/dist/configs/vue.d.ts +1 -1
  82. package/dist/configs/vue.mjs +2 -2
  83. package/dist/configs/yaml.cjs +2 -0
  84. package/dist/configs/yaml.d.cts +1 -1
  85. package/dist/configs/yaml.d.ts +1 -1
  86. package/dist/configs/yaml.mjs +2 -2
  87. package/dist/index.cjs +95 -31
  88. package/dist/index.d.cts +1 -1
  89. package/dist/index.d.ts +1 -1
  90. package/dist/index.mjs +25 -20
  91. package/dist/{types-d6wL74Fv.d.ts → types-h9izbkUX.d.cts} +14 -8
  92. package/dist/{types-d6wL74Fv.d.cts → types-h9izbkUX.d.ts} +14 -8
  93. package/package.json +10 -11
  94. package/dist/chunk-4VUK6ART.mjs +0 -29
  95. package/dist/chunk-SLYFE6WI.mjs +0 -23
@@ -70,7 +70,7 @@ interface ReactOptions {
70
70
  interface AstroOptions {
71
71
  a11y?: boolean;
72
72
  }
73
- interface OptionsTailwindCSS {
73
+ interface TailwindCSSOptions {
74
74
  /**
75
75
  * Tell the plugin where the config file is located.
76
76
  * If not provided, the plugin will try to find the config file automatically.
@@ -97,6 +97,12 @@ interface OptionsTailwindCSS {
97
97
  */
98
98
  classRegex?: string;
99
99
  }
100
+ interface UnoCSSOptions {
101
+ /**
102
+ * Are you using UnoCSS Attributify mode?
103
+ */
104
+ attributify?: boolean;
105
+ }
100
106
  type StylisticOptions = Pick<OptionsConfig, "stylistic">;
101
107
  type StylisticConfig = Pick<StylisticCustomizeOptions, "jsx" | "indent" | "quotes" | "semi">;
102
108
  interface OverrideOptions {
@@ -154,13 +160,13 @@ interface OptionsConfig extends OptionsComponentExts {
154
160
  /**
155
161
  * Enable NextJS support.
156
162
  *
157
- * @default auto-detect based on the dependencies
163
+ * @default false
158
164
  */
159
165
  nextjs?: boolean | NextJSOptions;
160
166
  /**
161
167
  * Enable React support.
162
168
  *
163
- * @default auto-detect based on the dependencies
169
+ * @default false
164
170
  */
165
171
  react?: boolean | ReactOptions;
166
172
  /**
@@ -173,7 +179,7 @@ interface OptionsConfig extends OptionsComponentExts {
173
179
  test?: FlatConfigItem["rules"];
174
180
  typescript?: FlatConfigItem["rules"];
175
181
  unocss?: FlatConfigItem["rules"];
176
- tailwind?: FlatConfigItem["rules"];
182
+ tailwindCSS?: FlatConfigItem["rules"];
177
183
  vue?: FlatConfigItem["rules"];
178
184
  yaml?: FlatConfigItem["rules"];
179
185
  nextjs?: FlatConfigItem["rules"];
@@ -205,13 +211,13 @@ interface OptionsConfig extends OptionsComponentExts {
205
211
  *
206
212
  * @default auto-detect based on the dependencies
207
213
  */
208
- unocss?: boolean;
214
+ unocss?: boolean | UnoCSSOptions;
209
215
  /**
210
216
  * Enable TailwindCSS support.
211
217
  *
212
- * @default auto-detect based on the dependencies
218
+ * @default false
213
219
  */
214
- tailwindcss?: boolean | OptionsTailwindCSS;
220
+ tailwindcss?: boolean | TailwindCSSOptions;
215
221
  /**
216
222
  * Enable Vue support.
217
223
  *
@@ -232,4 +238,4 @@ interface OptionsConfig extends OptionsComponentExts {
232
238
  yaml?: boolean;
233
239
  }
234
240
 
235
- export type { Awaitable as A, ConfigurationOptions as C, FlatConfigItem as F, InEditorOptions as I, NextJSOptions as N, OverrideOptions as O, PerfectionistOptions as P, ReactOptions as R, StylisticOptions as S, UserConfigItem as U, OptionsComponentExts as a, StylisticConfig as b, OptionsTailwindCSS as c, OptionsTypeScriptWithTypes as d, OptionsTypeScriptParserOptions as e, OptionsConfig as f };
241
+ export type { Awaitable as A, ConfigurationOptions as C, FlatConfigItem as F, InEditorOptions as I, NextJSOptions as N, OverrideOptions as O, PerfectionistOptions as P, ReactOptions as R, StylisticOptions as S, TailwindCSSOptions as T, UnoCSSOptions as U, OptionsComponentExts as a, StylisticConfig as b, OptionsTypeScriptWithTypes as c, OptionsTypeScriptParserOptions as d, OptionsConfig as e, UserConfigItem as f };
@@ -70,7 +70,7 @@ interface ReactOptions {
70
70
  interface AstroOptions {
71
71
  a11y?: boolean;
72
72
  }
73
- interface OptionsTailwindCSS {
73
+ interface TailwindCSSOptions {
74
74
  /**
75
75
  * Tell the plugin where the config file is located.
76
76
  * If not provided, the plugin will try to find the config file automatically.
@@ -97,6 +97,12 @@ interface OptionsTailwindCSS {
97
97
  */
98
98
  classRegex?: string;
99
99
  }
100
+ interface UnoCSSOptions {
101
+ /**
102
+ * Are you using UnoCSS Attributify mode?
103
+ */
104
+ attributify?: boolean;
105
+ }
100
106
  type StylisticOptions = Pick<OptionsConfig, "stylistic">;
101
107
  type StylisticConfig = Pick<StylisticCustomizeOptions, "jsx" | "indent" | "quotes" | "semi">;
102
108
  interface OverrideOptions {
@@ -154,13 +160,13 @@ interface OptionsConfig extends OptionsComponentExts {
154
160
  /**
155
161
  * Enable NextJS support.
156
162
  *
157
- * @default auto-detect based on the dependencies
163
+ * @default false
158
164
  */
159
165
  nextjs?: boolean | NextJSOptions;
160
166
  /**
161
167
  * Enable React support.
162
168
  *
163
- * @default auto-detect based on the dependencies
169
+ * @default false
164
170
  */
165
171
  react?: boolean | ReactOptions;
166
172
  /**
@@ -173,7 +179,7 @@ interface OptionsConfig extends OptionsComponentExts {
173
179
  test?: FlatConfigItem["rules"];
174
180
  typescript?: FlatConfigItem["rules"];
175
181
  unocss?: FlatConfigItem["rules"];
176
- tailwind?: FlatConfigItem["rules"];
182
+ tailwindCSS?: FlatConfigItem["rules"];
177
183
  vue?: FlatConfigItem["rules"];
178
184
  yaml?: FlatConfigItem["rules"];
179
185
  nextjs?: FlatConfigItem["rules"];
@@ -205,13 +211,13 @@ interface OptionsConfig extends OptionsComponentExts {
205
211
  *
206
212
  * @default auto-detect based on the dependencies
207
213
  */
208
- unocss?: boolean;
214
+ unocss?: boolean | UnoCSSOptions;
209
215
  /**
210
216
  * Enable TailwindCSS support.
211
217
  *
212
- * @default auto-detect based on the dependencies
218
+ * @default false
213
219
  */
214
- tailwindcss?: boolean | OptionsTailwindCSS;
220
+ tailwindcss?: boolean | TailwindCSSOptions;
215
221
  /**
216
222
  * Enable Vue support.
217
223
  *
@@ -232,4 +238,4 @@ interface OptionsConfig extends OptionsComponentExts {
232
238
  yaml?: boolean;
233
239
  }
234
240
 
235
- export type { Awaitable as A, ConfigurationOptions as C, FlatConfigItem as F, InEditorOptions as I, NextJSOptions as N, OverrideOptions as O, PerfectionistOptions as P, ReactOptions as R, StylisticOptions as S, UserConfigItem as U, OptionsComponentExts as a, StylisticConfig as b, OptionsTailwindCSS as c, OptionsTypeScriptWithTypes as d, OptionsTypeScriptParserOptions as e, OptionsConfig as f };
241
+ export type { Awaitable as A, ConfigurationOptions as C, FlatConfigItem as F, InEditorOptions as I, NextJSOptions as N, OverrideOptions as O, PerfectionistOptions as P, ReactOptions as R, StylisticOptions as S, TailwindCSSOptions as T, UnoCSSOptions as U, OptionsComponentExts as a, StylisticConfig as b, OptionsTypeScriptWithTypes as c, OptionsTypeScriptParserOptions as d, OptionsConfig as e, UserConfigItem as f };
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@luxass/eslint-config",
3
3
  "type": "module",
4
- "version": "4.0.0-beta.7",
5
- "packageManager": "pnpm@8.10.5",
4
+ "version": "4.0.0-beta.9",
5
+ "packageManager": "pnpm@8.11.0",
6
6
  "description": "ESLint config for @luxass",
7
7
  "author": {
8
8
  "name": "Lucas Nørgård",
@@ -72,7 +72,6 @@
72
72
  "peerDependencies": {
73
73
  "@next/eslint-plugin-next": "^14.0.3",
74
74
  "eslint": ">=8.0.0",
75
- "eslint-plugin-astro": "^0.29.1",
76
75
  "eslint-plugin-react": "^7.33.2",
77
76
  "eslint-plugin-react-hooks": "^4.6.0",
78
77
  "eslint-plugin-react-refresh": "^0.4.4",
@@ -93,22 +92,21 @@
93
92
  },
94
93
  "eslint-plugin-tailwindcss": {
95
94
  "optional": true
96
- },
97
- "eslint-plugin-astro": {
98
- "optional": true
99
95
  }
100
96
  },
101
97
  "dependencies": {
102
98
  "@antfu/eslint-define-config": "^1.23.0-2",
99
+ "@antfu/install-pkg": "^0.2.0",
103
100
  "@eslint-types/jsdoc": "46.9.0",
104
101
  "@eslint-types/typescript-eslint": "^6.12.0",
105
102
  "@eslint-types/unicorn": "^49.0.0",
106
- "@stylistic/eslint-plugin": "^1.4.0",
103
+ "@stylistic/eslint-plugin": "^1.4.1",
107
104
  "@typescript-eslint/eslint-plugin": "^6.12.0",
108
105
  "@typescript-eslint/parser": "^6.12.0",
109
106
  "@unocss/eslint-plugin": "^0.57.7",
110
107
  "eslint-config-flat-gitignore": "^0.1.1",
111
- "eslint-plugin-antfu": "^1.0.10",
108
+ "eslint-plugin-antfu": "^1.0.11",
109
+ "eslint-plugin-astro": "^0.29.1",
112
110
  "eslint-plugin-eslint-comments": "^3.2.0",
113
111
  "eslint-plugin-i": "^2.29.0",
114
112
  "eslint-plugin-jsdoc": "^46.9.0",
@@ -117,7 +115,7 @@
117
115
  "eslint-plugin-markdown": "^3.0.1",
118
116
  "eslint-plugin-n": "^16.3.1",
119
117
  "eslint-plugin-no-only-tests": "^3.1.0",
120
- "eslint-plugin-perfectionist": "^2.4.0",
118
+ "eslint-plugin-perfectionist": "^2.4.2",
121
119
  "eslint-plugin-sort-keys": "^2.3.5",
122
120
  "eslint-plugin-unicorn": "^49.0.0",
123
121
  "eslint-plugin-unused-imports": "^3.0.0",
@@ -128,16 +126,17 @@
128
126
  "jsonc-eslint-parser": "^2.4.0",
129
127
  "local-pkg": "^0.5.0",
130
128
  "parse-gitignore": "^2.0.0",
129
+ "prompts": "^2.4.2",
131
130
  "vue-eslint-parser": "^9.3.2",
132
131
  "yaml-eslint-parser": "^1.2.2"
133
132
  },
134
133
  "devDependencies": {
135
134
  "@next/eslint-plugin-next": "^14.0.3",
136
- "@stylistic/eslint-plugin-migrate": "^1.4.0",
135
+ "@stylistic/eslint-plugin-migrate": "^1.4.1",
137
136
  "@types/eslint": "^8.44.7",
138
137
  "@types/node": "^18.17.19",
138
+ "@types/prompts": "^2.4.9",
139
139
  "eslint": "^8.54.0",
140
- "eslint-plugin-astro": "^0.29.1",
141
140
  "eslint-plugin-react": "^7.33.2",
142
141
  "eslint-plugin-react-hooks": "^4.6.0",
143
142
  "eslint-plugin-react-refresh": "^0.4.4",
@@ -1,29 +0,0 @@
1
- // src/utils.ts
2
- async function combine(...configs) {
3
- const resolved = await Promise.all(configs);
4
- return resolved.flat();
5
- }
6
- function renameRules(rules, from, to) {
7
- return Object.fromEntries(
8
- Object.entries(rules).map(([key, value]) => {
9
- if (key.startsWith(from)) {
10
- return [to + key.slice(from.length), value];
11
- }
12
- return [key, value];
13
- })
14
- );
15
- }
16
- function toArray(value) {
17
- return Array.isArray(value) ? value : [value];
18
- }
19
- async function interop(m) {
20
- const resolved = await m;
21
- return resolved.default || resolved;
22
- }
23
-
24
- export {
25
- combine,
26
- renameRules,
27
- toArray,
28
- interop
29
- };
@@ -1,23 +0,0 @@
1
- import {
2
- interop
3
- } from "./chunk-4VUK6ART.mjs";
4
-
5
- // src/configs/unocss.ts
6
- async function unocss() {
7
- const pluginUnoCSS = await interop(import("@unocss/eslint-plugin"));
8
- return [
9
- {
10
- name: "luxass:unocss",
11
- plugins: {
12
- "@unocss": pluginUnoCSS
13
- },
14
- rules: {
15
- ...pluginUnoCSS.configs.recommended.rules
16
- }
17
- }
18
- ];
19
- }
20
-
21
- export {
22
- unocss
23
- };