"// prettier-ignore" position within comments doesn't matter (#1126)
* // prettier-ignore can be within any part of the comment block * Add test for // prettier-ignore being anywhere within comments
This commit is contained in:
1 parent
def91efd16
commit
61ad2f1d34
3 files changed
+16
-1
No files matched your search
+1
-1
@@ -65,7 +65,7 @@ function genericPrint(path, options, printPath) {
|
||||
if (
|
||||
node.comments &&
|
||||
node.comments.length > 0 &&
|
||||
node.comments[node.comments.length - 1].value.trim() === "prettier-ignore"
|
||||
node.comments.some(comment => comment.value.trim() === "prettier-ignore")
|
||||
) {
|
||||
return options.originalText.slice(util.locStart(node), util.locEnd(node));
|
||||
}
|
||||
|
||||
@@ -26,6 +26,11 @@ exports[`ignore.js 1`] = `
|
||||
\\"gross-formatting\\",
|
||||
};
|
||||
|
||||
function giveMeSome() {
|
||||
a( a ); // prettier-ignore
|
||||
// shouldn't I return something? :shrug:
|
||||
}
|
||||
|
||||
// prettier-ignore
|
||||
console.error(
|
||||
'In order to use ' + prompt + ', you need to configure a ' +
|
||||
@@ -85,6 +90,11 @@ function a() {
|
||||
\\"gross-formatting\\",
|
||||
};
|
||||
|
||||
function giveMeSome() {
|
||||
a( a ); // prettier-ignore
|
||||
// shouldn't I return something? :shrug:
|
||||
}
|
||||
|
||||
// prettier-ignore
|
||||
console.error(
|
||||
'In order to use ' + prompt + ', you need to configure a ' +
|
||||
|
||||
@@ -23,6 +23,11 @@ function a() {
|
||||
"gross-formatting",
|
||||
};
|
||||
|
||||
function giveMeSome() {
|
||||
a( a ); // prettier-ignore
|
||||
// shouldn't I return something? :shrug:
|
||||
}
|
||||
|
||||
// prettier-ignore
|
||||
console.error(
|
||||
'In order to use ' + prompt + ', you need to configure a ' +
|
||||
|
||||
Reference in new issue
Block a user