Skip to content

Commit

Permalink
Merge pull request #198 from Shopify/ts_naming_rules
Browse files Browse the repository at this point in the history
Typescript naming rules
  • Loading branch information
atesgoral committed Mar 25, 2021
2 parents 9b6d054 + 6dc8bdb commit dc7871a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/eslint-plugin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

### Changed

- Updated TypeScript naming rules to ensure type name start with a "T" and interface names don't start with an "I" ([#198](https://github.com/Shopify/web-configs/pull/198))
- Updated `eslint-config-prettier` dependency to v3.3.0 ([#202](https://github.com/Shopify/web-configs/pull/202))

## [39.0.3] - 2020-11-17
Expand Down
17 changes: 17 additions & 0 deletions packages/eslint-plugin/lib/config/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,23 @@ module.exports = {
'@shopify/typescript/prefer-singular-enums': 'error',
// Prefer buildClientSchema for schema building.
'@shopify/typescript/prefer-build-client-schema': 'error',

'@typescript-eslint/naming-convention': [
'error',
{
selector: 'typeParameter',
format: ['PascalCase'],
prefix: ['T'],
},
{
selector: 'interface',
format: ['PascalCase'],
custom: {
regex: '^I[A-Z]',
match: false,
},
},
],
}),
},
],
Expand Down

0 comments on commit dc7871a

Please sign in to comment.