lint-staged

This commit is contained in:
Kent C. Dodds
2018-09-14 21:05:07 -06:00
parent 053c5de689
commit 4e579627b7
3 changed files with 1776 additions and 1 deletions

11
.lintstagedrc Normal file
View File

@@ -0,0 +1,11 @@
{
"linters": {
"*.js": [
"eslint"
],
"*.+(js|jsx|json|yml|yaml|css|less|scss|ts|tsx|md|graphql|mdx)": [
"prettier --write",
"git add"
]
}
}

1763
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -9,7 +9,7 @@
"format": "npm run prettier -- --write", "format": "npm run prettier -- --write",
"prettier": "prettier \"**/*.+(js|jsx|json|yml|yaml|css|less|scss|ts|tsx|md|graphql|mdx)\"", "prettier": "prettier \"**/*.+(js|jsx|json|yml|yaml|css|less|scss|ts|tsx|md|graphql|mdx)\"",
"validate": "npm run lint && npm run prettier -- --list-different && npm run flow", "validate": "npm run lint && npm run prettier -- --list-different && npm run flow",
"precommit": "npm run validate" "precommit": "lint-staged && npm run flow"
}, },
"keywords": [], "keywords": [],
"author": "Kent C. Dodds <kent@doddsfamily.us> (http://kentcdodds.com/)", "author": "Kent C. Dodds <kent@doddsfamily.us> (http://kentcdodds.com/)",
@@ -20,6 +20,7 @@
"eslint-config-prettier": "^3.0.1", "eslint-config-prettier": "^3.0.1",
"flow-bin": "^0.81.0", "flow-bin": "^0.81.0",
"husky": "^0.14.3", "husky": "^0.14.3",
"lint-staged": "^7.2.2",
"prettier": "^1.14.2" "prettier": "^1.14.2"
} }
} }