Skip to content

Commit b14d0ca

Browse files
committed
add file name support for angular 1.5 components
1 parent a90c498 commit b14d0ca

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

examples/file-name.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ app.factory('myUtils', function() {});
1111
// example - valid: true, filename: "src/app/awesomeModule/beautifulDirective.js"
1212
app.directive('beautifulDirective', function() {});
1313

14+
// example - valid: true, filename: "src/app/awesomeModule/beautifulComponent.js"
15+
app.component('beautifulComponent', {});
16+
1417
// example - valid: false, filename: "src/app/filters.js", errorMessage: "Filename must be \"usefulFilter.js\""
1518
app.filter('usefulFilter', function() {});
1619

rules/file-name.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ module.exports = (function() {
3535
factory: 'service',
3636
provider: 'service',
3737
value: 'service',
38-
constant: 'constant'
38+
constant: 'constant',
39+
component: 'component'
3940
};
4041

4142
var filenameUtil = {

test/file-name.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ eslintTester.run('file-name', rule, {
3838
// basic directive
3939
filename: 'beautifulDirective.js',
4040
code: 'app.directive("beautifulDirective", function() {});'
41+
}, {
42+
// basic component
43+
filename: 'beautifulComponent.js',
44+
code: 'app.component("beautifulComponent", {});'
4145
}, {
4246
// typeSeparator dot with filter
4347
filename: 'src/app/myFilter.filter.js',

0 commit comments

Comments
 (0)