Skip to content

Commit 39d79b8

Browse files
committed
feat: add no-import-dist
1 parent 984441b commit 39d79b8

File tree

6 files changed

+78
-78
lines changed

6 files changed

+78
-78
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
"eslint-plugin-i": "^2.29.1",
8686
"eslint-plugin-jsdoc": "^46.9.1",
8787
"eslint-plugin-jsonc": "^2.11.2",
88-
"eslint-plugin-kirklin": "^1.0.0",
88+
"eslint-plugin-kirklin": "^1.1.0",
8989
"eslint-plugin-markdown": "^3.0.1",
9090
"eslint-plugin-n": "^16.5.0",
9191
"eslint-plugin-no-only-tests": "^3.1.0",

pnpm-lock.yaml

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cli/run.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export interface RuleOptions {
1515
/**
1616
* Skip prompts and use default values
1717
*/
18-
yes?: boolean
18+
yes?: boolean;
1919
}
2020

2121
export async function run(options: RuleOptions = {}) {

src/configs/imports.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export async function imports(options: OptionsStylistic = {}): Promise<FlatConfi
2424
"import/no-webpack-loader-syntax": "error",
2525
"import/order": "error",
2626
"kirklin/import-dedupe": "error",
27-
// 'kirklin/no-import-dist': 'error',
27+
"kirklin/no-import-dist": "error",
2828
"kirklin/no-import-node-modules-by-path": "error",
2929

3030
...stylistic
@@ -38,7 +38,7 @@ export async function imports(options: OptionsStylistic = {}): Promise<FlatConfi
3838
files: ["**/bin/**/*", `**/bin.${GLOB_SRC_EXT}`],
3939
name: "kirklin:imports:bin",
4040
rules: {
41-
// 'kirklin/no-import-dist': 'off',
41+
"kirklin/no-import-dist": "off",
4242
"kirklin/no-import-node-modules-by-path": "off",
4343
},
4444
},

src/types.ts

+50-50
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export type Rules = WrapRuleConfig<
5151
EslintCommentsRules &
5252
// TODO: TOML rules
5353
{
54-
"test/no-only-tests": RuleConfig<[]>
54+
"test/no-only-tests": RuleConfig<[]>;
5555
}
5656
>
5757
>;
@@ -60,15 +60,15 @@ export type FlatConfigItem = Omit<FlatESLintConfigItem<Rules, false>, "plugins">
6060
/**
6161
* Custom name of each config item
6262
*/
63-
name?: string
63+
name?: string;
6464

6565
// Relax plugins type limitation, as most of the plugins did not have correct type info yet.
6666
/**
6767
* 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.
6868
*
6969
* @see [Using plugins in your configuration](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#using-plugins-in-your-configuration)
7070
*/
71-
plugins?: Record<string, any>
71+
plugins?: Record<string, any>;
7272
};
7373

7474
export type UserConfigItem = FlatConfigItem | Linter.FlatConfig;
@@ -77,7 +77,7 @@ export interface OptionsFiles {
7777
/**
7878
* Override the `files` option to provide custom globs.
7979
*/
80-
files?: string[]
80+
files?: string[];
8181
}
8282

8383
export interface OptionsVue extends OptionsOverrides {
@@ -87,14 +87,14 @@ export interface OptionsVue extends OptionsOverrides {
8787
* @see https://github.com/kirklin/eslint-processor-vue-blocks
8888
* @default true
8989
*/
90-
sfcBlocks?: boolean | VueBlocksOptions
90+
sfcBlocks?: boolean | VueBlocksOptions;
9191

9292
/**
9393
* Vue version. Apply different rules set from `eslint-plugin-vue`.
9494
*
9595
* @default 3
9696
*/
97-
vueVersion?: 2 | 3
97+
vueVersion?: 2 | 3;
9898
}
9999

100100
export type OptionsTypescript =
@@ -107,14 +107,14 @@ export interface OptionsFormatters {
107107
*
108108
* Currently only support Prettier.
109109
*/
110-
css?: "prettier" | boolean
110+
css?: "prettier" | boolean;
111111

112112
/**
113113
* Enable formatting support for HTML.
114114
*
115115
* Currently only support Prettier.
116116
*/
117-
html?: "prettier" | boolean
117+
html?: "prettier" | boolean;
118118

119119
/**
120120
* Enable formatting support for Markdown.
@@ -123,26 +123,26 @@ export interface OptionsFormatters {
123123
*
124124
* When set to `true`, it will use Prettier.
125125
*/
126-
markdown?: "prettier" | "dprint" | boolean
126+
markdown?: "prettier" | "dprint" | boolean;
127127

128128
/**
129129
* Enable formatting support for GraphQL.
130130
*/
131-
graphql?: "prettier" | boolean
131+
graphql?: "prettier" | boolean;
132132

133133
/**
134134
* Custom options for Prettier.
135135
*
136136
* By default it's controlled by our own config.
137137
*/
138-
prettierOptions?: VendoredPrettierOptions
138+
prettierOptions?: VendoredPrettierOptions;
139139

140140
/**
141141
* Custom options for dprint.
142142
*
143143
* By default it's controlled by our own config.
144144
*/
145-
dprintOptions?: boolean
145+
dprintOptions?: boolean;
146146
}
147147

148148
export interface OptionsComponentExts {
@@ -152,60 +152,60 @@ export interface OptionsComponentExts {
152152
* @example ['vue']
153153
* @default []
154154
*/
155-
componentExts?: string[]
155+
componentExts?: string[];
156156
}
157157

158158
export interface OptionsTypeScriptParserOptions {
159159
/**
160160
* Additional parser options for TypeScript.
161161
*/
162-
parserOptions?: Partial<ParserOptions>
162+
parserOptions?: Partial<ParserOptions>;
163163

164164
/**
165165
* Glob patterns for files that should be type aware.
166166
* @default ['**\/*.{ts,tsx}']
167167
*/
168-
filesTypeAware?: string[]
168+
filesTypeAware?: string[];
169169
}
170170

171171
export interface OptionsTypeScriptWithTypes {
172172
/**
173173
* When this options is provided, type aware rules will be enabled.
174174
* @see https://typescript-eslint.io/linting/typed-linting/
175175
*/
176-
tsconfigPath?: string | string[]
176+
tsconfigPath?: string | string[];
177177
}
178178

179179
export interface OptionsHasTypeScript {
180-
typescript?: boolean
180+
typescript?: boolean;
181181
}
182182

183183
export interface OptionsStylistic {
184-
stylistic?: boolean | StylisticConfig
184+
stylistic?: boolean | StylisticConfig;
185185
}
186186

187187
export interface StylisticConfig extends Pick<StylisticCustomizeOptions, "indent" | "quotes" | "jsx" | "semi"> {
188188
}
189189

190190
export interface OptionsOverrides {
191-
overrides?: FlatConfigItem["rules"]
191+
overrides?: FlatConfigItem["rules"];
192192
}
193193

194194
export interface OptionsIsInEditor {
195-
isInEditor?: boolean
195+
isInEditor?: boolean;
196196
}
197197

198198
export interface OptionsUnoCSS extends OptionsOverrides {
199199
/**
200200
* Enable attributify support.
201201
* @default true
202202
*/
203-
attributify?: boolean
203+
attributify?: boolean;
204204
/**
205205
* Enable strict mode by throwing errors about blocklisted classes.
206206
* @default false
207207
*/
208-
strict?: boolean
208+
strict?: boolean;
209209
}
210210

211211
export interface OptionsConfig extends OptionsComponentExts {
@@ -217,12 +217,12 @@ export interface OptionsConfig extends OptionsComponentExts {
217217
* @see https://github.com/kirklin/eslint-config-flat-gitignore
218218
* @default true
219219
*/
220-
gitignore?: boolean | FlatGitignoreOptions
220+
gitignore?: boolean | FlatGitignoreOptions;
221221

222222
/**
223223
* Core rules. Can't be disabled.
224224
*/
225-
javascript?: OptionsOverrides
225+
javascript?: OptionsOverrides;
226226

227227
/**
228228
* Enable TypeScript support.
@@ -231,7 +231,7 @@ export interface OptionsConfig extends OptionsComponentExts {
231231
*
232232
* @default auto-detect based on the dependencies
233233
*/
234-
typescript?: boolean | OptionsTypescript
234+
typescript?: boolean | OptionsTypescript;
235235

236236
/**
237237
* Enable JSX related rules.
@@ -240,42 +240,42 @@ export interface OptionsConfig extends OptionsComponentExts {
240240
*
241241
* @default true
242242
*/
243-
jsx?: boolean
243+
jsx?: boolean;
244244

245245
/**
246246
* Enable test support.
247247
*
248248
* @default true
249249
*/
250-
test?: boolean | OptionsOverrides
250+
test?: boolean | OptionsOverrides;
251251

252252
/**
253253
* Enable Vue support.
254254
*
255255
* @default auto-detect based on the dependencies
256256
*/
257-
vue?: boolean | OptionsVue
257+
vue?: boolean | OptionsVue;
258258

259259
/**
260260
* Enable JSONC support.
261261
*
262262
* @default true
263263
*/
264-
jsonc?: boolean | OptionsOverrides
264+
jsonc?: boolean | OptionsOverrides;
265265

266266
/**
267267
* Enable YAML support.
268268
*
269269
* @default true
270270
*/
271-
yaml?: boolean | OptionsOverrides
271+
yaml?: boolean | OptionsOverrides;
272272

273273
/**
274274
* Enable TOML support.
275275
*
276276
* @default true
277277
*/
278-
toml?: boolean | OptionsOverrides
278+
toml?: boolean | OptionsOverrides;
279279

280280
/**
281281
* Enable linting for **code snippets** in Markdown.
@@ -284,14 +284,14 @@ export interface OptionsConfig extends OptionsComponentExts {
284284
*
285285
* @default true
286286
*/
287-
markdown?: boolean | OptionsOverrides
287+
markdown?: boolean | OptionsOverrides;
288288

289289
/**
290290
* Enable stylistic rules.
291291
*
292292
* @default true
293293
*/
294-
stylistic?: boolean | StylisticConfig
294+
stylistic?: boolean | StylisticConfig;
295295

296296
/**
297297
* Enable react rules.
@@ -303,7 +303,7 @@ export interface OptionsConfig extends OptionsComponentExts {
303303
*
304304
* @default false
305305
*/
306-
react?: boolean | OptionsOverrides
306+
react?: boolean | OptionsOverrides;
307307

308308
/**
309309
* Enable svelte rules.
@@ -313,7 +313,7 @@ export interface OptionsConfig extends OptionsComponentExts {
313313
*
314314
* @default false
315315
*/
316-
svelte?: boolean
316+
svelte?: boolean;
317317

318318
/**
319319
* Enable unocss rules.
@@ -323,7 +323,7 @@ export interface OptionsConfig extends OptionsComponentExts {
323323
*
324324
* @default false
325325
*/
326-
unocss?: boolean | OptionsUnoCSS
326+
unocss?: boolean | OptionsUnoCSS;
327327

328328
/**
329329
* Use external formatters to format files.
@@ -335,30 +335,30 @@ export interface OptionsConfig extends OptionsComponentExts {
335335
*
336336
* @default false
337337
*/
338-
formatters?: boolean | OptionsFormatters
338+
formatters?: boolean | OptionsFormatters;
339339

340340
/**
341341
* Control to disable some rules in editors.
342342
* @default auto-detect based on the process.env
343343
*/
344-
isInEditor?: boolean
344+
isInEditor?: boolean;
345345

346346
/**
347347
* Provide overrides for rules for each integration.
348348
*
349349
* @deprecated use `overrides` option in each integration key instead
350350
*/
351351
overrides?: {
352-
stylistic?: FlatConfigItem["rules"]
353-
javascript?: FlatConfigItem["rules"]
354-
typescript?: FlatConfigItem["rules"]
355-
test?: FlatConfigItem["rules"]
356-
vue?: FlatConfigItem["rules"]
357-
jsonc?: FlatConfigItem["rules"]
358-
markdown?: FlatConfigItem["rules"]
359-
yaml?: FlatConfigItem["rules"]
360-
toml?: FlatConfigItem["rules"]
361-
react?: FlatConfigItem["rules"]
362-
svelte?: FlatConfigItem["rules"]
363-
}
352+
stylistic?: FlatConfigItem["rules"];
353+
javascript?: FlatConfigItem["rules"];
354+
typescript?: FlatConfigItem["rules"];
355+
test?: FlatConfigItem["rules"];
356+
vue?: FlatConfigItem["rules"];
357+
jsonc?: FlatConfigItem["rules"];
358+
markdown?: FlatConfigItem["rules"];
359+
yaml?: FlatConfigItem["rules"];
360+
toml?: FlatConfigItem["rules"];
361+
react?: FlatConfigItem["rules"];
362+
svelte?: FlatConfigItem["rules"];
363+
};
364364
}

0 commit comments

Comments
 (0)