Running ESLint
With your config in place, run ESLint as you normally would.
Lint your code
Section titled “Lint your code”npx eslint src/Auto-fix
Section titled “Auto-fix”npx eslint src/ --fixAdd scripts to package.json
Section titled “Add scripts to package.json”For convenience, add these to your package.json:
{ "scripts": { "lint": "eslint src/", "lint:fix": "eslint src/ --fix" }}Then run:
npm run lintnpm run lint:fixWhat gets enforced
Section titled “What gets enforced”Out of the box, uglier enforces:
- No semicolons (ASI)
- Double quotes
- 2-space indentation
- No spaces after control keywords (
if(x)notif (x)) - Arrow parens only when needed (
x =>not(x) =>) - 1TBS brace style
- Mandatory blank lines after control statements
- No internal object spacing (
{a: 1}not{ a: 1 }) - 80 character max line length
- JSDoc documentation requirements (when using
lints-jsdoc)
All of these can be customized — see Customization.