I'm on a ReactNative project and prefer to use airbnb. I have npm install airbnb global:
npm install -g airbnb
(and also dependencies).eslintrc
file with config "extends": eslint-config-airbnb
.eslintrc
Got error below:
Error: Cannot find module 'eslint-config-airbnb'
Other info:
Fix problems automatically on saveOpen the Settings/Preferences dialog ( Ctrl+Alt+S ), go to Languages & Frameworks | JavaScript | Code Quality Tools | ESLint, and select the Run eslint --fix on save checkbox.
ESLint is a tool for “linting” your code. It can analyze your code and warn you of potential errors. In order for it to work, you need to configure it with specific rules. Luckily, Airbnb — as part of their style guide — provides an ESLint configuration that anyone can use.
You can't run eslint-config-standard directly. You need installing eslint ( npm install eslint --save-dev ) in your project and specify path/to/project/node_modules/eslint as ESLint package: value. my paths may be set up different so do this in conjunction with "Daydream Nation" answer you should get it working.
Plugin and eslint needs to be installed at the same location ie if eslint s global then plugin need to be global and if its local then both need to be local.
With that Webstorm uses local version of eslint and not global (thats how at least work on windows). So make sure you install eslint and plugin locally using npm install
.
I hope this helps.
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