Skip to content

Commit 25f11fb

Browse files
committed
[eslint config] [patch] extend no-underscore-dangle to allow for redux dev tools in the main config instead
1 parent b6c56cb commit 25f11fb

File tree

2 files changed

+10
-1
lines changed
  • packages

2 files changed

+10
-1
lines changed

packages/eslint-config-airbnb-base/rules/style.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ module.exports = {
369369
// disallow dangling underscores in identifiers
370370
// https://eslint.org/docs/rules/no-underscore-dangle
371371
'no-underscore-dangle': ['error', {
372-
allow: ['__REDUX_DEVTOOLS_EXTENSION_COMPOSE__'],
372+
allow: [],
373373
allowAfterThis: false,
374374
allowAfterSuper: false,
375375
enforceInMethodNames: true,

packages/eslint-config-airbnb/rules/react.js

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
const assign = require('object.assign');
2+
const baseStyleRules = require('eslint-config-airbnb-base/rules/style').rules;
3+
4+
const dangleRules = baseStyleRules['no-underscore-dangle'];
5+
16
module.exports = {
27
plugins: [
38
'react',
@@ -12,6 +17,10 @@ module.exports = {
1217
// View link below for react rules documentation
1318
// https://github.com/yannickcr/eslint-plugin-react#list-of-supported-rules
1419
rules: {
20+
'no-underscore-dangle': [dangleRules[0], assign({}, dangleRules[1], {
21+
allow: dangleRules[1].allow.concat(['__REDUX_DEVTOOLS_EXTENSION_COMPOSE__']),
22+
})],
23+
1524
// Specify whether double or single quotes should be used in JSX attributes
1625
// https://eslint.org/docs/rules/jsx-quotes
1726
'jsx-quotes': ['error', 'prefer-double'],

0 commit comments

Comments
 (0)