Just as #9, React template needs ESLint support out of the box.
It has the .eslintrc file ok, but it's simply unused without the eslint packages. And, of course, like in the mentionated issue, the generated package.json contains:
"lint": "echo \"No linting configured\""
Most peculiar thing about this?
The default "Vanilla ES6/7" template, that doesn't need it, installs the devDependencies that the React template needs and don't have. Just copy pasted from a generated "Vanilla ES6/7" package.json:
These two last dependencies get unused in a vanilla ES6/7 project.
I think this happens just because eslint-config-airbnb shouldn't be used in "Vanilla ES6/7". Why? Because what you just saw: it includes config about React.
There are two eslint-config-whatever official npm packages available for enforcing airbnb coding style:
So "Vanilla ES6/7" template ends having these extra packages it doesn't need and doesn't use: this only makes the download bigger. And "React" template ends not having these extra packages it needs for linting and with linting not out-the-box because the linting it need it's going to "Vanilla ES6/7" :(.
If there is a "React" template, this template should be the one having the React-related stuff.
I took a brief look to all the files here, thinking about to make a PR, but I'm a bit lost about all the importing and etc. I didn't get where are coming all the imported pieces in that time, so better leave it here to someone more close to it ñ_ñ.
Apart from the proper packages, I think the other only needed change is with the lint npm script (and adding .eslintcache to .gitignore):
"lint": "eslint --cache --ext .jsx,.js src"
Would suffice. At least, I think so: for now, it lints.
Just as #9, React template needs ESLint support out of the box.
It has the
.eslintrc
file ok, but it's simply unused without theeslint
packages. And, of course, like in the mentionated issue, the generatedpackage.json
contains:Most peculiar thing about this?
The default "Vanilla ES6/7" template, that doesn't need it, installs the
devDependencies
that the React template needs and don't have. Just copy pasted from a generated "Vanilla ES6/7"package.json
:These two last dependencies get unused in a vanilla ES6/7 project.
I think this happens just because
eslint-config-airbnb
shouldn't be used in "Vanilla ES6/7". Why? Because what you just saw: it includes config about React.There are two
eslint-config-whatever
official npm packages available for enforcingairbnb
coding style:So "Vanilla ES6/7" template ends having these extra packages it doesn't need and doesn't use: this only makes the download bigger. And "React" template ends not having these extra packages it needs for linting and with linting not out-the-box because the linting it need it's going to "Vanilla ES6/7" :(.
If there is a "React" template, this template should be the one having the React-related stuff.
I took a brief look to all the files here, thinking about to make a PR, but I'm a bit lost about all the importing and etc. I didn't get where are coming all the imported pieces in that time, so better leave it here to someone more close to it ñ_ñ.
Apart from the proper packages, I think the other only needed change is with the
lint
npm script (and adding.eslintcache
to.gitignore
):Would suffice. At least, I think so: for now, it lints.