-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: improve interop between prettier and eslint #1212
Conversation
// eslint-disable-next-line @stylistic/quotes | ||
.replace('"', '"') | ||
); | ||
return val.replace(/\n/g, "").replace(/\r/g, "").replace(/"/g, '\"'); |
Check warning
Code scanning / CodeQL
Replacement of a substring with itself
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 4 days ago
To fix the problem, we need to change the replacement string from '\"'
to '\\"'
. This will ensure that double quotes are properly escaped by adding a backslash before them. The change should be made on line 464 of the file packages/newman-reporter-allure/src/index.ts
.
-
Copy modified line R464
@@ -463,3 +463,3 @@ | ||
#escape(val: string) { | ||
return val.replace(/\n/g, "").replace(/\r/g, "").replace(/"/g, '\"'); | ||
return val.replace(/\n/g, "").replace(/\r/g, "").replace(/"/g, '\\"'); | ||
} |
9970f50
to
d49a524
Compare
Context
quoteProps
to"consistent"
to match ESLint'squote-props
rule.avoidEscape
totrue
for ESLint's@stylistic/quotes
rule to match Prettier's formatting behavior when dealing with strings with double quote characters inside (e.g.,'"foo"="bar"'
).ref allure-framework/allure3#29
Checklist