Rules
component-name
Full Name in eslint-plugin-react-naming-convention
Full Name in @eslint-react/eslint-plugin
Features
🔍
⚙️
What it does
Enforces naming conventions for components.
Examples
This rule enforces naming conventions for components. Can be used to enforce PascalCase and CONSTANT_CASE. By default, it enforces PascalCase.
Failing
Passing
Rule Options
rule
: The rule to apply to the file name. Default is"PascalCase"
. Possible values:PascalCase
: PascalCaseCONSTANT_CASE
: CONSTANT_CASE
excepts
: (optional) An array of component names that are allowed to not follow the rule.allowAllCaps
: (optional) Iftrue
, allows all caps file names. Default isfalse
.allowNamespace
: (optional) Iftrue
, allows namespace in JSX elements. Default isfalse
.allowLeadingUnderscore
: (optional) Iftrue
, allows leading underscore in file names. Default isfalse
.