-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Copy link
Labels
good first issueGood fist issue!Good fist issue!help wantedWe're a small group who can't get to every issue promptly. We’d appreciate help fixing this issue!We're a small group who can't get to every issue promptly. We’d appreciate help fixing this issue!lang:typescriptIssues affecting TypeScript-specific constructs (not general JS issues)Issues affecting TypeScript-specific constructs (not general JS issues)
Description
Prettier 3.7.3
Playground link
--parser babel-ts # or --parser typescriptInput:
new ((
require('./webpack/plugins/next-trace-entrypoints-plugin')
)
.TraceEntryPointsPlugin as P)(
{
rootDir: dir,
}
);
((
require('./webpack/plugins/next-trace-entrypoints-plugin')
)
.TraceEntryPointsPlugin as P)(
{
rootDir: dir,
}
);Output:
new (require("./webpack/plugins/next-trace-entrypoints-plugin")
.TraceEntryPointsPlugin as P)({
rootDir: dir,
});
(
require("./webpack/plugins/next-trace-entrypoints-plugin")
.TraceEntryPointsPlugin as P
)({
rootDir: dir,
});Formatting of CallExpression and NewExpression is inconsistent.
prettier/src/language-js/print/cast-expression.js
Lines 28 to 31 in 10094c3
| if ( | |
| (key === "callee" && isCallExpression(parent)) || | |
| (key === "object" && isMemberExpression(parent)) | |
| ) { |
We think the CallExpression output is actually better than NewExpression, which is better for readability.
How do you think?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood fist issue!Good fist issue!help wantedWe're a small group who can't get to every issue promptly. We’d appreciate help fixing this issue!We're a small group who can't get to every issue promptly. We’d appreciate help fixing this issue!lang:typescriptIssues affecting TypeScript-specific constructs (not general JS issues)Issues affecting TypeScript-specific constructs (not general JS issues)