Files
test-repo/tests/require-amd/require.js
T
Salem 8c792121f2 Treat define calls like require (#3830)
* Treat define calls like require

See issue #3829. This commit keeps define calls as a unit when possible,
to prevent an extra indent in the body of an AMD-style define.

Rather than adding the "define" check in the same case as the existing
"require" check, I added a separate condition to explicitly call out the
fact that this checks for both AMD and CommonJS modules.

`yarn test -u` yields no changes, and `yarn lint` passes successfully.

* Added tests for define and require amd formatting

This tests the solution for issue #3829.

* Add babylon interpreter to require-amd test

* Merge require and define checks
2018-01-29 16:44:32 -05:00

34 lines
770 B
JavaScript

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')
}
);