Skip to content

Commit b0a4847

Browse files
chore(linting): add naming convention rule (#1170)
1 parent b9284dc commit b0a4847

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

.eslintrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,15 @@ module.exports = defineConfig({
5151
},
5252
],
5353
'@typescript-eslint/unbound-method': 'off',
54+
'@typescript-eslint/naming-convention': [
55+
'error',
56+
{
57+
format: ['PascalCase'],
58+
selector: ['class', 'interface', 'typeAlias', 'enumMember'],
59+
leadingUnderscore: 'forbid',
60+
trailingUnderscore: 'forbid',
61+
},
62+
],
5463
},
5564
overrides: [
5665
{

src/modules/date/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ function toDate(date?: string | Date | number): Date {
2020
/**
2121
* Module to generate dates.
2222
*/
23+
// disabled until modules are renamed to something with a suffix
24+
// eslint-disable-next-line @typescript-eslint/naming-convention
2325
export class _Date {
2426
constructor(private readonly faker: Faker) {
2527
// Bind `this` so namespaced is working correctly

src/modules/name/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import type { Faker } from '../..';
22
import { deprecated } from '../../internal/deprecated';
33

4+
// disabled until renamed to Sex
45
export enum Gender {
6+
// eslint-disable-next-line @typescript-eslint/naming-convention
57
female = 'female',
8+
// eslint-disable-next-line @typescript-eslint/naming-convention
69
male = 'male',
710
}
811

0 commit comments

Comments
 (0)