wishthis/node_modules/fomantic-ui/.eslint/no-extra-parens-rule.js
2023-08-17 11:47:40 +02:00

17 lines
490 B
JavaScript

const eslint = require('eslint');
const ruleComposer = require('eslint-rule-composer');
const rule = new eslint.Linter().getRules().get('no-extra-parens');
module.exports = ruleComposer.filterReports(
rule,
(problem) => {
if (problem.node.type === 'ConditionalExpression'
&& (problem.node.parent.type === 'ConditionalExpression' || problem.node.parent.type === 'SpreadElement')
) {
return false;
}
return problem;
}
);