pre-commit-hooks
pre-commit-hooks copied to clipboard
Add ESLint
Main new features, many of which are already enforced in our duolingo.com repo:
- Sort object keys alphabetically
- Collapse small object literals onto one line
- Sort members within each import statement
- Prefer
{ foo }instead of{ foo: foo } - Prefer returning expression from arrow function instead of using block form
- Name
catchvariablesexand omit if unused - Swap
ifandelsebranches to avoid unnecessary! - Use
Recordinstead of{ []: }form - Remove unnecessary
async - Collapse short JSDoc onto one line