Skip to content

Commit

Permalink
feat: update eslint-config for eslint 6
Browse files Browse the repository at this point in the history
Also take some config from ongoing project to make life easier.
Incorporate react-hooks to the mix.
swashata committed Oct 27, 2019
1 parent 12c07c8 commit 46a3554
Showing 5 changed files with 417 additions and 102 deletions.
9 changes: 9 additions & 0 deletions packages/eslint-config/config/rules.js
Original file line number Diff line number Diff line change
@@ -11,4 +11,13 @@ module.exports = {
allowForLoopAfterthoughts: true,
},
],
'react/jsx-filename-extension': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'react/destructuring-assignment': 'off',
'no-nested-ternary': 'off',
eqeqeq: ['error', 'smart'],
'prefer-destructuring': 'off',
'func-names': 'off',
'lines-between-class-members': 'off',
};
2 changes: 1 addition & 1 deletion packages/eslint-config/index.js
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ module.exports = {
},
sourceType: 'module',
},
plugins: ['babel'],
plugins: ['babel', 'react-hooks'],
rules: {
...rules,
// ===================================
27 changes: 14 additions & 13 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
@@ -15,18 +15,19 @@
"license": "MIT",
"private": false,
"dependencies": {
"@typescript-eslint/eslint-plugin": "1.7.0",
"@typescript-eslint/parser": "1.7.0",
"babel-eslint": "^10.0.1",
"eslint-config-airbnb": "^17.1.0",
"eslint-config-prettier": "^4.2.0",
"eslint-import-resolver-typescript": "1.1.1",
"@typescript-eslint/eslint-plugin": "2.5.0",
"@typescript-eslint/parser": "2.5.0",
"babel-eslint": "^10.0.3",
"eslint-config-airbnb": "^18.0.1",
"eslint-config-prettier": "^6.5.0",
"eslint-import-resolver-typescript": "2.0.0",
"eslint-plugin-babel": "^5.3.0",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-jest": "^22.5.1",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-prettier": "^3.0.1",
"eslint-plugin-react": "^7.13.0"
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jest": "^22.21.0",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-react": "^7.16.0",
"eslint-plugin-react-hooks": "^2.2.0"
},
"engines": {
"node": ">=8.9.0"
@@ -36,7 +37,7 @@
"access": "public"
},
"devDependencies": {
"eslint": "5.16.0",
"prettier": "1.17.1"
"eslint": "6.6.0",
"prettier": "1.18.2"
}
}
3 changes: 3 additions & 0 deletions packages/eslint-config/ts.js
Original file line number Diff line number Diff line change
@@ -29,9 +29,12 @@ module.exports = {
'react/default-props-match-prop-types': 'off',
'react/no-unused-prop-types': 'off',
// typescript specific rules
'@typescript-eslint/prefer-interface': 'off',
'import/prefer-default-export': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/camelcase': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'class-methods-use-this': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'import/no-cycle': 'off',
478 changes: 390 additions & 88 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit 46a3554

Please sign in to comment.