Prefer having a prefix for all module namesJS-0540
It is recommended to use consistent names for all modules along with a common prefix and name the filenames for all modules. It provides consistency for multiple module apps and for expanding to large applications.
When there are various modules, the main module file is named app.module.js
while other dependent modules are named after what they represent. For example, an admin
module is named admin.module.js
. So the respective registered module names would be app
and admin
. Provides an easy way to use task automation to load all module definitions first, then all other angular files (for bundling).
Note: This issue is raised only when the project has an existing ESLint configuration file. Avoid using ng
as prefixed as it is a reserved keyword.
Bad Practice
// error: The angular module should follow this pattern: /^xyz/
angular.module('otherModule', []);
Recommended
angular.module('prefixModule', []);