Browse Source

Add prettier to eslint config

unoptim
GreatBearShark 2 years ago
parent
commit
ea5077376f
  1. 24
      .eslintrc.json
  2. 3
      package.json
  3. 16
      src/components/main.tsx
  4. 4
      yarn.lock

24
.eslintrc.json

@ -6,7 +6,8 @@
},
"plugins": [
"@typescript-eslint",
"jane"
"jane",
"prettier"
],
"settings": {
"react": {
@ -17,7 +18,9 @@
"plugin:jane/recommended",
"plugin:jane/react",
"plugin:jane/typescript",
"plugin:@typescript-eslint/recommended"
"plugin:@typescript-eslint/recommended",
"prettier",
"prettier/react"
],
"parser": "@typescript-eslint/parser",
"rules": {
@ -59,14 +62,25 @@
"jsx-a11y/no-onchange": 0,
"jsx-a11y/aria-role": 1,
"jsx-a11y/click-events-have-key-events": 1,
"react/no-did-update-set-state": 0
"react/no-did-update-set-state": 0,
"prettier/prettier": [
"error",
{
"trailingComma": "es5",
"singleQuote": true,
"printWidth": 80,
"arrowParens": "avoid"
}
]
},
"overrides": [
{
"files": ["*.js"],
"files": [
"*.js"
],
"rules": {
"@typescript-eslint/no-var-requires": 0
}
}
]
}
}

3
package.json

@ -93,8 +93,10 @@
"babel-preset-react-app": "^9.1.2",
"cssnano": "^4.1.10",
"eslint": "^7.6.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-inferno": "^7.20.1",
"eslint-plugin-jane": "^8.0.5",
"eslint-plugin-prettier": "^3.1.4",
"git-describe": "^4.0.4",
"jest": "^26.4.0",
"jest-environment-jsdom-fourteen": "^1.0.1",
@ -126,7 +128,6 @@
},
"lint-staged": {
"*.{ts,tsx,js}": [
"prettier --write",
"eslint --fix"
],
"../server/src/**/*.rs": [

16
src/components/main.tsx

@ -101,15 +101,15 @@ function getMoscowTime(): string {
function MoscowTime() {
const [time, setTime] = useState(null);
useInterval(() => {
setTime(getMoscowTime)
}, 1000, true)
useInterval(
() => {
setTime(getMoscowTime);
},
1000,
true
);
return (
<>
It is currently {time} in Moscow
</>
)
return <>It is currently {time} in Moscow</>;
}
interface MainProps {

4
yarn.lock

@ -6771,7 +6771,7 @@ [email protected]^1.1.0:
lodash.get "^4.4.2"
lodash.zip "^4.2.0"
[email protected]:
[email protected], [email protected]^6.11.0:
version "6.11.0"
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.11.0.tgz#f6d2238c1290d01c859a8b5c1f7d352a0b0da8b1"
integrity sha512-oB8cpLWSAjOVFEJhhyMZh6NOEOtBVziaqdDQ86+qhDHFbZXoRTM7pNSvFRfW/W/L/LrQ38C99J5CGuRBBzBsdA==
@ -6900,7 +6900,7 @@ [email protected]:
resolve "^1.10.1"
semver "^6.1.0"
[email protected]:
[email protected], [email protected]^3.1.4:
version "3.1.4"
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.4.tgz#168ab43154e2ea57db992a2cd097c828171f75c2"
integrity sha512-jZDa8z76klRqo+TdGDTFJSavwbnWK2ZpqGKNZ+VvweMW516pDUMmQ2koXvxEE4JhzNvTv+radye/bWGBmA6jmg==

Loading…
Cancel
Save