Skip to content

Commit 1fe7f40

Browse files
fix lint
1 parent 2da60f9 commit 1fe7f40

File tree

7 files changed

+55
-145
lines changed

7 files changed

+55
-145
lines changed

.eslintrc.json

Lines changed: 3 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -1,101 +1,7 @@
11
{
2-
"root": true,
3-
"extends": [
4-
"plugin:@typescript-eslint/recommended",
5-
"plugin:jsx-a11y/recommended"
6-
],
7-
"parser": "@typescript-eslint/parser",
8-
"plugins": [
9-
"jsx-a11y",
10-
"import",
11-
"sort-keys-fix",
12-
"react-hooks",
13-
"@typescript-eslint",
14-
"prettier",
15-
"cypress"
16-
],
2+
"extends": "typescript-react-pro",
3+
"plugins": ["cypress"],
174
"env": {
18-
"browser": true,
19-
"node": true,
20-
"es6": true,
21-
"jest": true,
225
"cypress/globals": true
23-
},
24-
"globals": {
25-
"JSX": "readonly"
26-
},
27-
"settings": {
28-
"react": {
29-
"version": "detect"
30-
},
31-
"import/parsers": {
32-
"@typescript-eslint/parser": [".ts", ".tsx"]
33-
},
34-
"import/resolver": {
35-
"node": {
36-
"extensions": [".js", ".jsx", ".ts", ".tsx"]
37-
},
38-
"typescript": {
39-
"alwaysTryTypes": true,
40-
// always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
41-
"project": ["tsconfig.json"]
42-
}
43-
}
44-
},
45-
"rules": {
46-
"no-alert": "error",
47-
"no-console": "error",
48-
"react-hooks/rules-of-hooks": "error",
49-
"prettier/prettier": [
50-
"warn",
51-
{},
52-
{
53-
"properties": {
54-
"usePrettierrc": true
55-
}
56-
}
57-
],
58-
"import/order": [
59-
"warn",
60-
{
61-
"groups": [
62-
"builtin",
63-
"external",
64-
"internal",
65-
"parent",
66-
"sibling",
67-
"index",
68-
"object"
69-
],
70-
"newlines-between": "always",
71-
"alphabetize": {
72-
"order": "asc",
73-
"caseInsensitive": true
74-
}
75-
}
76-
],
77-
"import/named": "error",
78-
"import/default": "error",
79-
"import/export": "error",
80-
"import/no-named-as-default": "warn",
81-
"import/no-named-as-default-member": "off",
82-
"import/no-duplicates": "error",
83-
"import/no-unresolved": "error",
84-
"sort-keys-fix/sort-keys-fix": "warn",
85-
"@typescript-eslint/no-non-null-assertion": "off",
86-
"@typescript-eslint/consistent-type-imports": "warn",
87-
"@typescript-eslint/no-explicit-any": "off",
88-
"@typescript-eslint/ban-types": "off",
89-
"@typescript-eslint/ban-ts-comment": "off",
90-
"@typescript-eslint/no-empty-function": "off"
91-
},
92-
"overrides": [
93-
{
94-
"files": ["*.js"],
95-
"rules": {
96-
"@typescript-eslint/explicit-module-boundary-types": ["off"],
97-
"@typescript-eslint/no-var-requires": ["off"]
98-
}
99-
}
100-
]
6+
}
1017
}

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ So this project aming new React learner and who have not written React for a lon
2525

2626
I'm glad to even the repo could be useful for your learning. 🤗3
2727

28-
29-
30-
31-
3228
[![Edit react-typescript-todomvc-2022](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/quizzical-blackwell-bvfc5?fontsize=14&hidenavigation=1&theme=dark)
3329

3430
---

package.json

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,18 @@
3434
"@types/react": "^18.0.14",
3535
"@types/react-dom": "^18.0.5",
3636
"@types/styled-components": "^5.1.25",
37-
"@typescript-eslint/eslint-plugin": "^5.29.0",
38-
"@typescript-eslint/parser": "^5.29.0",
3937
"@vitejs/plugin-react": "^1.3.2",
4038
"all-contributors-cli": "^6.19.0",
4139
"cypress": "9.7.0",
42-
"eslint": "^8.18.0",
43-
"eslint-config-prettier": "^8.5.0",
44-
"eslint-config-typescript": "^3.0.0",
40+
"eslint-config-typescript-react-pro": "^1.2.1",
4541
"eslint-plugin-cypress": "^2.12.1",
46-
"eslint-plugin-import": "^2.26.0",
47-
"eslint-plugin-jsx-a11y": "^6.5.1",
48-
"eslint-plugin-prettier": "^4.0.0",
49-
"eslint-plugin-react-hooks": "^4.6.0",
50-
"eslint-plugin-sort-keys-fix": "^1.1.2",
5142
"jest": "^28.1.1",
5243
"jest-environment-jsdom": "^28.1.1",
5344
"jest-watch-typeahead": "^1.1.0",
5445
"prettier": "^2.7.1",
5546
"rimraf": "^3.0.2",
5647
"serve": "^13.0.2",
57-
"typescript": "^4.6.4",
48+
"typescript": "^4.7.4",
5849
"vite": "^2.9.12"
5950
},
6051
"scripts": {

src/App/TodoMVC.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ import NewTodoInput from './NewTodoInput'
99
import { Layout } from './style'
1010
import TodoList from './TodoList'
1111
import UnderBar from './UnderBar'
12-
import { BrowserRouter, Routes, Route } from 'react-router-dom'
13-
import { RecoilRoot } from 'recoil'
14-
import { NotFound } from '../NotFound'
15-
1612

1713
const TodoMVC: React.FC = () => {
1814
const appState = useRecoilValue<AppState>(recoilState)
@@ -31,8 +27,8 @@ const TodoMVC: React.FC = () => {
3127
<NewTodoInput />
3228
{appState.todoList.length ? (
3329
<>
34-
<TodoList />
35-
<UnderBar />
30+
<TodoList />
31+
<UnderBar />
3632
</>
3733
) : null}
3834
</section>
@@ -41,4 +37,4 @@ const TodoMVC: React.FC = () => {
4137
)
4238
}
4339

44-
export default TodoMVC
40+
export default TodoMVC

src/App/index.tsx

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1-
import ErrorBoundary from '../ErrorBoundary'
2-
import { RecoilRoot } from 'recoil'
31
import { BrowserRouter, Routes, Route } from 'react-router-dom'
4-
import TodoMVC from './TodoMVC'
2+
import { RecoilRoot } from 'recoil'
3+
4+
import ErrorBoundary from '../ErrorBoundary'
55
import { NotFound } from '../NotFound'
66

7-
const App: React.FC = () => (<ErrorBoundary>
8-
<BrowserRouter>
9-
<RecoilRoot>
10-
<Routes>
11-
<Route path="/" element={<TodoMVC />} />
12-
<Route path="*" element={<NotFound />} />
13-
</Routes>
14-
</RecoilRoot>
15-
</BrowserRouter>
16-
</ErrorBoundary>)
7+
import TodoMVC from './TodoMVC'
178

9+
const App: React.FC = () => (
10+
<ErrorBoundary>
11+
<BrowserRouter>
12+
<RecoilRoot>
13+
<Routes>
14+
<Route path="/" element={<TodoMVC />} />
15+
<Route path="*" element={<NotFound />} />
16+
</Routes>
17+
</RecoilRoot>
18+
</BrowserRouter>
19+
</ErrorBoundary>
20+
)
1821

1922
export default App

src/main.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
21
import React from 'react'
32
import ReactDOM from 'react-dom/client'
4-
import { RecoilRoot } from 'recoil'
53

64
import './index.css'
75
import App from './App'
8-
import ErrorBoundary from './ErrorBoundary'
9-
import { NotFound } from './NotFound'
106

117
const root = ReactDOM.createRoot(document.getElementById('root')!)
128

139
root.render(<App />)
14-

yarn.lock

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,7 +1234,7 @@
12341234
dependencies:
12351235
"@types/node" "*"
12361236

1237-
"@typescript-eslint/eslint-plugin@^5.29.0":
1237+
"@typescript-eslint/eslint-plugin@^5.28.0":
12381238
version "5.29.0"
12391239
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.29.0.tgz#c67794d2b0fd0b4a47f50266088acdc52a08aab6"
12401240
integrity sha512-kgTsISt9pM53yRFQmLZ4npj99yGl3x3Pl7z4eA66OuTzAGC4bQB5H5fuLwPnqTKU3yyrrg4MIhjF17UYnL4c0w==
@@ -1249,7 +1249,7 @@
12491249
semver "^7.3.7"
12501250
tsutils "^3.21.0"
12511251

1252-
"@typescript-eslint/parser@^5.29.0":
1252+
"@typescript-eslint/parser@^5.28.0":
12531253
version "5.29.0"
12541254
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.29.0.tgz#41314b195b34d44ff38220caa55f3f93cfca43cf"
12551255
integrity sha512-ruKWTv+x0OOxbzIw9nW5oWlUopvP/IQDjB5ZqmTglLIoDTctLlAJpAQFpNPJP/ZI7hTT9sARBosEfaKbcFuECw==
@@ -2593,10 +2593,22 @@ eslint-config-prettier@^8.5.0:
25932593
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz#5a81680ec934beca02c7b1a61cf8ca34b66feab1"
25942594
integrity sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==
25952595

2596-
eslint-config-typescript@^3.0.0:
2597-
version "3.0.0"
2598-
resolved "https://registry.yarnpkg.com/eslint-config-typescript/-/eslint-config-typescript-3.0.0.tgz#13e0627f8c5aa8d58b5a01eeddd0a726a259c4b5"
2599-
integrity sha512-CwC2cQ29OLE1OUw0k+Twpc6wpCdenG8rrErl89sWrzmMpWfkulyeQS1HJhhjU0B3Tb4k41zdei4LtX26x5m60Q==
2596+
eslint-config-typescript-react-pro@^1.2.1:
2597+
version "1.2.1"
2598+
resolved "https://registry.yarnpkg.com/eslint-config-typescript-react-pro/-/eslint-config-typescript-react-pro-1.2.1.tgz#4727b7ddfcace358b111c7e7483f1d9f5c477735"
2599+
integrity sha512-mEp4dRyIGXBDiURmCK9z4kJ/33sZBpnLE5wxjyrEqh63UFR8gYkg2XAKwgrmclhTfamM+MpXbZkN3ptFxtcrnA==
2600+
dependencies:
2601+
"@typescript-eslint/eslint-plugin" "^5.28.0"
2602+
"@typescript-eslint/parser" "^5.28.0"
2603+
eslint "^8.18.0"
2604+
eslint-config-prettier "^8.5.0"
2605+
eslint-import-resolver-typescript "^2.7.1"
2606+
eslint-plugin-import "^2.26.0"
2607+
eslint-plugin-jsx-a11y "^6.5.1"
2608+
eslint-plugin-prettier "^4.0.0"
2609+
eslint-plugin-react-hooks "^4.6.0"
2610+
eslint-plugin-sort-keys-fix "^1.1.2"
2611+
prettier "^2.7.1"
26002612

26012613
eslint-import-resolver-node@^0.3.6:
26022614
version "0.3.6"
@@ -2606,6 +2618,17 @@ eslint-import-resolver-node@^0.3.6:
26062618
debug "^3.2.7"
26072619
resolve "^1.20.0"
26082620

2621+
eslint-import-resolver-typescript@^2.7.1:
2622+
version "2.7.1"
2623+
resolved "https://registry.yarnpkg.com/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-2.7.1.tgz#a90a4a1c80da8d632df25994c4c5fdcdd02b8751"
2624+
integrity sha512-00UbgGwV8bSgUv34igBDbTOtKhqoRMy9bFjNehT40bXg6585PNIct8HhXZ0SybqB9rWtXj9crcku8ndDn/gIqQ==
2625+
dependencies:
2626+
debug "^4.3.4"
2627+
glob "^7.2.0"
2628+
is-glob "^4.0.3"
2629+
resolve "^1.22.0"
2630+
tsconfig-paths "^3.14.1"
2631+
26092632
eslint-module-utils@^2.7.3:
26102633
version "2.7.3"
26112634
resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.7.3.tgz#ad7e3a10552fdd0642e1e55292781bd6e34876ee"
@@ -3177,7 +3200,7 @@ glob-parent@^6.0.1:
31773200
dependencies:
31783201
is-glob "^4.0.3"
31793202

3180-
glob@^7.1.3, glob@^7.1.4:
3203+
glob@^7.1.3, glob@^7.1.4, glob@^7.2.0:
31813204
version "7.2.3"
31823205
resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b"
31833206
integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==
@@ -5602,7 +5625,7 @@ type-fest@^0.21.3:
56025625
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37"
56035626
integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==
56045627

5605-
typescript@^4.6.4:
5628+
typescript@^4.7.4:
56065629
version "4.7.4"
56075630
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235"
56085631
integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==

0 commit comments

Comments
 (0)