@luxass/eslint-config 4.0.0-beta.9 → 4.0.1

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 (149) hide show
  1. package/README.md +351 -48
  2. package/dist/{chunk-TQ476NL2.mjs → chunk-4YBQZLPS.mjs} +13 -2
  3. package/dist/{chunk-NDNDG7BH.mjs → chunk-5NK24IKQ.mjs} +2 -5
  4. package/dist/{chunk-2SW2E3TH.mjs → chunk-5SDSWPKR.mjs} +14 -4
  5. package/dist/chunk-6T7MXPCT.mjs +17 -0
  6. package/dist/{chunk-SPQZTV4E.mjs → chunk-7R4FYLS2.mjs} +19 -14
  7. package/dist/{chunk-ADP4MYOS.mjs → chunk-ANUYBAYV.mjs} +1 -1
  8. package/dist/{chunk-R4NSLRAE.mjs → chunk-ATRL3UZP.mjs} +14 -8
  9. package/dist/{chunk-P3N5WLFL.mjs → chunk-BXBN56WI.mjs} +11 -7
  10. package/dist/chunk-CJ3ZUYUJ.mjs +183 -0
  11. package/dist/chunk-DAJA5AV3.mjs +29 -0
  12. package/dist/{chunk-FK567E7G.mjs → chunk-DVQQVCGF.mjs} +7 -3
  13. package/dist/chunk-FU5SRKZU.mjs +104 -0
  14. package/dist/{chunk-LQLF2CMA.mjs → chunk-GBLPCM3X.mjs} +14 -17
  15. package/dist/chunk-KJ7ZCBK4.mjs +48 -0
  16. package/dist/{chunk-QZTI72NS.mjs → chunk-PYS26PF3.mjs} +13 -9
  17. package/dist/chunk-Q57BF3CR.mjs +63 -0
  18. package/dist/{chunk-3QHLEAXK.mjs → chunk-RDZJT36Z.mjs} +22 -8
  19. package/dist/chunk-RNFKNSHW.mjs +293 -0
  20. package/dist/{chunk-HE56XDG6.mjs → chunk-RVSUTDCE.mjs} +15 -5
  21. package/dist/chunk-UMUUVFB7.mjs +69 -0
  22. package/dist/{chunk-NUG6FLHN.mjs → chunk-VZ2YFMWH.mjs} +54 -11
  23. package/dist/chunk-WDSV2EFG.mjs +7 -0
  24. package/dist/{chunk-M5WNLLBT.mjs → chunk-WOYZWHPM.mjs} +20 -7
  25. package/dist/chunk-WRURTO5T.mjs +144 -0
  26. package/dist/{chunk-BAKUP7QM.mjs → chunk-Z7F6QSYQ.mjs} +44 -34
  27. package/dist/configs/astro.cjs +11 -21
  28. package/dist/configs/astro.d.cts +3 -6
  29. package/dist/configs/astro.d.ts +3 -6
  30. package/dist/configs/astro.mjs +3 -3
  31. package/dist/configs/comments.cjs +9 -12
  32. package/dist/configs/comments.d.cts +3 -2
  33. package/dist/configs/comments.d.ts +3 -2
  34. package/dist/configs/comments.mjs +1 -2
  35. package/dist/configs/formatters.cjs +274 -0
  36. package/dist/configs/formatters.d.cts +11 -0
  37. package/dist/configs/formatters.d.ts +11 -0
  38. package/dist/configs/formatters.mjs +9 -0
  39. package/dist/configs/ignores.cjs +1 -8
  40. package/dist/configs/ignores.d.cts +3 -2
  41. package/dist/configs/ignores.d.ts +3 -2
  42. package/dist/configs/ignores.mjs +2 -2
  43. package/dist/configs/imports.cjs +35 -9
  44. package/dist/configs/imports.d.cts +13 -4
  45. package/dist/configs/imports.d.ts +13 -4
  46. package/dist/configs/imports.mjs +2 -2
  47. package/dist/configs/index.cjs +1487 -1074
  48. package/dist/configs/index.d.cts +7 -18
  49. package/dist/configs/index.d.ts +7 -18
  50. package/dist/configs/index.mjs +40 -36
  51. package/dist/configs/javascript.cjs +16 -23
  52. package/dist/configs/javascript.d.cts +3 -6
  53. package/dist/configs/javascript.d.ts +3 -6
  54. package/dist/configs/javascript.mjs +2 -3
  55. package/dist/configs/jsdoc.cjs +6 -2
  56. package/dist/configs/jsdoc.d.cts +17 -4
  57. package/dist/configs/jsdoc.d.ts +17 -4
  58. package/dist/configs/jsdoc.mjs +2 -2
  59. package/dist/configs/jsonc.cjs +8 -11
  60. package/dist/configs/jsonc.d.cts +3 -6
  61. package/dist/configs/jsonc.d.ts +3 -6
  62. package/dist/configs/jsonc.mjs +3 -3
  63. package/dist/configs/markdown.cjs +46 -35
  64. package/dist/configs/markdown.d.cts +25 -4
  65. package/dist/configs/markdown.d.ts +25 -4
  66. package/dist/configs/markdown.mjs +3 -3
  67. package/dist/configs/nextjs.cjs +13 -11
  68. package/dist/configs/nextjs.d.cts +3 -6
  69. package/dist/configs/nextjs.d.ts +3 -6
  70. package/dist/configs/nextjs.mjs +3 -3
  71. package/dist/configs/node.cjs +0 -10
  72. package/dist/configs/node.d.cts +3 -2
  73. package/dist/configs/node.d.ts +3 -2
  74. package/dist/configs/node.mjs +1 -2
  75. package/dist/configs/perfectionist.cjs +2 -20
  76. package/dist/configs/perfectionist.d.cts +4 -3
  77. package/dist/configs/perfectionist.d.ts +4 -3
  78. package/dist/configs/perfectionist.mjs +1 -2
  79. package/dist/configs/react.cjs +206 -203
  80. package/dist/configs/react.d.cts +3 -6
  81. package/dist/configs/react.d.ts +3 -6
  82. package/dist/configs/react.mjs +3 -3
  83. package/dist/configs/sort.cjs +6 -6
  84. package/dist/configs/sort.d.cts +3 -2
  85. package/dist/configs/sort.d.ts +3 -2
  86. package/dist/configs/sort.mjs +1 -1
  87. package/dist/configs/stylistic.cjs +20 -11
  88. package/dist/configs/stylistic.d.cts +4 -7
  89. package/dist/configs/stylistic.d.ts +4 -7
  90. package/dist/configs/stylistic.mjs +4 -3
  91. package/dist/configs/tailwindcss.cjs +33 -47
  92. package/dist/configs/tailwindcss.d.cts +3 -6
  93. package/dist/configs/tailwindcss.d.ts +3 -6
  94. package/dist/configs/tailwindcss.mjs +3 -3
  95. package/dist/configs/test.cjs +103 -16
  96. package/dist/configs/test.d.cts +3 -6
  97. package/dist/configs/test.d.ts +3 -6
  98. package/dist/configs/test.mjs +4 -3
  99. package/dist/configs/toml.cjs +131 -0
  100. package/dist/configs/toml.d.cts +11 -0
  101. package/dist/configs/toml.d.ts +11 -0
  102. package/dist/configs/toml.mjs +8 -0
  103. package/dist/configs/typescript.cjs +39 -43
  104. package/dist/configs/typescript.d.cts +3 -6
  105. package/dist/configs/typescript.d.ts +3 -6
  106. package/dist/configs/typescript.mjs +3 -4
  107. package/dist/configs/unicorn.cjs +13 -10
  108. package/dist/configs/unicorn.d.cts +3 -2
  109. package/dist/configs/unicorn.d.ts +3 -2
  110. package/dist/configs/unicorn.mjs +1 -2
  111. package/dist/configs/unocss.cjs +48 -20
  112. package/dist/configs/unocss.d.cts +3 -6
  113. package/dist/configs/unocss.d.ts +3 -6
  114. package/dist/configs/unocss.mjs +3 -3
  115. package/dist/configs/vue.cjs +51 -15
  116. package/dist/configs/vue.d.cts +3 -6
  117. package/dist/configs/vue.d.ts +3 -6
  118. package/dist/configs/vue.mjs +3 -3
  119. package/dist/configs/yaml.cjs +17 -11
  120. package/dist/configs/yaml.d.cts +3 -6
  121. package/dist/configs/yaml.d.ts +3 -6
  122. package/dist/configs/yaml.mjs +3 -3
  123. package/dist/custom-rules/utils.cjs +31 -0
  124. package/dist/custom-rules/utils.d.cts +6 -0
  125. package/dist/custom-rules/utils.d.ts +6 -0
  126. package/dist/custom-rules/utils.mjs +6 -0
  127. package/dist/globs.cjs +157 -0
  128. package/dist/globs.d.cts +28 -0
  129. package/dist/globs.d.ts +28 -0
  130. package/dist/globs.mjs +56 -0
  131. package/dist/index.cjs +1267 -839
  132. package/dist/index.d.cts +10 -44
  133. package/dist/index.d.ts +10 -44
  134. package/dist/index.mjs +106 -146
  135. package/dist/types-spTEGSaV.d.cts +632 -0
  136. package/dist/types-spTEGSaV.d.ts +632 -0
  137. package/package.json +69 -37
  138. package/dist/chunk-24KJPXII.mjs +0 -51
  139. package/dist/chunk-4HH6LYJ6.mjs +0 -25
  140. package/dist/chunk-AL47KNVD.mjs +0 -37
  141. package/dist/chunk-C5VMTRKT.mjs +0 -18
  142. package/dist/chunk-ERFDRAGW.mjs +0 -86
  143. package/dist/chunk-HLDEUDLN.mjs +0 -28
  144. package/dist/chunk-O4O6V7LI.mjs +0 -70
  145. package/dist/chunk-UBPIYSHC.mjs +0 -284
  146. package/dist/types-h9izbkUX.d.cts +0 -241
  147. package/dist/types-h9izbkUX.d.ts +0 -241
  148. package/dist/{chunk-FKAOMYGL.mjs → chunk-ME2OAMS3.mjs} +0 -0
  149. package/dist/{chunk-FOIFEV73.mjs → chunk-XBASVDU6.mjs} +6 -6
@@ -1,241 +0,0 @@
1
- import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
2
- import { ParserOptions } from '@typescript-eslint/parser';
3
- import { FlatESLintConfigItem, MergeIntersection, RenamePrefix, VitestRules, YmlRules, NRules, Prefix, ImportRules, EslintRules, JsoncRules, VueRules, EslintCommentsRules, RuleConfig } from '@antfu/eslint-define-config';
4
- import { RuleOptions as RuleOptions$1 } from '@eslint-types/jsdoc/types';
5
- import { RuleOptions } from '@eslint-types/typescript-eslint/types';
6
- import { RuleOptions as RuleOptions$2 } from '@eslint-types/unicorn/types';
7
- import { Rules as Rules$1 } from 'eslint-plugin-antfu';
8
- import { StylisticCustomizeOptions, UnprefixedRuleOptions } from '@stylistic/eslint-plugin';
9
- import { Linter } from 'eslint';
10
-
11
- type WrapRuleConfig<T extends {
12
- [key: string]: any;
13
- }> = {
14
- [K in keyof T]: T[K] extends RuleConfig ? T[K] : RuleConfig<T[K]>;
15
- };
16
- type Awaitable<T> = T | Promise<T>;
17
- type Rules = WrapRuleConfig<MergeIntersection<RenamePrefix<RuleOptions, "@typescript-eslint/", "ts/"> & RenamePrefix<VitestRules, "vitest/", "test/"> & RenamePrefix<YmlRules, "yml/", "yaml/"> & RenamePrefix<NRules, "n/", "node/"> & Prefix<UnprefixedRuleOptions, "style/"> & Prefix<Rules$1, "antfu/"> & RuleOptions$1 & ImportRules & EslintRules & JsoncRules & VueRules & RuleOptions$2 & EslintCommentsRules & {
18
- "test/no-only-tests": RuleConfig<any[]>;
19
- }>>;
20
- type FlatConfigItem = Omit<FlatESLintConfigItem<Rules, false>, "plugins"> & {
21
- /**
22
- * Custom name of each config item
23
- */
24
- name?: string;
25
- /**
26
- * 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.
27
- *
28
- * @see [Using plugins in your configuration](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#using-plugins-in-your-configuration)
29
- */
30
- plugins?: Record<string, any>;
31
- };
32
- type UserConfigItem = FlatConfigItem | Linter.FlatConfig;
33
- interface OptionsComponentExts {
34
- /**
35
- * Additional extensions for components.
36
- *
37
- * @example ["vue"]
38
- * @default []
39
- */
40
- componentExts?: string[];
41
- }
42
- interface OptionsTypeScriptParserOptions {
43
- /**
44
- * Additional parser options for TypeScript.
45
- */
46
- parserOptions?: Partial<ParserOptions>;
47
- }
48
- interface OptionsTypeScriptWithTypes {
49
- /**
50
- * When this options is provided, type aware rules will be enabled.
51
- * @see https://typescript-eslint.io/linting/typed-linting/
52
- */
53
- tsconfigPath?: string | string[];
54
- }
55
- type ConfigurationOptions<TConfigs extends keyof OptionsConfig> = {
56
- [K in TConfigs]?: boolean;
57
- };
58
- interface NextJSOptions {
59
- /**
60
- * Tell the plugin where the root directory is.
61
- * @see https://nextjs.org/docs/app/building-your-application/configuring/eslint#rootdir
62
- *
63
- * @default true
64
- */
65
- rootDir?: boolean | string;
66
- }
67
- interface ReactOptions {
68
- a11y?: boolean;
69
- }
70
- interface AstroOptions {
71
- a11y?: boolean;
72
- }
73
- interface TailwindCSSOptions {
74
- /**
75
- * Tell the plugin where the config file is located.
76
- * If not provided, the plugin will try to find the config file automatically.
77
- */
78
- config?: string;
79
- /**
80
- * Tell the plugin to remove duplicate classes.
81
- *
82
- * @default true
83
- */
84
- removeDuplicates?: boolean;
85
- /**
86
- * Tell the plugin which function names to look for.
87
- * @default ["classnames", "clsx", "cx", "cn"]
88
- *
89
- * If NextJS is enabled, the default value will also include `tw`
90
- * to support NextJS's Image Response.
91
- */
92
- callees?: string[];
93
- /**
94
- * Tell the plugin which class regex to look for.
95
- *
96
- * @default "^class(Name)?$"
97
- */
98
- classRegex?: string;
99
- }
100
- interface UnoCSSOptions {
101
- /**
102
- * Are you using UnoCSS Attributify mode?
103
- */
104
- attributify?: boolean;
105
- }
106
- type StylisticOptions = Pick<OptionsConfig, "stylistic">;
107
- type StylisticConfig = Pick<StylisticCustomizeOptions, "jsx" | "indent" | "quotes" | "semi">;
108
- interface OverrideOptions {
109
- overrides?: FlatConfigItem["rules"];
110
- }
111
- interface InEditorOptions {
112
- isEditor?: boolean;
113
- }
114
- interface PerfectionistOptions {
115
- enableAllRules?: boolean;
116
- }
117
- interface OptionsConfig extends OptionsComponentExts {
118
- /**
119
- * Enable gitignore support.
120
- *
121
- * Passing an object to configure the options.
122
- *
123
- * @see https://github.com/antfu/eslint-config-flat-gitignore
124
- * @default true
125
- */
126
- gitignore?: FlatGitignoreOptions | boolean;
127
- /**
128
- * Control to disable some rules in editors.
129
- * @default auto-detect based on the process.env
130
- */
131
- isEditor?: boolean;
132
- /**
133
- * Enable JSONC support.
134
- *
135
- * @default true
136
- */
137
- jsonc?: boolean;
138
- /**
139
- * Enable JSX related rules.
140
- *
141
- * Currently only stylistic rules are included.
142
- *
143
- * @default true
144
- */
145
- jsx?: boolean;
146
- /**
147
- * Enable Markdown support.
148
- *
149
- * @default true
150
- */
151
- markdown?: boolean;
152
- /**
153
- * Enable Perfectionist rules.
154
- *
155
- * @default false
156
- *
157
- * NOTE: This plugin has some very opinionated rules, use with caution.
158
- */
159
- perfectionist?: boolean;
160
- /**
161
- * Enable NextJS support.
162
- *
163
- * @default false
164
- */
165
- nextjs?: boolean | NextJSOptions;
166
- /**
167
- * Enable React support.
168
- *
169
- * @default false
170
- */
171
- react?: boolean | ReactOptions;
172
- /**
173
- * Provide overrides for rules for each integration.
174
- */
175
- overrides?: {
176
- javascript?: FlatConfigItem["rules"];
177
- jsonc?: FlatConfigItem["rules"];
178
- markdown?: FlatConfigItem["rules"];
179
- test?: FlatConfigItem["rules"];
180
- typescript?: FlatConfigItem["rules"];
181
- unocss?: FlatConfigItem["rules"];
182
- tailwindCSS?: FlatConfigItem["rules"];
183
- vue?: FlatConfigItem["rules"];
184
- yaml?: FlatConfigItem["rules"];
185
- nextjs?: FlatConfigItem["rules"];
186
- react?: FlatConfigItem["rules"];
187
- astro?: FlatConfigItem["rules"];
188
- };
189
- /**
190
- * Enable stylistic rules.
191
- *
192
- * @default true
193
- */
194
- stylistic?: StylisticConfig | boolean;
195
- /**
196
- * Enable test support.
197
- *
198
- * @default true
199
- */
200
- test?: boolean;
201
- /**
202
- * Enable TypeScript support.
203
- *
204
- * Passing an object to enable TypeScript Language Server support.
205
- *
206
- * @default auto-detect based on the dependencies
207
- */
208
- typescript?: OptionsTypeScriptParserOptions | OptionsTypeScriptWithTypes | boolean;
209
- /**
210
- * Enable UnoCSS support.
211
- *
212
- * @default auto-detect based on the dependencies
213
- */
214
- unocss?: boolean | UnoCSSOptions;
215
- /**
216
- * Enable TailwindCSS support.
217
- *
218
- * @default false
219
- */
220
- tailwindcss?: boolean | TailwindCSSOptions;
221
- /**
222
- * Enable Vue support.
223
- *
224
- * @default auto-detect based on the dependencies
225
- */
226
- vue?: boolean;
227
- /**
228
- * Enable Astro support.
229
- *
230
- * @default auto-detect based on the dependencies
231
- */
232
- astro?: boolean | AstroOptions;
233
- /**
234
- * Enable YAML support.
235
- *
236
- * @default true
237
- */
238
- yaml?: boolean;
239
- }
240
-
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 };
File without changes
@@ -2,8 +2,8 @@
2
2
  function sortPackageJson() {
3
3
  return [
4
4
  {
5
- files: ["**/package.json"],
6
5
  name: "luxass:sort-package-json",
6
+ files: ["**/package.json"],
7
7
  rules: {
8
8
  "jsonc/sort-array-values": [
9
9
  "error",
@@ -16,15 +16,15 @@ function sortPackageJson() {
16
16
  "error",
17
17
  {
18
18
  order: [
19
- "publisher",
20
19
  "name",
21
20
  "displayName",
22
- "type",
23
21
  "version",
24
- "private",
25
- "packageManager",
26
22
  "description",
23
+ "type",
24
+ "private",
27
25
  "author",
26
+ "publisher",
27
+ "packageManager",
28
28
  "license",
29
29
  "funding",
30
30
  "homepage",
@@ -86,8 +86,8 @@ function sortPackageJson() {
86
86
  function sortTsconfig() {
87
87
  return [
88
88
  {
89
- files: ["**/tsconfig.json", "**/tsconfig.*.json"],
90
89
  name: "luxass:sort-tsconfig",
90
+ files: ["**/tsconfig.json", "**/tsconfig.*.json"],
91
91
  rules: {
92
92
  "jsonc/sort-keys": [
93
93
  "error",