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

Commit

Permalink
Allow PascalCase for variable namaing to define React Component
Browse files Browse the repository at this point in the history
Basically, we should use `camelCase` or `UPPER_CASE`.
But this change allow  these patterns for react:

```javascript
const SomeContext = React.useContext();

const MemoizedComponent = React.memo(function SomeComponent(props) {
  ...
});
```
  • Loading branch information
tetsuharuohzeki committed Mar 20, 2021
1 parent c8a6eff commit d461e38
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion config/eslintrc_typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,18 @@ module.exports = {

{
'selector': 'variable',
'format': ['camelCase', 'UPPER_CASE']
'format': [
'camelCase',
'UPPER_CASE',
// We need allow `PascalCase` for React component.
// e.g.
// ```
// const SomeContext = React.useContext();
//
// const MemoizedComponent = React.memo(function SomeComponent() {});
// ```
'PascalCase',
]
},

{
Expand Down

0 comments on commit d461e38

Please sign in to comment.