-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
374efac
commit 2258e2b
Showing
18 changed files
with
85 additions
and
3,854 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 14 additions & 20 deletions
34
eslint/babel-eslint-plugin/src/rules/object-curly-spacing.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,20 @@ | ||
import ruleComposer from "eslint-rule-composer"; | ||
import eslint from "eslint"; | ||
|
||
const objectCurlySpacingRule = new eslint.Linter() | ||
.getRules() | ||
.get("object-curly-spacing"); | ||
const rule = new eslint.Linter().getRules().get("object-curly-spacing"); | ||
|
||
export default ruleComposer.filterReports( | ||
objectCurlySpacingRule, | ||
(problem, metadata) => { | ||
const node = problem.node; | ||
export default ruleComposer.filterReports(rule, problem => { | ||
const node = problem.node; | ||
|
||
// Allow `exportNamespaceFrom` and `exportDefaultFrom` syntax: | ||
// export * as x from '...'; | ||
// export x from '...'; | ||
if ( | ||
node.type === "ExportNamedDeclaration" && | ||
node.specifiers.length > 0 && | ||
metadata.sourceCode.getTokenBefore(node.specifiers[0]).value === "export" | ||
) { | ||
return false; | ||
} | ||
// Allow exportDefaultFrom syntax: | ||
// export x from '...'; | ||
if ( | ||
node.type === "ExportNamedDeclaration" && | ||
node.specifiers.length === 1 && | ||
node.specifiers[0].type === "ExportDefaultSpecifier" | ||
) { | ||
return false; | ||
} | ||
|
||
return true; | ||
}, | ||
); | ||
return true; | ||
}); |
Oops, something went wrong.