mirror of
https://github.com/desktop/desktop
synced 2024-10-05 23:59:33 +00:00
Replicate the variable-name ban-keywords rule
This commit is contained in:
parent
5374f9330a
commit
ef4f8a2350
|
@ -36,6 +36,23 @@ rules:
|
||||||
- selector: class
|
- selector: class
|
||||||
format:
|
format:
|
||||||
- PascalCase
|
- PascalCase
|
||||||
|
- selector: variableLike
|
||||||
|
format: null
|
||||||
|
custom:
|
||||||
|
# Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar we
|
||||||
|
# should probably be using the following expression here (newlines added for readability)
|
||||||
|
#
|
||||||
|
# ^(break|case|catch|class|const|continue|debugger|default|delete|do|else|export|
|
||||||
|
# extends|finally|for|function|if|import|in|instanceof|new|return|super|switch|this|
|
||||||
|
# throw|try|typeof|var|void|while|with|yield|enum|implements|interface|let|package|
|
||||||
|
# private|protected|public|static|await|abstract|boolean|byte|char|double|final|float|
|
||||||
|
# goto|int|long|native|short|synchronized|throws|transient|volatile|null|true|false)$
|
||||||
|
#
|
||||||
|
# But that'll cause a bunch of errors, for now we'll stick with replicating what the
|
||||||
|
# variable-name ban-keywords rule did for us in tslint
|
||||||
|
# see https://palantir.github.io/tslint/rules/variable-name/
|
||||||
|
regex: '^(any|Number|number|String|string|Boolean|boolean|Undefined|undefined)$'
|
||||||
|
match: false
|
||||||
'@typescript-eslint/consistent-type-assertions':
|
'@typescript-eslint/consistent-type-assertions':
|
||||||
- error
|
- error
|
||||||
- assertionStyle: 'as'
|
- assertionStyle: 'as'
|
||||||
|
|
Loading…
Reference in a new issue