Skip to content

Commit

Permalink
Merge branch 'main' into add/no-cycle-ignore-type-only-imports
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnDaly committed Apr 7, 2024
2 parents e5e9864 + 65f38dc commit 6f9e2d2
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions tasks/rulegen/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,10 @@ impl<'a> Visit<'a> for TestCase<'a> {
PropertyKey::Identifier(ident) if ident.name == "code" => {
self.code = match &prop.value {
Expression::StringLiteral(s) => Some(s.value.to_string()),
// eslint-plugin-jest use dedent to strips indentation from multi-line strings
// eslint-plugin-unicon use outdent to removes leading indentation from ES6 template strings
Expression::TaggedTemplateExpression(tag_expr) => {
let Expression::Identifier(ident) = &tag_expr.tag else {
continue;
};
if ident.name != "dedent" && ident.name != "outdent" {
continue;
}
// There are `dedent`(in eslint-plugin-jest), `outdent`(in eslint-plugin-unicorn) and `noFormat`(in typescript-eslint)
// are known to be used to format test cases for their own purposes.
// We read the quasi of tagged template directly also for the future usage.
tag_expr.quasi.quasi().map(ToString::to_string)
}
Expression::TemplateLiteral(tag_expr) => {
Expand Down

0 comments on commit 6f9e2d2

Please sign in to comment.