Skip to content

Commit

Permalink
introduce eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
arthur791004 committed Aug 15, 2019
1 parent d4a6ff7 commit 5ebb615
Show file tree
Hide file tree
Showing 3 changed files with 750 additions and 25 deletions.
46 changes: 46 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
const config = {
extends: ['airbnb'],
parser: 'babel-eslint',
env: {
es6: true,
},
globals: {
document: true,
fetch: true,
},
settings: {
'import/resolver': {
'babel-module': {},
},
},
plugins: ['react', 'react-hooks'],
rules: {
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: ['internals/**/*.js', 'client/**/stories.js'],
},
],
'import/prefer-default-export': 0,
'no-else-return': 0,
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }],
'react/jsx-wrap-multilines': [
'error',
{
declaration: true,
assignment: true,
return: true,
},
],
'react/no-unused-prop-types': 0,
'react/prefer-stateless-function': [0, { ignorePureComponents: true }],
},
parserOptions: {
ecmaFeatures: {
jsx: true,
},
sourceType: 'module',
},
};

module.exports = config;
14 changes: 13 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,23 @@
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start"
"start": "next start",
"lint": "yarn run lint-eslint .",
"lint-eslint": "eslint --ignore-path .gitignore"
},
"dependencies": {
"next": "9.0.3",
"react": "16.9.0",
"react-dom": "16.9.0"
},
"devDependencies": {
"babel-eslint": "~10.0.2",
"eslint": "~6.1.0",
"eslint-config-airbnb": "~18.0.1",
"eslint-import-resolver-babel-module": "~5.1.0",
"eslint-plugin-import": "~2.18.2",
"eslint-plugin-jsx-a11y": "~6.2.3",
"eslint-plugin-react": "~7.14.3",
"eslint-plugin-react-hooks": "~1.7.0"
}
}
Loading

0 comments on commit 5ebb615

Please sign in to comment.