This repository contains all the code style settings we use at 500Tech.
There are four files for eslint:
- .eslintrc
- .eslintrc-angular
- .eslintrc-react
- .eslintrc-both
All four files share the standard rule set. The first file (without a suffix) is a clean rule set without any plugins. The last one includes all rules both for angular and react.
It's best to add ESLint support to WebStorm:
- npm i -g eslint eslint-plugin-react eslint-plugin-angular
- File | Default Settings | Languages & Frameworks | JavaScript | Code Quality Tools | ESLint
- Enable
- Node interpreter: /usr/local/bin/node
- ESLint package: /usr/local/lib/node_modules/eslint
- Check "Search for .eslintrc"
- Put .eslintrc at the root of the project
Note: If you use angular/react versions of the file, don't forget to remove the suffix in the filename.
This file includes the default code style settings for WebStorm.
- File | Import Settings
- Import the file
- Restart WS
- File | Default Settings | Editor | Code Style
- Select "500Tech Default" scheme (on the top)
Note: You might need to apply this scheme to existing projects.
This file includes the default inspections settings for WebStorm. This should work well together with ESLint configuration, as the rules and the inspections are manually matched.
- File | Default Settings | Editor | Inspections
- Profile: Manage → Import
- Select the "500Tech Default" profile
Note: You might need to apply this profile to existing projects.