Skip to content

Commit 838e43e

Browse files
committed
chore: Use stricter eslint rules
1 parent 2be509f commit 838e43e

File tree

5 files changed

+40
-8
lines changed

5 files changed

+40
-8
lines changed

client/.eslintrc.json

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@
22
"env": {
33
"node": true,
44
"browser": true,
5-
"es6": true
5+
"commonjs": true,
6+
"es2021": true
67
},
7-
"extends": "next/core-web-vitals",
8+
"extends": [
9+
"next/core-web-vitals",
10+
"eslint:recommended",
11+
"plugin:react/recommended",
12+
"plugin:react-hooks/recommended"
13+
],
814
"plugins": [
915
"eslint-plugin-react", "eslint-plugin-react-hooks"
1016
],
@@ -15,7 +21,10 @@
1521
"semi": ["error", "never"],
1622
"no-unused-vars": "error",
1723
"no-undef": "error",
18-
"no-trailing-spaces": "error",
19-
"no-console": ["error", { "allow": ["error"] }]
24+
"no-console": ["error", { "allow": ["error"] }],
25+
"react/react-in-jsx-scope": "off",
26+
"no-restricted-imports": [
27+
"error", { "patterns": ["@/features/*/*"] }
28+
]
2029
}
21-
}
30+
}

client/src/common/layout/page/index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
import PropTypes from 'prop-types'
12
import HeadComponent from '../head'
23

3-
export default function Page ({ children }) {
4+
function Page ({ children }) {
45
return (
56
<div style={{
67
height: '100vh',
@@ -11,3 +12,10 @@ export default function Page ({ children }) {
1112
</div>
1213
)
1314
}
15+
16+
Page.propTypes = {
17+
children: PropTypes.node
18+
}
19+
20+
export default Page
21+

client/src/common/ui/card/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import PropTypes from 'prop-types'
12
import styles from './Card.module.css'
23

34
function Card ({ children }) {
@@ -8,4 +9,8 @@ function Card ({ children }) {
89
)
910
}
1011

12+
Card.propTypes = {
13+
children: PropTypes.node
14+
}
15+
1116
export default Card

client/src/features/users/userscontainer/users.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ function UsersComponent ({
5858

5959
UsersComponent.propTypes = {
6060
addUser: PropTypes.func,
61-
deleteUser: PropTypes.func
61+
deleteUser: PropTypes.func,
62+
deleteTodo: PropTypes.func,
63+
addTodo: PropTypes.func,
6264
}
6365

6466
export default UsersComponent

client/src/pages/_app.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
1+
import PropTypes from 'prop-types'
12
import { Provider } from 'react-redux'
23
import { store } from '@/store/store'
34

45
import '@/styles/globals.css'
56

6-
export default function App({ Component, pageProps }) {
7+
function App({ Component, pageProps }) {
78
return (
89
<Provider store={store}>
910
<Component {...pageProps} />
1011
</Provider>
1112
)
1213
}
14+
15+
App.propTypes = {
16+
Component: PropTypes.func,
17+
pageProps: PropTypes.object
18+
}
19+
20+
export default App

0 commit comments

Comments
 (0)