-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Labels
lang:javascriptIssues affecting JSIssues affecting JSlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.status:has prIssues with an accompanying pull request. These issues will probably be fixed soon!Issues with an accompanying pull request. These issues will probably be fixed soon!
Description
Prettier 1.10.2
Playground link
Input:
/*
* It looks like "require" and "define" calls are formatted differently,
* all else being equal. (fwiw, I think require's formatting here looks
* way better)
*/
require(
[
'jquery',
'common/global.context',
'common/log.event',
'some_project/square',
'some_project/rectangle',
'some_project/triangle',
'some_project/circle',
'some_project/star',
],
function($, Context, EventLogger, Square, Rectangle, Triangle, Circle, Star) {
console.log('some code')
}
);
define(
[
'jquery',
'common/global.context',
'common/log.event',
'some_project/square',
'some_project/rectangle',
'some_project/triangle',
'some_project/circle',
'some_project/star',
],
function($, Context, EventLogger, Square, Rectangle, Triangle, Circle, Star) {
console.log('some code')
}
);
/*
* This only seems to happen when the array of imports is sufficiently long
*/
require(["ohkay", "another_imported_thing", "and also this one here"], function(ok) {
console.log(ok);
})
define(["ohkay", "another_imported_thing", "and also this one here"], function(ok) {
console.log(ok);
})Output:
/*
* It looks like "require" and "define" calls are formatted differently,
* all else being equal. (fwiw, I think require's formatting here looks
* way better)
*/
require([
"jquery",
"common/global.context",
"common/log.event",
"some_project/square",
"some_project/rectangle",
"some_project/triangle",
"some_project/circle",
"some_project/star"
], function(
$,
Context,
EventLogger,
Square,
Rectangle,
Triangle,
Circle,
Star
) {
console.log("some code");
});
define(
[
"jquery",
"common/global.context",
"common/log.event",
"some_project/square",
"some_project/rectangle",
"some_project/triangle",
"some_project/circle",
"some_project/star"
],
function($, Context, EventLogger, Square, Rectangle, Triangle, Circle, Star) {
console.log("some code");
}
);
/*
* This only seems to happen when the array of imports is sufficiently long
*/
require(["ohkay", "another_imported_thing", "and also this one here"], function(
ok
) {
console.log(ok);
});
define(["ohkay", "another_imported_thing", "and also this one here"], function(
ok
) {
console.log(ok);
});Expected behavior:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
lang:javascriptIssues affecting JSIssues affecting JSlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.status:has prIssues with an accompanying pull request. These issues will probably be fixed soon!Issues with an accompanying pull request. These issues will probably be fixed soon!