You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -136,12 +136,16 @@ These rules prevent you from using deprecated angular features.
136
136
These rules help you to specify several naming conventions.
137
137
138
138
* [component-name](docs/component-name.md) - require and specify a prefix for all component names
139
+
* [constant-name](docs/constant-name.md) - require and specify a prefix for all constant names ([y125](https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md#style-y125))
139
140
* [controller-name](docs/controller-name.md) - require and specify a prefix for all controller names ([y123](https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md#style-y123), [y124](https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md#style-y124))
140
141
* [directive-name](docs/directive-name.md) - require and specify a prefix for all directive names ([y073](https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md#style-y073), [y126](https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md#style-y126))
142
+
* [factory-name](docs/factory-name.md) - require and specify a prefix for all factory names ([y125](https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md#style-y125))
141
143
* [file-name](docs/file-name.md) - require and specify a consistent component name pattern ([y120](https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md#style-y120), [y121](https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md#style-y121))
142
144
* [filter-name](docs/filter-name.md) - require and specify a prefix for all filter names
143
145
* [module-name](docs/module-name.md) - require and specify a prefix for all module names ([y127](https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md#style-y127))
146
+
* [provider-name](docs/provider-name.md) - require and specify a prefix for all provider names ([y125](https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md#style-y125))
144
147
* [service-name](docs/service-name.md) - require and specify a prefix for all service names ([y125](https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md#style-y125))
148
+
* [value-name](docs/value-name.md) - require and specify a prefix for all value names ([y125](https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md#style-y125))
<!-- WARNING: Generated documentation. Edit docs and examples in the rule and examples file ('rules/constant-name.js', 'examples/constant-name.js'). -->
2
+
3
+
# constant-name - require and specify a prefix for all constant names
4
+
5
+
All your constants should have a name starting with the parameter you can define in your config object.
6
+
The second parameter can be a Regexp wrapped in quotes.
7
+
You can not prefix your constants by "$" (reserved keyword for AngularJS services) ("constant-name": [2, "ng"])
8
+
*
9
+
10
+
**Styleguide Reference**
11
+
12
+
*[y125 by johnpapa - Naming - Factory and Service Names](https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md#style-y125)
13
+
14
+
## Examples
15
+
16
+
The following patterns are **not** considered problems when configured `"prefix"`:
17
+
18
+
/*eslint angular/constant-name: [2,"prefix"]*/
19
+
20
+
// valid
21
+
angular.module('myModule').constant('prefixConstant', function () {
22
+
// ...
23
+
});
24
+
25
+
The following patterns are considered problems when configured `"/^xyz/"`:
26
+
27
+
/*eslint angular/constant-name: [2,"/^xyz/"]*/
28
+
29
+
// invalid
30
+
angular.module('myModule').constant('otherConstant', function () {
31
+
// ...
32
+
}); // error: The otherConstant constant should follow this pattern: /^xyz/
33
+
34
+
The following patterns are **not** considered problems when configured `"/^xyz/"`:
35
+
36
+
/*eslint angular/constant-name: [2,"/^xyz/"]*/
37
+
38
+
// valid
39
+
angular.module('myModule').constant('xyzConstant', function () {
40
+
// ...
41
+
});
42
+
43
+
The following patterns are considered problems when configured `"xyz"`:
44
+
45
+
/*eslint angular/constant-name: [2,"xyz"]*/
46
+
47
+
// invalid
48
+
angular.module('myModule').constant('myConstant', function () {
49
+
// ...
50
+
}); // error: The myConstant constant should be prefixed by xyz
51
+
52
+
## Version
53
+
54
+
This rule was introduced in eslint-plugin-angular 0.1.0
<!-- WARNING: Generated documentation. Edit docs and examples in the rule and examples file ('rules/provider-name.js', 'examples/provider-name.js'). -->
2
+
3
+
# provider-name - require and specify a prefix for all provider names
4
+
5
+
All your providers should have a name starting with the parameter you can define in your config object.
6
+
The second parameter can be a Regexp wrapped in quotes.
7
+
You can not prefix your providers by "$" (reserved keyword for AngularJS services) ("provider-name": [2, "ng"])
8
+
*
9
+
10
+
**Styleguide Reference**
11
+
12
+
*[y125 by johnpapa - Naming - Factory and Service Names](https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md#style-y125)
13
+
14
+
## Examples
15
+
16
+
The following patterns are **not** considered problems when configured `"prefix"`:
17
+
18
+
/*eslint angular/provider-name: [2,"prefix"]*/
19
+
20
+
// valid
21
+
angular.module('myModule').provider('prefixProvider', function () {
22
+
// ...
23
+
});
24
+
25
+
The following patterns are considered problems when configured `"/^xyz/"`:
26
+
27
+
/*eslint angular/provider-name: [2,"/^xyz/"]*/
28
+
29
+
// invalid
30
+
angular.module('myModule').provider('otherProvider', function () {
31
+
// ...
32
+
}); // error: The otherProvider provider should follow this pattern: /^xyz/
33
+
34
+
The following patterns are **not** considered problems when configured `"/^xyz/"`:
35
+
36
+
/*eslint angular/provider-name: [2,"/^xyz/"]*/
37
+
38
+
// valid
39
+
angular.module('myModule').provider('xyzProvider', function () {
40
+
// ...
41
+
});
42
+
43
+
The following patterns are considered problems when configured `"xyz"`:
44
+
45
+
/*eslint angular/provider-name: [2,"xyz"]*/
46
+
47
+
// invalid
48
+
angular.module('myModule').provider('myProvider', function () {
49
+
// ...
50
+
}); // error: The myProvider provider should be prefixed by xyz
51
+
52
+
## Version
53
+
54
+
This rule was introduced in eslint-plugin-angular 0.1.0
0 commit comments