Replace indexOf with includes (#6967)
* Replace `indexOf` with `includes` * Add `unicorn/prefer-includes`
This commit is contained in:
1 parent
93c63fde18
commit
57f0dd56dd
27 files changed
+242
-77
No files matched your search
@@ -118,7 +118,7 @@ function genericPrint(path, options, print) {
|
||||
const rawText = node.raws.text || node.text;
|
||||
// Workaround a bug where the location is off.
|
||||
// https://github.com/postcss/postcss-scss/issues/63
|
||||
if (text.indexOf(rawText) === -1) {
|
||||
if (!text.includes(rawText)) {
|
||||
if (node.raws.inline) {
|
||||
return concat(["// ", rawText]);
|
||||
}
|
||||
@@ -512,7 +512,7 @@ function genericPrint(path, options, print) {
|
||||
// Ignore escape `\`
|
||||
if (
|
||||
iNode.value &&
|
||||
iNode.value.indexOf("\\") !== -1 &&
|
||||
iNode.value.includes("\\") &&
|
||||
iNextNode &&
|
||||
iNextNode.type !== "value-comment"
|
||||
) {
|
||||
|
||||
Reference in new issue
Block a user