Editor config + Prettier + ESLint playground
Editorconfig helps maintain consistent coding styles for multiple developers working on the same project across various editors and IDEs.
Prettier - formatting tool integrating with most editors.
ESLint - ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code, with the goal of making code more consistent and avoiding bugs.
- clone repository
- npm i
- EditorConfig - installed
- Prettier - installed
To run Prettier on save in WebStorm 2020.1 or above, open Preferences | Languages & Frameworks | JavaScript | Prettier and enable the option Run on save for files. - Eslint - installed
go to Languages and Frameworks | JavaScript | Code Quality Tools | ESLint, and select the Automatic ESLint configuration option.
Use a command to manually call Prettier:
npm run pretiffy src/
To run an eslint check:
npm run lint:eslint src/
To fix eslint errors inside src
folder:
npm run lint:eslint:fix