1 | const eslint = require('eslint');
|
2 | const ruleComposer = require('eslint-rule-composer');
|
3 |
|
4 | const rule = new eslint.Linter().getRules().get('no-extra-parens');
|
5 |
|
6 | module.exports = ruleComposer.filterReports(
|
7 | rule,
|
8 | (problem) => {
|
9 | if (problem.node.type === 'ConditionalExpression'
|
10 | && (problem.node.parent.type === 'ConditionalExpression' || problem.node.parent.type === 'SpreadElement')
|
11 | ) {
|
12 | return false;
|
13 | }
|
14 |
|
15 | return problem;
|
16 | }
|
17 | );
|