progre / tslint-config-airbnb

[Deprecated] A TSLint config for Airbnb JavaScript Style

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PascalCase

alecmev opened this issue · comments

The following code currently gets flagged by variable-name:

const App = () => <div>Hello world!</div>;

The style guide discourages the use of name inference (here and here), so that kind of makes the example above (the notation I personally prefer) invalid, but not this one:

const App = function App() { return <div>Hello world!</div> };

I think the rule should be changed to this:

'variable-name': [true, 'check-format', 'allow-pascal-case']

A pure-component-specific exception would be nicer, of course, but, AFAIK, it doesn't exist.

I'm still confused whether Airbnb React/JSX Style should be included or not...

Right, it never registered in my mind that this config is JS-only. At least currently. I'll close this then, since this is, indeed, a React-/JSX-specific problem.