| 1 | const ruleComposer = require("eslint-rule-composer"); |
| 2 | const eslint = require("eslint"); |
| 3 | |
| 4 | const rule = new eslint.Linter().getRules().get("object-curly-spacing"); |
| 5 | |
| 6 | module.exports = ruleComposer.filterReports(rule, problem => { |
| 7 | const node = problem.node; |
| 8 | |
| 9 | // Allow exportDefaultFrom syntax: |
| 10 | // export x from '...'; |
| 11 | if ( |
| 12 | node.type === "ExportNamedDeclaration" && |
| 13 | node.specifiers.length === 1 && |
| 14 | node.specifiers[0].type === "ExportDefaultSpecifier" |
| 15 | ) { |
| 16 | return false; |
| 17 | } |
| 18 | |
| 19 | return true; |
| 20 | }); |