Remove outdated range fix (#13736)
This commit is contained in:
1 parent
e83bd73d88
commit
0d808c5ad8
8 files changed
+131
-25
No files matched your search
@@ -105,15 +105,6 @@ function postprocess(ast, options) {
|
||||
}
|
||||
break;
|
||||
|
||||
case "SequenceExpression": {
|
||||
// Babel (unlike other parsers) includes spaces and comments in the range. Let's unify this.
|
||||
const lastExpression = node.expressions.at(-1);
|
||||
node.range = [
|
||||
locStart(node),
|
||||
Math.min(locEnd(lastExpression), locEnd(node)),
|
||||
];
|
||||
break;
|
||||
}
|
||||
// For hack-style pipeline
|
||||
case "TopicReference":
|
||||
options.__isUsingHackPipeline = true;
|
||||
|
||||
@@ -37,6 +37,7 @@ const unstableTests = new Map(
|
||||
"typescript/prettier-ignore/mapped-types.ts",
|
||||
"js/comments/html-like/comment.js",
|
||||
"js/for/continue-and-break-comment-without-blocks.js",
|
||||
"js/sequence-expression/parenthesized.js",
|
||||
"typescript/satisfies-operators/comments-unstable.ts",
|
||||
].map((fixture) => {
|
||||
const [file, isUnstable = () => true] = Array.isArray(fixture)
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`export-default.js format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babel", "flow", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
export default (1,
|
||||
2);
|
||||
|
||||
=====================================output=====================================
|
||||
export default (1, 2);
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`ignore.js format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babel", "flow", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
+
|
||||
// prettier-ignore
|
||||
(
|
||||
(
|
||||
first
|
||||
)
|
||||
,
|
||||
(
|
||||
last
|
||||
)
|
||||
)
|
||||
;
|
||||
|
||||
=====================================output=====================================
|
||||
+(
|
||||
// prettier-ignore
|
||||
(
|
||||
first
|
||||
)
|
||||
,
|
||||
(
|
||||
last
|
||||
)
|
||||
);
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`parenthesized.js format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babel", "flow", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
console.log(
|
||||
/* 1 */
|
||||
(
|
||||
/* 2 */
|
||||
(
|
||||
/* 3 */
|
||||
first
|
||||
/* 4 */
|
||||
)
|
||||
/* 5 */
|
||||
,
|
||||
/* 6 */
|
||||
(
|
||||
/* 7 */
|
||||
last
|
||||
/* 8 */
|
||||
)
|
||||
/* 9 */
|
||||
)
|
||||
/* 10 */
|
||||
);
|
||||
|
||||
=====================================output=====================================
|
||||
console.log(
|
||||
/* 1 */
|
||||
/* 2 */
|
||||
(/* 3 */
|
||||
first,
|
||||
/* 4 */
|
||||
/* 5 */
|
||||
/* 6 */
|
||||
/* 7 */
|
||||
last),
|
||||
/* 8 */
|
||||
/* 9 */
|
||||
/* 10 */
|
||||
);
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
File renamed without changes.
@@ -0,0 +1,12 @@
|
||||
+
|
||||
// prettier-ignore
|
||||
(
|
||||
(
|
||||
first
|
||||
)
|
||||
,
|
||||
(
|
||||
last
|
||||
)
|
||||
)
|
||||
;
|
||||
File renamed without changes.
@@ -0,0 +1,21 @@
|
||||
console.log(
|
||||
/* 1 */
|
||||
(
|
||||
/* 2 */
|
||||
(
|
||||
/* 3 */
|
||||
first
|
||||
/* 4 */
|
||||
)
|
||||
/* 5 */
|
||||
,
|
||||
/* 6 */
|
||||
(
|
||||
/* 7 */
|
||||
last
|
||||
/* 8 */
|
||||
)
|
||||
/* 9 */
|
||||
)
|
||||
/* 10 */
|
||||
);
|
||||
@@ -1,16 +0,0 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`export-default.js format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["babel", "flow", "typescript"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
export default (1,
|
||||
2);
|
||||
|
||||
=====================================output=====================================
|
||||
export default (1, 2);
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
Reference in new issue
Block a user