If the value is a string with one of the casings below it requires that the filename without extension exactly matches the name defined in the file and both have the specified casing.
If the value is an object or an array of objects, the object define a rule that the names must follow.
For instance, you can require that the file name should be dash cased like my-thing.js, and the
corresponding component name should be pascal cased like MyThing.
When using an array of rules, at least one of the rules must apply, otherwise it fails the style check.
Available casings are:
dot:my.file.name.jsdash:my-file-name.jscamel:myFileName.jssnake:my_file_name.jspascal:MyFileName.jsconstant:MY_FILE_NAME.js
NOTE: Directives, and therefore components, are always required to be camel cased since Angular itself requires this.
{
"angularRequireNameCase": {
"component": "pascal",
"filename": "dash"
}
}With a file named assets/good-controller.js:
angular.module('app').controller('GoodController', function() {
})You might use both pascal and camel casings in a project depending on the kind of module, then do it like this:
{
"angularRequireNameCase": [{
"component": "camel",
"filename": "camel"
}, {
"component": "pascal",
"filename": "pascal"
}]
}With a file named assets/goodController.js:
angular.module('app').controller('goodController', function() {
}){
"angularRequireNameCase": "camel"
}With a file named assets/badController.js:
angular.module('app').controller('BadController', function() {
})