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

Commit 751e774

Browse files
committed
Add rule @typescript-eslint/no-empty-interface
1 parent d8b0a34 commit 751e774

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

src/rules/typescript-eslint/index.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import type { MemberDelimiterStyleRule } from './member-delimiter-style';
1414
import type { MemberOrderingRule } from './member-ordering';
1515
import type { NamingConventionRule } from './naming-convention';
1616
import type { NoEmptyFunctionRule } from './no-empty-function';
17+
import type { NoEmptyInterfaceRule } from './no-empty-interface';
1718
import type { NoExplicitAnyRule } from './no-explicit-any';
1819
import type { NoInferrableTypesRule } from './no-inferrable-types';
1920
import type { NoParameterPropertiesRule } from './no-parameter-properties';
@@ -45,6 +46,7 @@ export type TypeScriptEslintRules = AdjacentOverloadSignaturesRule &
4546
MemberOrderingRule &
4647
NamingConventionRule &
4748
NoEmptyFunctionRule &
49+
NoEmptyInterfaceRule &
4850
NoExplicitAnyRule &
4951
NoInferrableTypesRule &
5052
NoParameterPropertiesRule &
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import type { RuleConfig } from '../rule-config';
2+
3+
/**
4+
* Option.
5+
*/
6+
export type NoEmptyInterfaceOption = {
7+
/**
8+
* `true` will silence warnings about extending a single interface without adding additional members.
9+
*
10+
* @default false
11+
*
12+
* @see [allowSingleExtends](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-empty-interface.md#options)
13+
*/
14+
allowSingleExtends?: boolean;
15+
};
16+
17+
/**
18+
* Options.
19+
*/
20+
export type NoEmptyInterfaceOptions = [NoEmptyInterfaceOption?];
21+
22+
/**
23+
* Disallow the declaration of empty interfaces.
24+
*
25+
* @see [no-empty-interface](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-empty-interface.md)
26+
*/
27+
export type NoEmptyInterfaceRuleConfig = RuleConfig<NoEmptyInterfaceOptions>;
28+
29+
/**
30+
* Disallow the declaration of empty interfaces.
31+
*
32+
* @see [no-empty-interface](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-empty-interface.md)
33+
*/
34+
export interface NoEmptyInterfaceRule {
35+
/**
36+
* Disallow the declaration of empty interfaces.
37+
*
38+
* @see [no-empty-interface](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-empty-interface.md)
39+
*/
40+
'@typescript-eslint/no-empty-interface': NoEmptyInterfaceRuleConfig;
41+
}

0 commit comments

Comments
 (0)