.lintstagedrc.js 412 B

123456789101112131415
  1. const { CLIEngine } = require("eslint");
  2. // see https://github.com/okonet/lint-staged#how-can-i-ignore-files-from-eslintignore-
  3. // for explanation
  4. const cli = new CLIEngine({});
  5. module.exports = {
  6. "*.{js,ts,tsx}": files => {
  7. return (
  8. "eslint --max-warnings=0 --fix " + files.filter(file => !cli.isPathIgnored(file)).join(" ")
  9. );
  10. },
  11. "*.{css,scss,json,md,html,yml}": ["prettier --write"],
  12. };