Enforces coding style that user-defined JSX components are defined and referenced in PascalCase.
Note that since React's JSX uses the upper vs. lower case convention to distinguish between local component classes and HTML tags this rule will not warn on components that start with a lower case letter.
The following patterns are considered warnings:
<Test_component />
<TEST_COMPONENT />
The following patterns are not considered warnings:
<div />
<TestComponent />
<TestComponent>
<div />
</TestComponent>
<CSSTransitionGroup />
...
"react/jsx-pascal-case": [<enabled>, { allowAllCaps: <allowAllCaps>, ignore: <ignore> }]
...
enabled
: for enabling the rule. 0=off, 1=warn, 2=error. Defaults to 0.allowAllCaps
: optional boolean set totrue
to allow components name in all caps (default tofalse
).ignore
: optional string-array of component names to ignore during validation.
The following patterns are not considered warnings when allowAllCaps
is true
:
<ALLOWED />
<TEST_COMPONENT />
If you are not using JSX.