Skip to content

Commit 76db285

Browse files
committed
[Fix] Eslint config
1 parent 3f6204a commit 76db285

File tree

5 files changed

+40
-23
lines changed

5 files changed

+40
-23
lines changed

.eslintrc.js

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ module.exports = {
88
"eslint:recommended",
99
"plugin:react/recommended",
1010
"plugin:@typescript-eslint/recommended",
11-
"prettier/@typescript-eslint",
1211
"plugin:prettier/recommended"
1312
],
1413
parser: "@typescript-eslint/parser",
@@ -19,20 +18,12 @@ module.exports = {
1918
ecmaVersion: 12,
2019
sourceType: "module"
2120
},
22-
plugins: ["react", "@typescript-eslint", "prettier/@typescript-eslint"],
21+
plugins: ["react", "@typescript-eslint"],
2322
rules: {
2423
"prettier/prettier": ["error", { endOfLine: "auto" }, { usePrettierrc: true }],
2524
"react/react-in-jsx-scope": "off",
2625
"@typescript-eslint/no-var-requires": "off",
2726
"react/prop-types": "off",
28-
"@typescript-eslint/explicit-function-return-type": "off",
29-
"jsx-a11y/anchor-is-valid": [
30-
"error",
31-
{
32-
components: ["Link"],
33-
specialLink: ["hrefLeft", "hrefRight"],
34-
aspects: ["invalidHref", "preferButton"]
35-
}
36-
]
27+
"@typescript-eslint/explicit-function-return-type": "off"
3728
}
3829
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"@typescript-eslint/parser": "^4.15.2",
4646
"eslint": "^7.20.0",
4747
"eslint-config-prettier": "^8.0.0",
48+
"eslint-plugin-prettier": "^3.3.1",
4849
"eslint-plugin-react": "^7.22.0",
4950
"prettier": "2.2.1"
5051
}

src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import React from "react"
21
import logo from "./logo.svg"
32
import "./App.css"
3+
import { ReactElement } from "react"
44

5-
function App() {
5+
function App(): ReactElement {
66
return (
77
<div className="App">
88
<header className="App-header">

src/reportWebVitals.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
import { ReportHandler } from 'web-vitals';
1+
import { ReportHandler } from "web-vitals"
22

3+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
34
const reportWebVitals = (onPerfEntry?: ReportHandler) => {
45
if (onPerfEntry && onPerfEntry instanceof Function) {
5-
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
6-
getCLS(onPerfEntry);
7-
getFID(onPerfEntry);
8-
getFCP(onPerfEntry);
9-
getLCP(onPerfEntry);
10-
getTTFB(onPerfEntry);
11-
});
6+
import("web-vitals").then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
7+
getCLS(onPerfEntry)
8+
getFID(onPerfEntry)
9+
getFCP(onPerfEntry)
10+
getLCP(onPerfEntry)
11+
getTTFB(onPerfEntry)
12+
})
1213
}
13-
};
14+
}
1415

15-
export default reportWebVitals;
16+
export default reportWebVitals

yarn.lock

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4482,6 +4482,11 @@ escodegen@^1.14.1:
44824482
optionalDependencies:
44834483
source-map "~0.6.1"
44844484

4485+
eslint-config-prettier@^8.0.0:
4486+
version "8.0.0"
4487+
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.0.0.tgz#024d661444319686c588c8849c8da33815dbdb1c"
4488+
integrity sha512-5EaAVPsIHu+grmm5WKjxUia4yHgRrbkd8I0ffqUSwixCPMVBrbS97UnzlEY/Q7OWo584vgixefM0kJnUfo/VjA==
4489+
44854490
eslint-config-react-app@^6.0.0:
44864491
version "6.0.0"
44874492
resolved "https://registry.yarnpkg.com/eslint-config-react-app/-/eslint-config-react-app-6.0.0.tgz#ccff9fc8e36b322902844cbd79197982be355a0e"
@@ -4556,6 +4561,13 @@ eslint-plugin-jsx-a11y@^6.3.1:
45564561
jsx-ast-utils "^3.1.0"
45574562
language-tags "^1.0.5"
45584563

4564+
eslint-plugin-prettier@^3.3.1:
4565+
version "3.3.1"
4566+
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.3.1.tgz#7079cfa2497078905011e6f82e8dd8453d1371b7"
4567+
integrity sha512-Rq3jkcFY8RYeQLgk2cCwuc0P7SEFwDravPhsJZOQ5N4YI4DSg50NyqJ/9gdZHzQlHf8MvafSesbNJCcP/FF6pQ==
4568+
dependencies:
4569+
prettier-linter-helpers "^1.0.0"
4570+
45594571
eslint-plugin-react-hooks@^4.2.0:
45604572
version "4.2.0"
45614573
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.2.0.tgz#8c229c268d468956334c943bb45fc860280f5556"
@@ -4960,6 +4972,11 @@ fast-deep-equal@^3.1.1:
49604972
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"
49614973
integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==
49624974

4975+
fast-diff@^1.1.2:
4976+
version "1.2.0"
4977+
resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03"
4978+
integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==
4979+
49634980
fast-glob@^3.1.1:
49644981
version "3.2.5"
49654982
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.5.tgz#7939af2a656de79a4f1901903ee8adcaa7cb9661"
@@ -8829,6 +8846,13 @@ prepend-http@^1.0.0:
88298846
resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc"
88308847
integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=
88318848

8849+
prettier-linter-helpers@^1.0.0:
8850+
version "1.0.0"
8851+
resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b"
8852+
integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==
8853+
dependencies:
8854+
fast-diff "^1.1.2"
8855+
88328856
prettier@2.2.1:
88338857
version "2.2.1"
88348858
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5"

0 commit comments

Comments
 (0)