@@ -12,31 +12,36 @@ function includesAccessDeclaration(comment) {
12
12
return comment . value . match ( / \r ? \n \s * ( @ p r i v a t e | @ p u b l i c | @ p r o t e c t e d ) \s / ) ;
13
13
}
14
14
15
- module . exports = function ( context ) {
16
- var sourceCode = context . getSourceCode ( ) ;
17
-
18
- sourceCode . getAllComments ( ) . forEach ( function ( comment ) {
19
- if ( comment . type !== 'Block' ) {
20
- return ;
21
- }
22
- if ( ! isDocComment ( comment ) ) {
23
- return ;
24
- }
25
- if ( isModuleOnlyComment ( comment ) ) {
26
- return ;
27
- }
28
- if ( includesAccessDeclaration ( comment ) ) {
29
- return ;
30
- }
31
-
32
- context . report ( {
33
- loc : comment . loc . start ,
34
- message :
35
- 'Access declaration missing, you must supply `@public`, `@private`, or `@protected` for doc comments.' ,
15
+ /** @type {import('eslint').Rule.RuleModule } */
16
+ module . exports = {
17
+ meta : {
18
+ type : 'suggestion' ,
19
+ schema : [ ] ,
20
+ } ,
21
+ create : function ( context ) {
22
+ var sourceCode = context . getSourceCode ( ) ;
23
+
24
+ sourceCode . getAllComments ( ) . forEach ( function ( comment ) {
25
+ if ( comment . type !== 'Block' ) {
26
+ return ;
27
+ }
28
+ if ( ! isDocComment ( comment ) ) {
29
+ return ;
30
+ }
31
+ if ( isModuleOnlyComment ( comment ) ) {
32
+ return ;
33
+ }
34
+ if ( includesAccessDeclaration ( comment ) ) {
35
+ return ;
36
+ }
37
+
38
+ context . report ( {
39
+ loc : comment . loc . start ,
40
+ message :
41
+ 'Access declaration missing, you must supply `@public`, `@private`, or `@protected` for doc comments.' ,
42
+ } ) ;
36
43
} ) ;
37
- } ) ;
38
44
39
- return { } ;
45
+ return { } ;
46
+ } ,
40
47
} ;
41
-
42
- module . exports . schema = [ ] ; // no options
0 commit comments