square / eslint-plugin-square

An ESLint plugin containing custom JavaScript, Ember, React, TypeScript rules and configurations tailored to Square's needs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Conflicting filename regex rules for React components

rachid-block opened this issue · comments

Description

Extending plugin:square/react adds an override to src/components which sets the following rule:

'filenames/match-regex': ['error', filenames.regex.pascal],

It also automatically extends the base config which applies a conflicting rule:

// Filenames:
'filenames/match-exported': ['error', 'kebab'],

Proposed Solution

Update the react override to also set filenames/match-exported. I can make a PR, but I wanted to open the issue up to discussion first.

Edit:

I also found out that the recommended unicorn ruleset is bringing in a unicorn/filename-case rule which is also set to kebab. We might want to disable that rule since it's covered by filenames/match-exported

Seems reasonable. If you could include some example React file paths/contents to show why this is correct, that would be helpful.

Will do. I updated the issue description with another conflicting rule unicorn/filename-case.

PR welcome to fix this.