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

Commit 59b870e

Browse files
committed
Add rule @typescript-eslint/naming-convention
1 parent 6db0da7 commit 59b870e

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import type { IndentRule } from './indent';
1212
import type { InterfaceNamePrefixRule } from './interface-name-prefix';
1313
import type { MemberDelimiterStyleRule } from './member-delimiter-style';
1414
import type { MemberOrderingRule } from './member-ordering';
15+
import type { NamingConventionRule } from './naming-convention';
1516
import type { NoExplicitAnyRule } from './no-explicit-any';
1617
import type { NoInferrableTypesRule } from './no-inferrable-types';
1718
import type { NoParameterPropertiesRule } from './no-parameter-properties';
@@ -41,6 +42,7 @@ export type TypeScriptEslintRules = AdjacentOverloadSignaturesRule &
4142
InterfaceNamePrefixRule &
4243
MemberDelimiterStyleRule &
4344
MemberOrderingRule &
45+
NamingConventionRule &
4446
NoExplicitAnyRule &
4547
NoInferrableTypesRule &
4648
NoParameterPropertiesRule &
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import type { RuleConfig } from '../rule-config';
2+
3+
// TODO: Define @typescript-eslint/naming-convention option.
4+
5+
/**
6+
* Option.
7+
*/
8+
// export type NamingConventionOption = {
9+
// // format options
10+
// format: ('camelCase' | 'strictCamelCase' | 'PascalCase' | 'StrictPascalCase' | 'snake_case' | 'UPPER_CASE')[] | null;
11+
// custom?: {
12+
// regex: string;
13+
// match: boolean;
14+
// };
15+
// leadingUnderscore?: 'forbid' | 'require' | 'requireDouble' | 'allow' | 'allowDouble' | 'allowSingleOrDouble';
16+
// trailingUnderscore?: 'forbid' | 'require' | 'requireDouble' | 'allow' | 'allowDouble' | 'allowSingleOrDouble';
17+
// prefix?: string[];
18+
// suffix?: string[];
19+
20+
// // selector options
21+
// selector: Selector | Selector[];
22+
// filter?:
23+
// | string
24+
// | {
25+
// regex: string;
26+
// match: boolean;
27+
// };
28+
// // the allowed values for these are dependent on the selector - see below
29+
// modifiers?: Modifiers<Selector>[];
30+
// types?: Types<Selector>[];
31+
// }[];
32+
33+
/**
34+
* Options.
35+
*/
36+
// export type NamingConventionOptions = [NamingConventionOption?];
37+
38+
/**
39+
* Enforces naming conventions for everything across a codebase.
40+
*
41+
* @see [naming-convention](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/naming-convention.md)
42+
*/
43+
export type NamingConventionRuleConfig = RuleConfig; //<NamingConventionOptions>;
44+
45+
/**
46+
* Enforces naming conventions for everything across a codebase.
47+
*
48+
* @see [naming-convention](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/naming-convention.md)
49+
*/
50+
export interface NamingConventionRule {
51+
/**
52+
* Enforces naming conventions for everything across a codebase.
53+
*
54+
* @see [naming-convention](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/naming-convention.md)
55+
*/
56+
'@typescript-eslint/naming-convention': NamingConventionRuleConfig;
57+
}

0 commit comments

Comments
 (0)