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

Commit d461e38

Browse files
Allow PascalCase for variable namaing to define React Component
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) { ... }); ```
1 parent c8a6eff commit d461e38

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

config/eslintrc_typescript.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,18 @@ module.exports = {
117117

118118
{
119119
'selector': 'variable',
120-
'format': ['camelCase', 'UPPER_CASE']
120+
'format': [
121+
'camelCase',
122+
'UPPER_CASE',
123+
// We need allow `PascalCase` for React component.
124+
// e.g.
125+
// ```
126+
// const SomeContext = React.useContext();
127+
//
128+
// const MemoizedComponent = React.memo(function SomeComponent() {});
129+
// ```
130+
'PascalCase',
131+
]
121132
},
122133

123134
{

0 commit comments

Comments
 (0)