summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.lintstagedrc.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/.lintstagedrc.js b/.lintstagedrc.js
new file mode 100644
index 0000000..612d4c3
--- /dev/null
+++ b/.lintstagedrc.js
@@ -0,0 +1,14 @@
+const { CLIEngine } = require("eslint");
+
+// see https://github.com/okonet/lint-staged#how-can-i-ignore-files-from-eslintignore-
+// for explanation
+const cli = new CLIEngine({});
+
+module.exports = {
+ "*.{js,ts,tsx}": files => {
+ return (
+ "eslint --max-warnings=0 --fix " + files.filter(file => !cli.isPathIgnored(file)).join(" ")
+ );
+ },
+ "*.{css,scss,json,md,html,yml}": ["prettier --write"],
+};