1
0
mirror of https://github.com/desktop/desktop synced 2024-07-07 19:29:36 +00:00

Replicate the variable-name ban-keywords rule

This commit is contained in:
Markus Olsson 2020-07-02 17:00:45 +02:00
parent 5374f9330a
commit ef4f8a2350

View File

@ -36,6 +36,23 @@ rules:
- selector: class
format:
- 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':
- error
- assertionStyle: 'as'