This repository was archived by the owner on Mar 7, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +35
-1
lines changed Expand file tree Collapse file tree 4 files changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,9 @@ function generateRuleFileContent(name, provider) {
48
48
case '@typescript-eslint' :
49
49
RuleLink = `https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/${ kebabCase } .md` ;
50
50
break ;
51
+ case 'import' :
52
+ RuleLink = `https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/${ kebabCase } .md` ;
53
+ break ;
51
54
}
52
55
53
56
provider = provider === 'eslint' ? '' : `${ provider } /` ;
@@ -96,4 +99,6 @@ export interface ${PascalCase}Rule {
96
99
` ;
97
100
}
98
101
102
+ fs . mkdirSync ( ruleProviderDir , { mode : 0o755 , recursive : true } ) ;
103
+
99
104
fs . writeFileSync ( rulePath , generateRuleFileContent ( ruleName , ruleProvider ) ) ;
Original file line number Diff line number Diff line change
1
+ import type { RuleConfig } from '../rule-config' ;
2
+
3
+ /**
4
+ * If a default import is requested, this rule will report if there is no default export in the imported module.
5
+ *
6
+ * @see [default](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/default.md)
7
+ */
8
+ export type DefaultRuleConfig = RuleConfig < [ ] > ;
9
+
10
+ /**
11
+ * If a default import is requested, this rule will report if there is no default export in the imported module.
12
+ *
13
+ * @see [default](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/default.md)
14
+ */
15
+ export interface DefaultRule {
16
+ /**
17
+ * If a default import is requested, this rule will report if there is no default export in the imported module.
18
+ *
19
+ * @see [default](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/default.md)
20
+ */
21
+ 'import/default' : DefaultRuleConfig ;
22
+ }
Original file line number Diff line number Diff line change
1
+ import type { DefaultRule } from './default' ;
2
+
3
+ /**
4
+ * All import rules.
5
+ */
6
+ export type ImportRules = DefaultRule ;
Original file line number Diff line number Diff line change 1
1
import type { EslintRules } from './eslint' ;
2
+ import type { ImportRules } from './import' ;
2
3
import type { JSDocRules } from './jsdoc' ;
3
4
import type { RuleConfig } from './rule-config' ;
4
5
import type { SpellcheckRules } from './spellcheck' ;
@@ -10,5 +11,5 @@ import type { TypeScriptEslintRules } from './typescript-eslint';
10
11
* @see [Rules](https://eslint.org/docs/user-guide/configuring/rules)
11
12
*/
12
13
export type Rules = Partial <
13
- EslintRules & TypeScriptEslintRules & JSDocRules & SpellcheckRules & Record < string , RuleConfig >
14
+ EslintRules & TypeScriptEslintRules & ImportRules & JSDocRules & SpellcheckRules & Record < string , RuleConfig >
14
15
> ;
You can’t perform that action at this time.
0 commit comments