Skip to content

Commit

Permalink
Add ESLint
Browse files Browse the repository at this point in the history
  • Loading branch information
hswolff committed Jul 29, 2020
1 parent 5caa9c1 commit 405c41e
Show file tree
Hide file tree
Showing 5 changed files with 616 additions and 21 deletions.
25 changes: 25 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
env: {
browser: true,
es2020: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 11,
sourceType: 'module',
},
plugins: ['react', '@typescript-eslint'],
rules: {
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
},
};
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start"
"start": "next start",
"lint": "eslint ."
},
"dependencies": {
"next": "9.5.0",
Expand All @@ -15,6 +16,10 @@
"devDependencies": {
"@types/node": "^14.0.27",
"@types/react": "^16.9.43",
"@typescript-eslint/eslint-plugin": "^3.7.1",
"@typescript-eslint/parser": "^3.7.1",
"eslint": "^7.5.0",
"eslint-plugin-react": "^7.20.5",
"typescript": "^3.9.7"
}
}
6 changes: 3 additions & 3 deletions pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import '../styles/globals.css'
import '../styles/globals.css';

function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />
return <Component {...pageProps} />;
}

export default MyApp
export default MyApp;
6 changes: 3 additions & 3 deletions pages/api/hello.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction

export default (req, res) => {
res.statusCode = 200
res.json({ name: 'John Doe' })
}
res.statusCode = 200;
res.json({ name: 'John Doe' });
};
Loading

0 comments on commit 405c41e

Please sign in to comment.