Commit a9a679cd by zhanghaozhe

lint-test

parent 4a33873b
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
"html-webpack-plugin": "4.0.0-beta.11", "html-webpack-plugin": "4.0.0-beta.11",
"html2canvas": "^1.0.0-rc.5", "html2canvas": "^1.0.0-rc.5",
"http-proxy-middleware": "^0.19.2", "http-proxy-middleware": "^0.19.2",
"husky": "^4.2.5",
"identity-obj-proxy": "3.0.0", "identity-obj-proxy": "3.0.0",
"jest": "24.9.0", "jest": "24.9.0",
"jest-environment-jsdom-fourteen": "1.0.1", "jest-environment-jsdom-fourteen": "1.0.1",
...@@ -64,6 +65,7 @@ ...@@ -64,6 +65,7 @@
"json-stringify-safe": "^5.0.1", "json-stringify-safe": "^5.0.1",
"less": "^3.12.2", "less": "^3.12.2",
"less-loader": "^4.1.0", "less-loader": "^4.1.0",
"lint-staged": "^10.2.11",
"lodash": "^4.17.19", "lodash": "^4.17.19",
"mini-css-extract-plugin": "0.9.0", "mini-css-extract-plugin": "0.9.0",
"node-sass": "^4.14.1", "node-sass": "^4.14.1",
...@@ -121,6 +123,14 @@ ...@@ -121,6 +123,14 @@
"storybook": "start-storybook -p 6006", "storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook" "build-storybook": "build-storybook"
}, },
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.js": "prettier --write"
},
"eslintConfig": { "eslintConfig": {
"extends": "react-app", "extends": "react-app",
"globals": { "globals": {
......
...@@ -2,7 +2,9 @@ import React, { useState } from "react" ...@@ -2,7 +2,9 @@ import React, { useState } from "react"
import { withRouter } from "react-router-dom" import { withRouter } from "react-router-dom"
const TSTest: React.FC = () => { const TSTest: React.FC = () => {
const [count, setCount] = useState(0) const [count,
setCount] =
useState(0)
function handleAlertClick() { function handleAlertClick() {
setTimeout(() => { setTimeout(() => {
...@@ -13,7 +15,8 @@ const TSTest: React.FC = () => { ...@@ -13,7 +15,8 @@ const TSTest: React.FC = () => {
return ( return (
<div> <div>
<p>You clicked {count} times</p> <p>You clicked {count} times</p>
<button onClick={() => setCount(count + 1)}>Click me</button> <button onClick={() => setCount(count +
1)}>Click me</button>
<button onClick={handleAlertClick}>Show alert</button> <button onClick={handleAlertClick}>Show alert</button>
</div> </div>
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment