@hexadrop/eslint-config 0.0.1-beta.1 → 0.0.1-beta.3

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
@@ -1301,6 +1301,7 @@ async function stylistic(options) {
1301
1301
  [`${stylisticPluginRename}/line-comment-position`]: ["error", { position: "above" }],
1302
1302
  [`${stylisticPluginRename}/max-len`]: "off",
1303
1303
  [`${stylisticPluginRename}/multiline-comment-style`]: ["error", "starred-block"],
1304
+ [`${stylisticPluginRename}/multiline-ternary`]: "off",
1304
1305
  [`${stylisticPluginRename}/no-extra-semi`]: "error",
1305
1306
  [`${stylisticPluginRename}/padding-line-between-statements`]: [
1306
1307
  "error",
@@ -1882,13 +1883,19 @@ function defaultOptions(options = {}) {
1882
1883
  } else if (installedTypescript) {
1883
1884
  if (options.typescript === void 0) {
1884
1885
  typescript2 = getCwdTsconfigPath() ?? true;
1885
- } else if (options.typescript === "string" || Array.isArray(options.typescript)) {
1886
+ } else if (options.typescript === "string") {
1886
1887
  typescript2 = options.typescript.length > 0 ? options.typescript : true;
1888
+ } else if (Array.isArray(options.typescript)) {
1889
+ typescript2 = options.typescript.length > 0 ? options.typescript.filter(Boolean) : true;
1887
1890
  }
1888
1891
  }
1889
1892
  return {
1890
1893
  astro: options.astro ?? installedAstro,
1891
- ignore: options.ignore ?? true,
1894
+ ignore: typeof options.ignore === "object" ? {
1895
+ ...options.ignore,
1896
+ files: typeof options.ignore.files === "string" ? options.ignore.files : options.ignore.files?.filter(Boolean) ?? [],
1897
+ globs: options.ignore.globs?.filter(Boolean) ?? []
1898
+ } : options.ignore ?? true,
1892
1899
  imports: options.imports ?? true,
1893
1900
  json: options.json ?? true,
1894
1901
  markdown: options.markdown ?? true,
@@ -1898,7 +1905,11 @@ function defaultOptions(options = {}) {
1898
1905
  node: true,
1899
1906
  webpack: false,
1900
1907
  ...options.module,
1901
- ignore: [String.raw`bun\:.*`, String.raw`astro\:.*`, ...options.module?.ignore ?? []]
1908
+ ignore: [
1909
+ String.raw`bun\:.*`,
1910
+ String.raw`astro\:.*`,
1911
+ ...options.module?.ignore?.filter(Boolean) ?? []
1912
+ ]
1902
1913
  },
1903
1914
  node: options.node ?? true,
1904
1915
  react: options.react ?? installedReact,
package/dist/index.d.cts CHANGED
@@ -2,226 +2,6 @@ import { ResolvableFlatConfig, FlatConfigComposer } from 'eslint-flat-config-uti
2
2
  import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
3
3
  import { Linter } from 'eslint';
4
4
 
5
- interface HexadropEslintIgnoreOptions extends Omit<FlatGitignoreOptions, 'name'> {
6
- /**
7
- * Additional ignore patterns.
8
- */
9
- globs?: string[];
10
- }
11
-
12
- interface HexadropEslintModulesOptions {
13
- amd: boolean;
14
- commonjs: boolean;
15
- ignore: string[];
16
- /**
17
- * Enable use of core node modules.
18
- *
19
- * @default true
20
- */
21
- node: boolean;
22
- /**
23
- * Enable webpack support.
24
- *
25
- * @default false
26
- */
27
- webpack: boolean;
28
- }
29
-
30
- interface HexadropEslintStylisticOptions {
31
- /**
32
- * Include parentheses around a sole arrow function parameter.
33
- *
34
- * @default 'avoid'
35
- */
36
- arrowParens: 'always' | 'avoid';
37
- /**
38
- * Which brace style to use
39
- *
40
- * @default '1tbs'
41
- */
42
- braceStyle: '1tbs' | 'allman' | 'stroustrup';
43
- /**
44
- * Put the > of a multi-line HTML (HTML, JSX, Vue, Angular) element
45
- * at the end of the last line instead of being alone on the next line.
46
- *
47
- * @default true
48
- */
49
- bracketSameLine: boolean;
50
- /**
51
- * Use spaces between brackets in object literals.
52
- *
53
- * @default true
54
- */
55
- bracketSpacing: boolean;
56
- /**
57
- * End of line character.
58
- *
59
- * @default 'lf'
60
- */
61
- endOfLine: 'auto' | 'cr' | 'crlf' | 'lf';
62
- /**
63
- * Enable formatting rules.
64
- *
65
- * @default true
66
- */
67
- format: boolean;
68
- /**
69
- * Enable import rules.
70
- *
71
- * @default true
72
- */
73
- imports: boolean;
74
- /**
75
- * Indentation style.
76
- *
77
- * @default 'tab'
78
- */
79
- indent: 'space' | 'tab';
80
- /**
81
- * Number of spaces to use for indentation.
82
- *
83
- * @default 4
84
- */
85
- indentSize: number;
86
- /**
87
- * Enable perfectionist rules.
88
- *
89
- * @default true
90
- */
91
- perfectionist: boolean;
92
- /**
93
- * Specify the line length that the printer will wrap on.
94
- *
95
- * @default 120
96
- */
97
- printWidth: number;
98
- /**
99
- * Change when properties in objects are quoted.
100
- *
101
- * @default 'as-needed'
102
- */
103
- quoteProps: 'as-needed' | 'consistent' | 'preserve';
104
- /**
105
- * Quote style.
106
- *
107
- * @default 'single'
108
- */
109
- quotes: 'double' | 'single';
110
- /**
111
- * Use semicolons at the end of statements.
112
- *
113
- * @default true
114
- */
115
- semicolons: boolean;
116
- /**
117
- * Use single attribute per line in HTML, Vue and JSX.
118
- *
119
- * @default false
120
- */
121
- singleAttributePerLine: boolean;
122
- /**
123
- * Use trailing commas in multi-line object literals.
124
- *
125
- * @default 'es5'
126
- */
127
- trailingComma: 'all' | 'es5' | 'none';
128
- /**
129
- * Enable unicorn rules.
130
- *
131
- * @default true
132
- */
133
- unicorn: boolean;
134
- }
135
-
136
- interface HexadropEslintOptions {
137
- /**
138
- * Enable astro support.
139
- *
140
- * If `false`, astro support will be disabled.
141
- * If `true`, or empty it will be enabled.
142
- */
143
- astro: boolean;
144
- /**
145
- * Enable ignore support.
146
- *
147
- * Passing an object to configure the options.
148
- *
149
- * @see https://github.com/antfu/eslint-config-flat-gitignore
150
- *
151
- * @default true
152
- */
153
- ignore: HexadropEslintIgnoreOptions | boolean;
154
- /**
155
- * Enable import rules.
156
- *
157
- * @default true
158
- */
159
- imports: boolean;
160
- /**
161
- * Enable json support.
162
- *
163
- * @default true
164
- */
165
- json: boolean;
166
- /**
167
- * Enable markdown support.
168
- *
169
- * @default true
170
- */
171
- markdown: boolean;
172
- /**
173
- * Configure module imports.
174
- *
175
- * @default { amd: false, commonjs: false, node: true, webpack: false }
176
- */
177
- module: HexadropEslintModulesOptions;
178
- /**
179
- * Use node rules.
180
- *
181
- * @default true
182
- */
183
- node: boolean;
184
- /**
185
- * Enable react support.
186
- *
187
- * If `false`, react support will be disabled.
188
- * If `true`, or empty it will be enabled.
189
- */
190
- react: boolean;
191
- /**
192
- * Configure stylistic rules.
193
- *
194
- * @default {
195
- * arrowParens: 'avoid',
196
- * braceStyle: '1tbs',
197
- * bracketSameLine: true,
198
- * bracketSpacing: true,
199
- * endOfLine: 'lf',
200
- * format: true,
201
- * imports: true,
202
- * indent: 'tab',
203
- * indentSize: 4,
204
- * perfectionist: true,
205
- * quoteProps: 'as-needed',
206
- * quotes: 'single',
207
- * semicolons: true,
208
- * singleAttributePerLine: true,
209
- * trailingComma: 'es5',
210
- * unicorn: true,
211
- * }
212
- */
213
- stylistic: HexadropEslintStylisticOptions | false;
214
- /**
215
- * Configure typescript support.
216
- *
217
- * If `false`, typescript support will be disabled.
218
- * If `true`, typescript support will be enabled with default options.
219
- * If you leave empty, automatic detection will be used.
220
- *
221
- */
222
- typescript: boolean | string | string[];
223
- }
224
-
225
5
  type Awaitable<T> = Promise<T> | T;
226
6
 
227
7
  declare const ASTRO_CONFIG_NAME_SETUP: "hexadrop/astro/setup";
@@ -287,6 +67,10 @@ type TypescriptConfigNames = typeof TYPESCRIPT_CONFIG_NAME_RULES | typeof TYPESC
287
67
 
288
68
  type ConfigNames = AstroConfigNames | CoreConfigNames | IgnoreConfigNames | JsonConfigNames | MarkdownConfigNames | ReactConfigNames | StylisticConfigNames | TypescriptConfigNames;
289
69
 
70
+ type RecursivePartial<T> = {
71
+ [P in keyof T]?: RecursivePartial<T[P]>;
72
+ };
73
+
290
74
  /* eslint-disable */
291
75
  /* prettier-ignore */
292
76
 
@@ -10809,7 +10593,227 @@ type TypedFlatConfigItem = {
10809
10593
  rules?: Linter.RulesRecord & Rules;
10810
10594
  } & Linter.FlatConfig;
10811
10595
 
10812
- declare function hexadrop(optionsOrFlatConfigItem?: Partial<HexadropEslintOptions> & TypedFlatConfigItem, ...configs: ResolvableFlatConfig<TypedFlatConfigItem>[]): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
10596
+ interface HexadropEslintIgnoreOptions extends Omit<FlatGitignoreOptions, 'name'> {
10597
+ /**
10598
+ * Additional ignore patterns.
10599
+ */
10600
+ globs?: string[];
10601
+ }
10602
+
10603
+ interface HexadropEslintModulesOptions {
10604
+ amd: boolean;
10605
+ commonjs: boolean;
10606
+ ignore: string[];
10607
+ /**
10608
+ * Enable use of core node modules.
10609
+ *
10610
+ * @default true
10611
+ */
10612
+ node: boolean;
10613
+ /**
10614
+ * Enable webpack support.
10615
+ *
10616
+ * @default false
10617
+ */
10618
+ webpack: boolean;
10619
+ }
10620
+
10621
+ interface HexadropEslintStylisticOptions {
10622
+ /**
10623
+ * Include parentheses around a sole arrow function parameter.
10624
+ *
10625
+ * @default 'avoid'
10626
+ */
10627
+ arrowParens: 'always' | 'avoid';
10628
+ /**
10629
+ * Which brace style to use
10630
+ *
10631
+ * @default '1tbs'
10632
+ */
10633
+ braceStyle: '1tbs' | 'allman' | 'stroustrup';
10634
+ /**
10635
+ * Put the > of a multi-line HTML (HTML, JSX, Vue, Angular) element
10636
+ * at the end of the last line instead of being alone on the next line.
10637
+ *
10638
+ * @default true
10639
+ */
10640
+ bracketSameLine: boolean;
10641
+ /**
10642
+ * Use spaces between brackets in object literals.
10643
+ *
10644
+ * @default true
10645
+ */
10646
+ bracketSpacing: boolean;
10647
+ /**
10648
+ * End of line character.
10649
+ *
10650
+ * @default 'lf'
10651
+ */
10652
+ endOfLine: 'auto' | 'cr' | 'crlf' | 'lf';
10653
+ /**
10654
+ * Enable formatting rules.
10655
+ *
10656
+ * @default true
10657
+ */
10658
+ format: boolean;
10659
+ /**
10660
+ * Enable import rules.
10661
+ *
10662
+ * @default true
10663
+ */
10664
+ imports: boolean;
10665
+ /**
10666
+ * Indentation style.
10667
+ *
10668
+ * @default 'tab'
10669
+ */
10670
+ indent: 'space' | 'tab';
10671
+ /**
10672
+ * Number of spaces to use for indentation.
10673
+ *
10674
+ * @default 4
10675
+ */
10676
+ indentSize: number;
10677
+ /**
10678
+ * Enable perfectionist rules.
10679
+ *
10680
+ * @default true
10681
+ */
10682
+ perfectionist: boolean;
10683
+ /**
10684
+ * Specify the line length that the printer will wrap on.
10685
+ *
10686
+ * @default 120
10687
+ */
10688
+ printWidth: number;
10689
+ /**
10690
+ * Change when properties in objects are quoted.
10691
+ *
10692
+ * @default 'as-needed'
10693
+ */
10694
+ quoteProps: 'as-needed' | 'consistent' | 'preserve';
10695
+ /**
10696
+ * Quote style.
10697
+ *
10698
+ * @default 'single'
10699
+ */
10700
+ quotes: 'double' | 'single';
10701
+ /**
10702
+ * Use semicolons at the end of statements.
10703
+ *
10704
+ * @default true
10705
+ */
10706
+ semicolons: boolean;
10707
+ /**
10708
+ * Use single attribute per line in HTML, Vue and JSX.
10709
+ *
10710
+ * @default false
10711
+ */
10712
+ singleAttributePerLine: boolean;
10713
+ /**
10714
+ * Use trailing commas in multi-line object literals.
10715
+ *
10716
+ * @default 'es5'
10717
+ */
10718
+ trailingComma: 'all' | 'es5' | 'none';
10719
+ /**
10720
+ * Enable unicorn rules.
10721
+ *
10722
+ * @default true
10723
+ */
10724
+ unicorn: boolean;
10725
+ }
10726
+
10727
+ interface HexadropEslintOptions {
10728
+ /**
10729
+ * Enable astro support.
10730
+ *
10731
+ * If `false`, astro support will be disabled.
10732
+ * If `true`, or empty it will be enabled.
10733
+ */
10734
+ astro: boolean;
10735
+ /**
10736
+ * Enable ignore support.
10737
+ *
10738
+ * Passing an object to configure the options.
10739
+ *
10740
+ * @see https://github.com/antfu/eslint-config-flat-gitignore
10741
+ *
10742
+ * @default true
10743
+ */
10744
+ ignore: HexadropEslintIgnoreOptions | boolean;
10745
+ /**
10746
+ * Enable import rules.
10747
+ *
10748
+ * @default true
10749
+ */
10750
+ imports: boolean;
10751
+ /**
10752
+ * Enable json support.
10753
+ *
10754
+ * @default true
10755
+ */
10756
+ json: boolean;
10757
+ /**
10758
+ * Enable markdown support.
10759
+ *
10760
+ * @default true
10761
+ */
10762
+ markdown: boolean;
10763
+ /**
10764
+ * Configure module imports.
10765
+ *
10766
+ * @default { amd: false, commonjs: false, node: true, webpack: false }
10767
+ */
10768
+ module: HexadropEslintModulesOptions;
10769
+ /**
10770
+ * Use node rules.
10771
+ *
10772
+ * @default true
10773
+ */
10774
+ node: boolean;
10775
+ /**
10776
+ * Enable react support.
10777
+ *
10778
+ * If `false`, react support will be disabled.
10779
+ * If `true`, or empty it will be enabled.
10780
+ */
10781
+ react: boolean;
10782
+ /**
10783
+ * Configure stylistic rules.
10784
+ *
10785
+ * @default {
10786
+ * arrowParens: 'avoid',
10787
+ * braceStyle: '1tbs',
10788
+ * bracketSameLine: true,
10789
+ * bracketSpacing: true,
10790
+ * endOfLine: 'lf',
10791
+ * format: true,
10792
+ * imports: true,
10793
+ * indent: 'tab',
10794
+ * indentSize: 4,
10795
+ * perfectionist: true,
10796
+ * quoteProps: 'as-needed',
10797
+ * quotes: 'single',
10798
+ * semicolons: true,
10799
+ * singleAttributePerLine: true,
10800
+ * trailingComma: 'es5',
10801
+ * unicorn: true,
10802
+ * }
10803
+ */
10804
+ stylistic: HexadropEslintStylisticOptions | false;
10805
+ /**
10806
+ * Configure typescript support.
10807
+ *
10808
+ * If `false`, typescript support will be disabled.
10809
+ * If `true`, typescript support will be enabled with default options.
10810
+ * If you leave empty, automatic detection will be used.
10811
+ *
10812
+ */
10813
+ typescript: boolean | string | string[];
10814
+ }
10815
+
10816
+ declare function hexadrop(optionsOrFlatConfigItem?: RecursivePartial<HexadropEslintOptions> & TypedFlatConfigItem, ...configs: ResolvableFlatConfig<TypedFlatConfigItem>[]): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
10813
10817
 
10814
10818
  /**
10815
10819
  * Combine array and non-array configs into a single array.
package/dist/index.d.ts CHANGED
@@ -2,226 +2,6 @@ import { ResolvableFlatConfig, FlatConfigComposer } from 'eslint-flat-config-uti
2
2
  import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
3
3
  import { Linter } from 'eslint';
4
4
 
5
- interface HexadropEslintIgnoreOptions extends Omit<FlatGitignoreOptions, 'name'> {
6
- /**
7
- * Additional ignore patterns.
8
- */
9
- globs?: string[];
10
- }
11
-
12
- interface HexadropEslintModulesOptions {
13
- amd: boolean;
14
- commonjs: boolean;
15
- ignore: string[];
16
- /**
17
- * Enable use of core node modules.
18
- *
19
- * @default true
20
- */
21
- node: boolean;
22
- /**
23
- * Enable webpack support.
24
- *
25
- * @default false
26
- */
27
- webpack: boolean;
28
- }
29
-
30
- interface HexadropEslintStylisticOptions {
31
- /**
32
- * Include parentheses around a sole arrow function parameter.
33
- *
34
- * @default 'avoid'
35
- */
36
- arrowParens: 'always' | 'avoid';
37
- /**
38
- * Which brace style to use
39
- *
40
- * @default '1tbs'
41
- */
42
- braceStyle: '1tbs' | 'allman' | 'stroustrup';
43
- /**
44
- * Put the > of a multi-line HTML (HTML, JSX, Vue, Angular) element
45
- * at the end of the last line instead of being alone on the next line.
46
- *
47
- * @default true
48
- */
49
- bracketSameLine: boolean;
50
- /**
51
- * Use spaces between brackets in object literals.
52
- *
53
- * @default true
54
- */
55
- bracketSpacing: boolean;
56
- /**
57
- * End of line character.
58
- *
59
- * @default 'lf'
60
- */
61
- endOfLine: 'auto' | 'cr' | 'crlf' | 'lf';
62
- /**
63
- * Enable formatting rules.
64
- *
65
- * @default true
66
- */
67
- format: boolean;
68
- /**
69
- * Enable import rules.
70
- *
71
- * @default true
72
- */
73
- imports: boolean;
74
- /**
75
- * Indentation style.
76
- *
77
- * @default 'tab'
78
- */
79
- indent: 'space' | 'tab';
80
- /**
81
- * Number of spaces to use for indentation.
82
- *
83
- * @default 4
84
- */
85
- indentSize: number;
86
- /**
87
- * Enable perfectionist rules.
88
- *
89
- * @default true
90
- */
91
- perfectionist: boolean;
92
- /**
93
- * Specify the line length that the printer will wrap on.
94
- *
95
- * @default 120
96
- */
97
- printWidth: number;
98
- /**
99
- * Change when properties in objects are quoted.
100
- *
101
- * @default 'as-needed'
102
- */
103
- quoteProps: 'as-needed' | 'consistent' | 'preserve';
104
- /**
105
- * Quote style.
106
- *
107
- * @default 'single'
108
- */
109
- quotes: 'double' | 'single';
110
- /**
111
- * Use semicolons at the end of statements.
112
- *
113
- * @default true
114
- */
115
- semicolons: boolean;
116
- /**
117
- * Use single attribute per line in HTML, Vue and JSX.
118
- *
119
- * @default false
120
- */
121
- singleAttributePerLine: boolean;
122
- /**
123
- * Use trailing commas in multi-line object literals.
124
- *
125
- * @default 'es5'
126
- */
127
- trailingComma: 'all' | 'es5' | 'none';
128
- /**
129
- * Enable unicorn rules.
130
- *
131
- * @default true
132
- */
133
- unicorn: boolean;
134
- }
135
-
136
- interface HexadropEslintOptions {
137
- /**
138
- * Enable astro support.
139
- *
140
- * If `false`, astro support will be disabled.
141
- * If `true`, or empty it will be enabled.
142
- */
143
- astro: boolean;
144
- /**
145
- * Enable ignore support.
146
- *
147
- * Passing an object to configure the options.
148
- *
149
- * @see https://github.com/antfu/eslint-config-flat-gitignore
150
- *
151
- * @default true
152
- */
153
- ignore: HexadropEslintIgnoreOptions | boolean;
154
- /**
155
- * Enable import rules.
156
- *
157
- * @default true
158
- */
159
- imports: boolean;
160
- /**
161
- * Enable json support.
162
- *
163
- * @default true
164
- */
165
- json: boolean;
166
- /**
167
- * Enable markdown support.
168
- *
169
- * @default true
170
- */
171
- markdown: boolean;
172
- /**
173
- * Configure module imports.
174
- *
175
- * @default { amd: false, commonjs: false, node: true, webpack: false }
176
- */
177
- module: HexadropEslintModulesOptions;
178
- /**
179
- * Use node rules.
180
- *
181
- * @default true
182
- */
183
- node: boolean;
184
- /**
185
- * Enable react support.
186
- *
187
- * If `false`, react support will be disabled.
188
- * If `true`, or empty it will be enabled.
189
- */
190
- react: boolean;
191
- /**
192
- * Configure stylistic rules.
193
- *
194
- * @default {
195
- * arrowParens: 'avoid',
196
- * braceStyle: '1tbs',
197
- * bracketSameLine: true,
198
- * bracketSpacing: true,
199
- * endOfLine: 'lf',
200
- * format: true,
201
- * imports: true,
202
- * indent: 'tab',
203
- * indentSize: 4,
204
- * perfectionist: true,
205
- * quoteProps: 'as-needed',
206
- * quotes: 'single',
207
- * semicolons: true,
208
- * singleAttributePerLine: true,
209
- * trailingComma: 'es5',
210
- * unicorn: true,
211
- * }
212
- */
213
- stylistic: HexadropEslintStylisticOptions | false;
214
- /**
215
- * Configure typescript support.
216
- *
217
- * If `false`, typescript support will be disabled.
218
- * If `true`, typescript support will be enabled with default options.
219
- * If you leave empty, automatic detection will be used.
220
- *
221
- */
222
- typescript: boolean | string | string[];
223
- }
224
-
225
5
  type Awaitable<T> = Promise<T> | T;
226
6
 
227
7
  declare const ASTRO_CONFIG_NAME_SETUP: "hexadrop/astro/setup";
@@ -287,6 +67,10 @@ type TypescriptConfigNames = typeof TYPESCRIPT_CONFIG_NAME_RULES | typeof TYPESC
287
67
 
288
68
  type ConfigNames = AstroConfigNames | CoreConfigNames | IgnoreConfigNames | JsonConfigNames | MarkdownConfigNames | ReactConfigNames | StylisticConfigNames | TypescriptConfigNames;
289
69
 
70
+ type RecursivePartial<T> = {
71
+ [P in keyof T]?: RecursivePartial<T[P]>;
72
+ };
73
+
290
74
  /* eslint-disable */
291
75
  /* prettier-ignore */
292
76
 
@@ -10809,7 +10593,227 @@ type TypedFlatConfigItem = {
10809
10593
  rules?: Linter.RulesRecord & Rules;
10810
10594
  } & Linter.FlatConfig;
10811
10595
 
10812
- declare function hexadrop(optionsOrFlatConfigItem?: Partial<HexadropEslintOptions> & TypedFlatConfigItem, ...configs: ResolvableFlatConfig<TypedFlatConfigItem>[]): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
10596
+ interface HexadropEslintIgnoreOptions extends Omit<FlatGitignoreOptions, 'name'> {
10597
+ /**
10598
+ * Additional ignore patterns.
10599
+ */
10600
+ globs?: string[];
10601
+ }
10602
+
10603
+ interface HexadropEslintModulesOptions {
10604
+ amd: boolean;
10605
+ commonjs: boolean;
10606
+ ignore: string[];
10607
+ /**
10608
+ * Enable use of core node modules.
10609
+ *
10610
+ * @default true
10611
+ */
10612
+ node: boolean;
10613
+ /**
10614
+ * Enable webpack support.
10615
+ *
10616
+ * @default false
10617
+ */
10618
+ webpack: boolean;
10619
+ }
10620
+
10621
+ interface HexadropEslintStylisticOptions {
10622
+ /**
10623
+ * Include parentheses around a sole arrow function parameter.
10624
+ *
10625
+ * @default 'avoid'
10626
+ */
10627
+ arrowParens: 'always' | 'avoid';
10628
+ /**
10629
+ * Which brace style to use
10630
+ *
10631
+ * @default '1tbs'
10632
+ */
10633
+ braceStyle: '1tbs' | 'allman' | 'stroustrup';
10634
+ /**
10635
+ * Put the > of a multi-line HTML (HTML, JSX, Vue, Angular) element
10636
+ * at the end of the last line instead of being alone on the next line.
10637
+ *
10638
+ * @default true
10639
+ */
10640
+ bracketSameLine: boolean;
10641
+ /**
10642
+ * Use spaces between brackets in object literals.
10643
+ *
10644
+ * @default true
10645
+ */
10646
+ bracketSpacing: boolean;
10647
+ /**
10648
+ * End of line character.
10649
+ *
10650
+ * @default 'lf'
10651
+ */
10652
+ endOfLine: 'auto' | 'cr' | 'crlf' | 'lf';
10653
+ /**
10654
+ * Enable formatting rules.
10655
+ *
10656
+ * @default true
10657
+ */
10658
+ format: boolean;
10659
+ /**
10660
+ * Enable import rules.
10661
+ *
10662
+ * @default true
10663
+ */
10664
+ imports: boolean;
10665
+ /**
10666
+ * Indentation style.
10667
+ *
10668
+ * @default 'tab'
10669
+ */
10670
+ indent: 'space' | 'tab';
10671
+ /**
10672
+ * Number of spaces to use for indentation.
10673
+ *
10674
+ * @default 4
10675
+ */
10676
+ indentSize: number;
10677
+ /**
10678
+ * Enable perfectionist rules.
10679
+ *
10680
+ * @default true
10681
+ */
10682
+ perfectionist: boolean;
10683
+ /**
10684
+ * Specify the line length that the printer will wrap on.
10685
+ *
10686
+ * @default 120
10687
+ */
10688
+ printWidth: number;
10689
+ /**
10690
+ * Change when properties in objects are quoted.
10691
+ *
10692
+ * @default 'as-needed'
10693
+ */
10694
+ quoteProps: 'as-needed' | 'consistent' | 'preserve';
10695
+ /**
10696
+ * Quote style.
10697
+ *
10698
+ * @default 'single'
10699
+ */
10700
+ quotes: 'double' | 'single';
10701
+ /**
10702
+ * Use semicolons at the end of statements.
10703
+ *
10704
+ * @default true
10705
+ */
10706
+ semicolons: boolean;
10707
+ /**
10708
+ * Use single attribute per line in HTML, Vue and JSX.
10709
+ *
10710
+ * @default false
10711
+ */
10712
+ singleAttributePerLine: boolean;
10713
+ /**
10714
+ * Use trailing commas in multi-line object literals.
10715
+ *
10716
+ * @default 'es5'
10717
+ */
10718
+ trailingComma: 'all' | 'es5' | 'none';
10719
+ /**
10720
+ * Enable unicorn rules.
10721
+ *
10722
+ * @default true
10723
+ */
10724
+ unicorn: boolean;
10725
+ }
10726
+
10727
+ interface HexadropEslintOptions {
10728
+ /**
10729
+ * Enable astro support.
10730
+ *
10731
+ * If `false`, astro support will be disabled.
10732
+ * If `true`, or empty it will be enabled.
10733
+ */
10734
+ astro: boolean;
10735
+ /**
10736
+ * Enable ignore support.
10737
+ *
10738
+ * Passing an object to configure the options.
10739
+ *
10740
+ * @see https://github.com/antfu/eslint-config-flat-gitignore
10741
+ *
10742
+ * @default true
10743
+ */
10744
+ ignore: HexadropEslintIgnoreOptions | boolean;
10745
+ /**
10746
+ * Enable import rules.
10747
+ *
10748
+ * @default true
10749
+ */
10750
+ imports: boolean;
10751
+ /**
10752
+ * Enable json support.
10753
+ *
10754
+ * @default true
10755
+ */
10756
+ json: boolean;
10757
+ /**
10758
+ * Enable markdown support.
10759
+ *
10760
+ * @default true
10761
+ */
10762
+ markdown: boolean;
10763
+ /**
10764
+ * Configure module imports.
10765
+ *
10766
+ * @default { amd: false, commonjs: false, node: true, webpack: false }
10767
+ */
10768
+ module: HexadropEslintModulesOptions;
10769
+ /**
10770
+ * Use node rules.
10771
+ *
10772
+ * @default true
10773
+ */
10774
+ node: boolean;
10775
+ /**
10776
+ * Enable react support.
10777
+ *
10778
+ * If `false`, react support will be disabled.
10779
+ * If `true`, or empty it will be enabled.
10780
+ */
10781
+ react: boolean;
10782
+ /**
10783
+ * Configure stylistic rules.
10784
+ *
10785
+ * @default {
10786
+ * arrowParens: 'avoid',
10787
+ * braceStyle: '1tbs',
10788
+ * bracketSameLine: true,
10789
+ * bracketSpacing: true,
10790
+ * endOfLine: 'lf',
10791
+ * format: true,
10792
+ * imports: true,
10793
+ * indent: 'tab',
10794
+ * indentSize: 4,
10795
+ * perfectionist: true,
10796
+ * quoteProps: 'as-needed',
10797
+ * quotes: 'single',
10798
+ * semicolons: true,
10799
+ * singleAttributePerLine: true,
10800
+ * trailingComma: 'es5',
10801
+ * unicorn: true,
10802
+ * }
10803
+ */
10804
+ stylistic: HexadropEslintStylisticOptions | false;
10805
+ /**
10806
+ * Configure typescript support.
10807
+ *
10808
+ * If `false`, typescript support will be disabled.
10809
+ * If `true`, typescript support will be enabled with default options.
10810
+ * If you leave empty, automatic detection will be used.
10811
+ *
10812
+ */
10813
+ typescript: boolean | string | string[];
10814
+ }
10815
+
10816
+ declare function hexadrop(optionsOrFlatConfigItem?: RecursivePartial<HexadropEslintOptions> & TypedFlatConfigItem, ...configs: ResolvableFlatConfig<TypedFlatConfigItem>[]): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
10813
10817
 
10814
10818
  /**
10815
10819
  * Combine array and non-array configs into a single array.
package/dist/index.js CHANGED
@@ -1264,6 +1264,7 @@ async function stylistic(options) {
1264
1264
  [`${stylisticPluginRename}/line-comment-position`]: ["error", { position: "above" }],
1265
1265
  [`${stylisticPluginRename}/max-len`]: "off",
1266
1266
  [`${stylisticPluginRename}/multiline-comment-style`]: ["error", "starred-block"],
1267
+ [`${stylisticPluginRename}/multiline-ternary`]: "off",
1267
1268
  [`${stylisticPluginRename}/no-extra-semi`]: "error",
1268
1269
  [`${stylisticPluginRename}/padding-line-between-statements`]: [
1269
1270
  "error",
@@ -1845,13 +1846,19 @@ function defaultOptions(options = {}) {
1845
1846
  } else if (installedTypescript) {
1846
1847
  if (options.typescript === void 0) {
1847
1848
  typescript2 = getCwdTsconfigPath() ?? true;
1848
- } else if (options.typescript === "string" || Array.isArray(options.typescript)) {
1849
+ } else if (options.typescript === "string") {
1849
1850
  typescript2 = options.typescript.length > 0 ? options.typescript : true;
1851
+ } else if (Array.isArray(options.typescript)) {
1852
+ typescript2 = options.typescript.length > 0 ? options.typescript.filter(Boolean) : true;
1850
1853
  }
1851
1854
  }
1852
1855
  return {
1853
1856
  astro: options.astro ?? installedAstro,
1854
- ignore: options.ignore ?? true,
1857
+ ignore: typeof options.ignore === "object" ? {
1858
+ ...options.ignore,
1859
+ files: typeof options.ignore.files === "string" ? options.ignore.files : options.ignore.files?.filter(Boolean) ?? [],
1860
+ globs: options.ignore.globs?.filter(Boolean) ?? []
1861
+ } : options.ignore ?? true,
1855
1862
  imports: options.imports ?? true,
1856
1863
  json: options.json ?? true,
1857
1864
  markdown: options.markdown ?? true,
@@ -1861,7 +1868,11 @@ function defaultOptions(options = {}) {
1861
1868
  node: true,
1862
1869
  webpack: false,
1863
1870
  ...options.module,
1864
- ignore: [String.raw`bun\:.*`, String.raw`astro\:.*`, ...options.module?.ignore ?? []]
1871
+ ignore: [
1872
+ String.raw`bun\:.*`,
1873
+ String.raw`astro\:.*`,
1874
+ ...options.module?.ignore?.filter(Boolean) ?? []
1875
+ ]
1865
1876
  },
1866
1877
  node: options.node ?? true,
1867
1878
  react: options.react ?? installedReact,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hexadrop/eslint-config",
3
- "version": "0.0.1-beta.1",
3
+ "version": "0.0.1-beta.3",
4
4
  "description": "Opinionated ESLint ruleset designed for large teams and projects",
5
5
  "keywords": [
6
6
  "lint",
@@ -74,10 +74,10 @@
74
74
  "devDependencies": {
75
75
  "@changesets/cli": "2.27.3",
76
76
  "@eslint/config-inspector": "0.4.8",
77
- "@hexadrop/tsconfig": "0.0.2",
77
+ "@hexadrop/tsconfig": "0.0.3",
78
78
  "@types/bun": "1.1.3",
79
79
  "@types/eslint": "8.56.10",
80
- "astro": "4.8.7",
80
+ "astro": "4.9.1",
81
81
  "eslint": "9.3.0",
82
82
  "eslint-typegen": "0.2.4",
83
83
  "esno": "4.7.0",