Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

Commit

Permalink
Merge pull request #68 from saneyuki/member-naming
Browse files Browse the repository at this point in the history
Enable typescript-eslint/member-naming
  • Loading branch information
tetsuharuohzeki authored Mar 6, 2019
2 parents 95dc1b7 + febf295 commit edbb67f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions config/eslintrc_typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,19 @@ module.exports = {
}
}],

// By these reasons, I think we recommend to add `_` prefix to private fields.
//
// * Historically, JavaScript wolrd use `_` prefix to mark fields as _private_.
// * Until coming [private fields of class field declarations proposal](https://github.com/tc39/proposal-class-fields),
// there is no true private fields in JavaScript.
// * If TypeScript compiler supports it, it might be better to relax this rule.
// * TypeScript will be transformed into plain JavaScript and plain JavaScript does not any informations
// to express whether a field is private or not.
'@typescript-eslint/member-naming': ['warn', {
'private': '^_',
'protected': '^_',
}],

// I don't think it's not efffective to sort the order by public/private/protected.
'@typescript-eslint/member-ordering': ['warn', {
// * I'd like to aggregate instance fields
Expand Down

0 comments on commit edbb67f

Please sign in to comment.