I use facebook's create-react-app, which intentionally hide all the configuration setup, and leave us with a lovely simple file structure
That's great! but there's one really annoying thing that come up:
SublimeLinter is no longer works because the .eslintrc configuration file is not longer at the root of the project.
I know I can put another .eslintrc file at the root, but I would like to be able to set my rules in one place
I know it is possible to npm eject
to get the entire project structure out in front, but I would like to keep things simple. otherwise it becomes just another boilerplate
a direction I thought about is to change:
"eslintConfig": {
"extends": "./node_modules/react-scripts/config/eslint.js"
}
to:
"eslintConfig": {
"extends": "./.eslintrc.js"
}
but it seems to require all the eslint-plugins (which are magically hidden from node_modules
) so I'm not sure it's the right way.
Any insights?
Install the ESLint packages for TypeScript and Jest support. Note, ESLint is installed with create-react-app, so you don't need to explicitly install it.
SublimeLinter is no longer works because the .eslintrc configuration file is not longer at the root of the project.
This is not correct.
SublimeLinter will work just fine but you currently have to install a few things globally. The generated project’s README includes the instructions to get linter IDE integration working:
Finally, you will need to install some packages globally:
npm install -g eslint babel-eslint eslint-plugin-react eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-flowtype
We recognize that this is suboptimal, but it is currently required due to the way we hide the ESLint dependency. The ESLint team is already working on a solution to this so this may become unnecessary in a couple of months.
This is, of course, assuming that you’re fine with the ESLint configuration we picked for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With