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 885
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added require-const-for-all-caps option to variable-name (#2936)
- Loading branch information
Showing
4 changed files
with
88 additions
and
18 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
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,38 @@ | ||
var snake_case_var; | ||
~~~~~~~~~~~~~~ [regular-case] | ||
|
||
var camelCaseVar; | ||
|
||
var PascalCaseVar; | ||
~~~~~~~~~~~~~ [regular-case] | ||
|
||
var UPPER_CASE_VAR; | ||
~~~~~~~~~~~~~~ [const] | ||
|
||
let snake_case_let; | ||
~~~~~~~~~~~~~~ [regular-case] | ||
|
||
let camelCaseLet; | ||
|
||
let PascalCaseLet; | ||
~~~~~~~~~~~~~ [regular-case] | ||
|
||
let UPPER_CASE_LET; | ||
~~~~~~~~~~~~~~ [const] | ||
|
||
const snake_case_const; | ||
~~~~~~~~~~~~~~~~ [regular-case] | ||
|
||
const camelCaseConst; | ||
|
||
const PascalCaseConst; | ||
~~~~~~~~~~~~~~~ [regular-case] | ||
|
||
const UPPER_CASE_CONST; | ||
|
||
class Test { | ||
public static readonly MY_FIELD = 10; | ||
} | ||
|
||
[const]: Only `const` variables may be UPPER_CASE. | ||
[regular-case]: variable name must be in lowerCamelCase or UPPER_CASE |
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,5 @@ | ||
{ | ||
"rules": { | ||
"variable-name": [true, "require-const-for-all-caps"] | ||
} | ||
} |