diff --git a/packages/eslint-config-airbnb-base/package.json b/packages/eslint-config-airbnb-base/package.json index 4ec14976..3ad23c44 100644 --- a/packages/eslint-config-airbnb-base/package.json +++ b/packages/eslint-config-airbnb-base/package.json @@ -58,14 +58,14 @@ "editorconfig-tools": "^0.1.1", "eslint": "^4.19.1 || ^5.3.0", "eslint-find-rules": "^3.3.1", - "eslint-plugin-import": "^2.14.0", + "eslint-plugin-import": "^2.15.0", "in-publish": "^2.0.0", "safe-publish-latest": "^1.1.2", "tape": "^4.9.1" }, "peerDependencies": { "eslint": "^4.19.1 || ^5.3.0", - "eslint-plugin-import": "^2.14.0" + "eslint-plugin-import": "^2.15.0" }, "engines": { "node": ">= 4" @@ -73,6 +73,6 @@ "dependencies": { "confusing-browser-globals": "^1.0.5", "object.assign": "^4.1.0", - "object.entries": "^1.0.4" + "object.entries": "^1.1.0" } } diff --git a/packages/eslint-config-airbnb-base/rules/imports.js b/packages/eslint-config-airbnb-base/rules/imports.js index fbeca8dc..1853ae05 100644 --- a/packages/eslint-config-airbnb-base/rules/imports.js +++ b/packages/eslint-config-airbnb-base/rules/imports.js @@ -221,6 +221,10 @@ module.exports = { // https://github.com/benmosher/eslint-plugin-import/blob/44a038c06487964394b1e15b64f3bd34e5d40cde/docs/rules/no-default-export.md 'import/no-default-export': 'off', + // Prohibit named exports. this is a terrible rule, do not use it. + // https://github.com/benmosher/eslint-plugin-import/blob/1ec80fa35fa1819e2d35a70e68fb6a149fb57c5e/docs/rules/no-named-export.md + 'import/no-named-export': 'off', + // Forbid a module from importing itself // https://github.com/benmosher/eslint-plugin-import/blob/44a038c06487964394b1e15b64f3bd34e5d40cde/docs/rules/no-self-import.md 'import/no-self-import': 'error', diff --git a/packages/eslint-config-airbnb/package.json b/packages/eslint-config-airbnb/package.json index b45487a1..d5710640 100644 --- a/packages/eslint-config-airbnb/package.json +++ b/packages/eslint-config-airbnb/package.json @@ -56,7 +56,7 @@ "dependencies": { "eslint-config-airbnb-base": "^13.1.0", "object.assign": "^4.1.0", - "object.entries": "^1.0.4" + "object.entries": "^1.1.0" }, "devDependencies": { "babel-preset-airbnb": "^2.5.3", @@ -64,9 +64,9 @@ "editorconfig-tools": "^0.1.1", "eslint": "^4.19.1 || ^5.3.0", "eslint-find-rules": "^3.3.1", - "eslint-plugin-import": "^2.14.0", - "eslint-plugin-jsx-a11y": "^6.1.1", - "eslint-plugin-react": "^7.11.0", + "eslint-plugin-import": "^2.15.0", + "eslint-plugin-jsx-a11y": "^6.2.0", + "eslint-plugin-react": "^7.12.4", "in-publish": "^2.0.0", "react": ">= 0.13.0", "safe-publish-latest": "^1.1.2", @@ -74,9 +74,9 @@ }, "peerDependencies": { "eslint": "^4.19.1 || ^5.3.0", - "eslint-plugin-import": "^2.14.0", - "eslint-plugin-jsx-a11y": "^6.1.1", - "eslint-plugin-react": "^7.11.0" + "eslint-plugin-import": "^2.15.0", + "eslint-plugin-jsx-a11y": "^6.2.0", + "eslint-plugin-react": "^7.12.4" }, "engines": { "node": ">= 4" diff --git a/packages/eslint-config-airbnb/rules/react.js b/packages/eslint-config-airbnb/rules/react.js index 527274da..eb3b6482 100644 --- a/packages/eslint-config-airbnb/rules/react.js +++ b/packages/eslint-config-airbnb/rules/react.js @@ -1,3 +1,8 @@ +const assign = require('object.assign'); +const baseStyleRules = require('eslint-config-airbnb-base/rules/style').rules; + +const dangleRules = baseStyleRules['no-underscore-dangle']; + module.exports = { plugins: [ 'react', @@ -12,6 +17,10 @@ module.exports = { // View link below for react rules documentation // https://github.com/yannickcr/eslint-plugin-react#list-of-supported-rules rules: { + 'no-underscore-dangle': [dangleRules[0], assign({}, dangleRules[1], { + allow: dangleRules[1].allow.concat(['__REDUX_DEVTOOLS_EXTENSION_COMPOSE__']), + })], + // Specify whether double or single quotes should be used in JSX attributes // https://eslint.org/docs/rules/jsx-quotes 'jsx-quotes': ['error', 'prefer-double'], diff --git a/react/README.md b/react/README.md index 542aa1fd..51e035db 100644 --- a/react/README.md +++ b/react/README.md @@ -28,7 +28,7 @@ This style guide is mostly based on the standards that are currently prevalent i - However, multiple [Stateless, or Pure, Components](https://facebook.github.io/react/docs/reusable-components.html#stateless-functions) are allowed per file. eslint: [`react/no-multi-comp`](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-multi-comp.md#ignorestateless). - Always use JSX syntax. - Do not use `React.createElement` unless you’re initializing the app from a file that is not JSX. - - [`react/forbid-prod-types`](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-prop-types.md) will allow `arrays` and `objects` only if it is explicitly noted what `array` and `object` contains, using `arrayOf`, `objectOf`, or `shape`. + - [`react/forbid-prop-types`](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-prop-types.md) will allow `arrays` and `objects` only if it is explicitly noted what `array` and `object` contains, using `arrayOf`, `objectOf`, or `shape`. ## Class vs `React.createClass` vs stateless