[eslint config] [patch] extend no-underscore-dangle to allow for redux dev tools in the main config instead

This commit is contained in:
Jordan Harband
2019-01-26 10:12:49 -08:00
parent b6c56cb070
commit 25f11fb31e
2 changed files with 10 additions and 1 deletions

View File

@@ -369,7 +369,7 @@ module.exports = {
// disallow dangling underscores in identifiers
// https://eslint.org/docs/rules/no-underscore-dangle
'no-underscore-dangle': ['error', {
allow: ['__REDUX_DEVTOOLS_EXTENSION_COMPOSE__'],
allow: [],
allowAfterThis: false,
allowAfterSuper: false,
enforceInMethodNames: true,

View File

@@ -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'],