Skip to content

Commit

Permalink
DEP: update and sync react rules with airbnb;
Browse files Browse the repository at this point in the history
  • Loading branch information
hans-lizihan committed Oct 22, 2017
1 parent 7330312 commit ae8f093
Show file tree
Hide file tree
Showing 3 changed files with 337 additions and 130 deletions.
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "eslint-config-aftership",
"description": "AfterShip ESLint config (modified from Airbnb)",
"version": "4.0.2",
"version": "4.1.0",
"homepage": "https://github.com/AfterShip/eslint-config-aftership",
"author": {
"name": "AfterShip",
Expand All @@ -24,22 +24,22 @@
"prepush": "npm run lint"
},
"optionalDependencies": {
"babel-eslint": "^7.2.3",
"eslint-plugin-import": "^2.6.0",
"babel-eslint": "^8.0.1",
"eslint-import-resolver-webpack": "^0.8.3",
"eslint-plugin-html": "^3.0.0",
"eslint-plugin-jsx-a11y": "^6.0.0",
"eslint-plugin-react": "^7.1.0",
"eslint-plugin-html": "^3.2.2",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-react": "^7.4.0",
"eslint-plugin-vue": "^3.3.0",
"vue-eslint-parser": "^1.1.0-7"
},
"peerDependencies": {
"eslint": "^4.1.1"
},
"devDependencies": {
"eslint": "^4.1.1",
"eslint": "^4.9.0",
"eslint-plugin-import": "^2.6.0",
"husky": "^0.14.1"
"husky": "^0.14.3"
},
"dependencies": {
"eslint-restricted-globals": "^0.1.1"
Expand Down
12 changes: 12 additions & 0 deletions rules/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,10 @@ module.exports = {
skipShapeProps: true
}],

// Prevent unused state values
// https://github.com/yannickcr/eslint-plugin-react/pull/1103/
'react/no-unused-state': 'error',

// Require style prop value be an object or var
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/style-prop-object.md
'react/style-prop-object': 'error',
Expand All @@ -296,6 +300,14 @@ module.exports = {
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-children-prop.md
'react/no-children-prop': 'error',

// Enforce all defaultProps have a corresponding non-required PropType
// https://github.com/yannickcr/eslint-plugin-react/blob/9e13ae2c51e44872b45cc15bf1ac3a72105bdd0e/docs/rules/default-props-match-prop-types.md
'react/default-props-match-prop-types': ['error', {allowRequiredDefaults: false}],

// Prevent usage of shouldComponentUpdate when extending React.PureComponent
// https://github.com/yannickcr/eslint-plugin-react/blob/9e13ae2c51e44872b45cc15bf1ac3a72105bdd0e/docs/rules/no-redundant-should-component-update.md
'react/no-redundant-should-component-update': 'error',

// Validate whitespace in and around the JSX opening and closing brackets
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-tag-spacing.md
'react/jsx-tag-spacing': ['error', {
Expand Down
Loading

0 comments on commit ae8f093

Please sign in to comment.