1
1
/**
2
- * @fileoverview Enforces explicit visibility declarations for class members
2
+ * @fileoverview Enforces explicit visibility modifier for class members
3
3
* @author Danny Fritz
4
4
*/
5
5
"use strict" ;
11
11
module . exports = {
12
12
meta : {
13
13
docs : {
14
- description : "Enforces explicity visibility declarations for class members" ,
14
+ description : "Enforces explicity visibility modifiers for class members" ,
15
15
category : "TypeScript"
16
16
} ,
17
17
schema : [ ]
@@ -27,7 +27,7 @@ module.exports = {
27
27
//----------------------------------------------------------------------
28
28
29
29
/**
30
- * Checks if a string starts with a visibility declaration .
30
+ * Checks if a string starts with a visibility modifier .
31
31
* @param {string } nodeText The text representing a node.
32
32
* @returns {boolean } true if it has a visibility decorator
33
33
* @private
@@ -40,31 +40,31 @@ module.exports = {
40
40
}
41
41
42
42
/**
43
- * Checks if a method declaration has visibility declarations .
43
+ * Checks if a method declaration has visibility modifier .
44
44
* @param {ASTNode } methodDefinition The node representing a MethodDefinition.
45
45
* @returns {void }
46
46
* @private
47
47
*/
48
- function checkMethodVisibilityDeclaration ( methodDefinition ) {
48
+ function checkMethodVisibilityModifier ( methodDefinition ) {
49
49
if ( ! hasVisibilityDeclaration ( sourceCode . getText ( methodDefinition ) ) ) {
50
50
context . report ( {
51
51
node : methodDefinition ,
52
- message : "Missing visibility declaration on method definition " + methodDefinition . key . name + "."
52
+ message : "Missing visibility modifier on method definition " + methodDefinition . key . name + "."
53
53
} ) ;
54
54
}
55
55
}
56
56
57
57
/**
58
- * Checks if property declaration has visibility declarations .
58
+ * Checks if property has visibility modifiers .
59
59
* @param {ASTNode } classProperty The node representing a ClassProperty.
60
60
* @returns {void }
61
61
* @private
62
62
*/
63
- function checkPropertyVisibilityDeclaration ( classProperty ) {
63
+ function checkPropertyVisibilityModifier ( classProperty ) {
64
64
if ( ! hasVisibilityDeclaration ( sourceCode . getText ( classProperty ) ) ) {
65
65
context . report ( {
66
66
node : classProperty ,
67
- message : "Missing visibility declaration on class property " + classProperty . key . name + "."
67
+ message : "Missing visibility modifier on class property " + classProperty . key . name + "."
68
68
} ) ;
69
69
}
70
70
}
@@ -73,8 +73,8 @@ module.exports = {
73
73
// Public
74
74
//----------------------------------------------------------------------
75
75
return {
76
- ClassProperty : checkPropertyVisibilityDeclaration ,
77
- MethodDefinition : checkMethodVisibilityDeclaration
76
+ ClassProperty : checkPropertyVisibilityModifier ,
77
+ MethodDefinition : checkMethodVisibilityModifier
78
78
} ;
79
79
}
80
80
} ;
0 commit comments