Skip to content

Commit

Permalink
chore(linting): add naming convention rule (faker-js#1170)
Browse files Browse the repository at this point in the history
  • Loading branch information
xDivisionByZerox authored Jul 20, 2022
1 parent b9284dc commit b0a4847
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@ module.exports = defineConfig({
},
],
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/naming-convention': [
'error',
{
format: ['PascalCase'],
selector: ['class', 'interface', 'typeAlias', 'enumMember'],
leadingUnderscore: 'forbid',
trailingUnderscore: 'forbid',
},
],
},
overrides: [
{
Expand Down
2 changes: 2 additions & 0 deletions src/modules/date/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ function toDate(date?: string | Date | number): Date {
/**
* Module to generate dates.
*/
// disabled until modules are renamed to something with a suffix
// eslint-disable-next-line @typescript-eslint/naming-convention
export class _Date {
constructor(private readonly faker: Faker) {
// Bind `this` so namespaced is working correctly
Expand Down
3 changes: 3 additions & 0 deletions src/modules/name/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import type { Faker } from '../..';
import { deprecated } from '../../internal/deprecated';

// disabled until renamed to Sex
export enum Gender {
// eslint-disable-next-line @typescript-eslint/naming-convention
female = 'female',
// eslint-disable-next-line @typescript-eslint/naming-convention
male = 'male',
}

Expand Down

0 comments on commit b0a4847

Please sign in to comment.