This repository has been archived by the owner on Mar 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 886
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug where you couldn't enable the "completed-docs" rule for just …
…private/protected methods (#2749) + Fix the bug + Fix the broken "privacies" test + Add tests for the individual "privacies"
- Loading branch information
1 parent
c768aa2
commit 294242e
Showing
8 changed files
with
129 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
class Class { | ||
badDefaultMethod() { } | ||
|
||
/** | ||
* ... | ||
*/ | ||
goodDefaultMethod() { } | ||
|
||
public badPublicMethod() { } | ||
|
||
/** | ||
* ... | ||
*/ | ||
public goodPublicMethod() { } | ||
|
||
protected badProtectedMethod() { } | ||
|
||
/** | ||
* ... | ||
*/ | ||
protected goodProtectedMethod() { } | ||
|
||
private badPrivateMethod() { } | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [Documentation must exist for private methods.] | ||
|
||
/** | ||
* ... | ||
*/ | ||
private goodPrivateMethod() { } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"linterOptions": { | ||
"typeCheck": true | ||
}, | ||
"rules": { | ||
"completed-docs": [true, { | ||
"methods": { | ||
"privacies": ["private"] | ||
} | ||
}] | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
test/rules/completed-docs/privacies-protected/test.ts.lint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
class Class { | ||
badDefaultMethod() { } | ||
|
||
/** | ||
* ... | ||
*/ | ||
goodDefaultMethod() { } | ||
|
||
public badPublicMethod() { } | ||
|
||
/** | ||
* ... | ||
*/ | ||
public goodPublicMethod() { } | ||
|
||
protected badProtectedMethod() { } | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [Documentation must exist for protected methods.] | ||
|
||
/** | ||
* ... | ||
*/ | ||
protected goodProtectedMethod() { } | ||
|
||
private badPrivateMethod() { } | ||
|
||
/** | ||
* ... | ||
*/ | ||
private goodPrivateMethod() { } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"linterOptions": { | ||
"typeCheck": true | ||
}, | ||
"rules": { | ||
"completed-docs": [true, { | ||
"methods": { | ||
"privacies": ["protected"] | ||
} | ||
}] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
class Class { | ||
badDefaultMethod() { } | ||
~~~~~~~~~~~~~~~~~~~~~~ [Documentation must exist for methods.] | ||
|
||
/** | ||
* ... | ||
*/ | ||
goodDefaultMethod() { } | ||
|
||
public badPublicMethod() { } | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [Documentation must exist for public methods.] | ||
|
||
/** | ||
* ... | ||
*/ | ||
public goodPublicMethod() { } | ||
|
||
protected badProtectedMethod() { } | ||
|
||
/** | ||
* ... | ||
*/ | ||
protected goodProtectedMethod() { } | ||
|
||
private badPrivateMethod() { } | ||
|
||
/** | ||
* ... | ||
*/ | ||
private goodPrivateMethod() { } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"linterOptions": { | ||
"typeCheck": true | ||
}, | ||
"rules": { | ||
"completed-docs": [true, { | ||
"methods": { | ||
"privacies": ["public"] | ||
} | ||
}] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters