Skip to content

Commit 252f131

Browse files
ENG-643 add PascalCase to eslint for React Functional Components (#333)
* Refine TypeScript naming convention rules for more flexible formatting Co-authored-by: mclicks <[email protected]> * Update comments --------- Co-authored-by: Cursor Agent <[email protected]>
1 parent a8b3c8f commit 252f131

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

packages/eslint-config/base.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,25 @@ export const config = [
2828
},
2929
rules: {
3030
"max-params": ["error", 3],
31-
"@typescript-eslint/naming-convention": "error",
31+
"@typescript-eslint/naming-convention": [
32+
"error",
33+
// Keep default
34+
{ selector: "default", format: ["camelCase"] },
35+
// Keep default for const
36+
{
37+
selector: "variable",
38+
modifiers: ["const"],
39+
format: ["camelCase", "UPPER_CASE"],
40+
},
41+
// Keep default for types
42+
{ selector: "typeLike", format: ["PascalCase"] },
43+
// Allow PascalCase for function variables (e.g., React components)
44+
{
45+
selector: "variable",
46+
types: ["function"],
47+
format: ["camelCase", "PascalCase"],
48+
},
49+
],
3250
"preferArrows/prefer-arrow-functions": [
3351
"warn",
3452
{

0 commit comments

Comments
 (0)