Use prop-types, update ESLint config.

This commit is contained in:
Jayden Seric 2021-02-10 00:30:41 +11:00
parent 186748ed55
commit ddba8be6a4
4 changed files with 16 additions and 3 deletions

View File

@ -1,6 +1,11 @@
{ {
"extends": ["env"], "extends": ["env"],
"rules": { "overrides": [
"react/prop-types": "off" {
} "files": ["components/**/*.js", "pages/**/*.js"],
"rules": {
"jsdoc/require-jsdoc": "off"
}
}
]
} }

View File

@ -1,4 +1,5 @@
import Head from 'next/head'; import Head from 'next/head';
import PropTypes from 'prop-types';
export const Page = ({ title, children }) => ( export const Page = ({ title, children }) => (
<> <>
@ -8,3 +9,8 @@ export const Page = ({ title, children }) => (
{children} {children}
</> </>
); );
Page.propTypes = {
title: PropTypes.string.isRequired,
children: PropTypes.node.isRequired
}

1
app/package-lock.json generated
View File

@ -12,6 +12,7 @@
"device-agnostic-ui": "^7.0.1", "device-agnostic-ui": "^7.0.1",
"graphql": "^15.5.0", "graphql": "^15.5.0",
"next": "^10.0.6", "next": "^10.0.6",
"prop-types": "^15.7.2",
"react": "^17.0.1", "react": "^17.0.1",
"react-dom": "^17.0.1" "react-dom": "^17.0.1"
}, },

View File

@ -26,6 +26,7 @@
"device-agnostic-ui": "^7.0.1", "device-agnostic-ui": "^7.0.1",
"graphql": "^15.5.0", "graphql": "^15.5.0",
"next": "^10.0.6", "next": "^10.0.6",
"prop-types": "^15.7.2",
"react": "^17.0.1", "react": "^17.0.1",
"react-dom": "^17.0.1" "react-dom": "^17.0.1"
}, },