Skip to content

Running ESLint

With your config in place, run ESLint as you normally would.

Terminal window
npx eslint src/
Terminal window
npx eslint src/ --fix

For convenience, add these to your package.json:

{
"scripts": {
"lint": "eslint src/",
"lint:fix": "eslint src/ --fix"
}
}

Then run:

Terminal window
npm run lint
npm run lint:fix

Out of the box, uglier enforces:

  • No semicolons (ASI)
  • Double quotes
  • 2-space indentation
  • No spaces after control keywords (if(x) not if (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.