Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

Commit e49956c

Browse files
committed
Generate rules for import
1 parent 544b1e2 commit e49956c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1657
-50
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"eslint": "~8.11.0",
5050
"eslint-config-prettier": "~8.5.0",
5151
"eslint-gitignore": "~0.1.0",
52+
"eslint-plugin-import": "~2.25.4",
5253
"eslint-plugin-inclusive-language": "~2.2.0",
5354
"eslint-plugin-jsdoc": "~38.0.4",
5455
"eslint-plugin-node": "~11.1.0",

pnpm-lock.yaml

Lines changed: 159 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/generate-rule-files.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { paramCase as kebabCase, pascalCase } from 'change-case';
66
import type { Rule } from 'eslint';
77
import * as eslint from 'eslint';
88
// @ts-expect-error
9+
import * as eslintPluginImport from 'eslint-plugin-import';
10+
// @ts-expect-error
911
import eslintPluginJSDoc from 'eslint-plugin-jsdoc';
1012
// @ts-expect-error
1113
import eslintPluginNode from 'eslint-plugin-node';
@@ -49,6 +51,10 @@ const generationMap: Record<string, Plugin> = {
4951
prefix: '@typescript-eslint',
5052
rules: (eslintPluginTypeScript as Plugin).rules,
5153
},
54+
import: {
55+
name: 'Import',
56+
rules: (eslintPluginImport as Plugin).rules,
57+
},
5258
jsdoc: {
5359
name: 'JSDoc',
5460
rules: (eslintPluginJSDoc as Plugin).rules,

src/rules/import/default.d.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
import type { RuleConfig } from '../rule-config';
22

33
/**
4-
* If a default import is requested, this rule will report if there is no default export in the imported module.
54
*
6-
* @see [default](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/default.md)
5+
*
6+
* @see [default](https://github.com/import-js/eslint-plugin-import/blob/v2.25.4/docs/rules/default.md)
77
*/
88
export type DefaultRuleConfig = RuleConfig<[]>;
99

1010
/**
11-
* If a default import is requested, this rule will report if there is no default export in the imported module.
1211
*
13-
* @see [default](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/default.md)
12+
*
13+
* @see [default](https://github.com/import-js/eslint-plugin-import/blob/v2.25.4/docs/rules/default.md)
1414
*/
1515
export interface DefaultRule {
1616
/**
17-
* If a default import is requested, this rule will report if there is no default export in the imported module.
1817
*
19-
* @see [default](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/default.md)
18+
*
19+
* @see [default](https://github.com/import-js/eslint-plugin-import/blob/v2.25.4/docs/rules/default.md)
2020
*/
2121
'import/default': DefaultRuleConfig;
2222
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import type { RuleConfig } from '../rule-config';
2+
3+
/**
4+
* Option.
5+
*/
6+
export interface DynamicImportChunknameOption {
7+
importFunctions?: string[];
8+
webpackChunknameFormat?: string;
9+
[k: string]: any;
10+
}
11+
12+
/**
13+
* Options.
14+
*/
15+
export type DynamicImportChunknameOptions = [DynamicImportChunknameOption?];
16+
17+
/**
18+
*
19+
*
20+
* @see [dynamic-import-chunkname](https://github.com/import-js/eslint-plugin-import/blob/v2.25.4/docs/rules/dynamic-import-chunkname.md)
21+
*/
22+
export type DynamicImportChunknameRuleConfig =
23+
RuleConfig<DynamicImportChunknameOptions>;
24+
25+
/**
26+
*
27+
*
28+
* @see [dynamic-import-chunkname](https://github.com/import-js/eslint-plugin-import/blob/v2.25.4/docs/rules/dynamic-import-chunkname.md)
29+
*/
30+
export interface DynamicImportChunknameRule {
31+
/**
32+
*
33+
*
34+
* @see [dynamic-import-chunkname](https://github.com/import-js/eslint-plugin-import/blob/v2.25.4/docs/rules/dynamic-import-chunkname.md)
35+
*/
36+
'import/dynamic-import-chunkname': DynamicImportChunknameRuleConfig;
37+
}

0 commit comments

Comments
 (0)