This rule aims to prevent usage of plain object module definitions.
The following patterns are considered warnings:
define({
a: 'foo',
b: 'bar'
});
define('path/to/baz', {
a: 'foo',
b: 'bar'
});
The following patterns are not warnings:
// Definition Function
define(function () {
/* ... */
});
// Definition Function with Dependencies
define(['path/to/foo', 'path/to/bar'], function (foo, bar) {
/* ... */
});
// Named Module with Dependencies
define('path/to/baz', ['path/to/foo'], function (foo) {
/* ... */
});
// Simplified CommonJS Wrapper
define(function (require) {
var foo = require('path/to/foo'),
bar = require('path/to/bar');
/* ... */
});
If you want to use plain object modules, then it is safe to disable this rule.