2017-10-19 23:01:08 +00:00
|
|
|
root: true
|
2019-01-21 14:05:36 +00:00
|
|
|
parser: '@typescript-eslint/parser'
|
2017-10-19 23:01:08 +00:00
|
|
|
plugins:
|
2019-01-23 14:30:55 +00:00
|
|
|
- '@typescript-eslint'
|
2017-10-19 23:01:08 +00:00
|
|
|
- babel
|
|
|
|
- react
|
2018-03-27 01:21:02 +00:00
|
|
|
- json
|
2020-07-02 11:35:18 +00:00
|
|
|
- jsdoc
|
2017-10-19 23:01:08 +00:00
|
|
|
|
2019-06-04 18:34:06 +00:00
|
|
|
settings:
|
|
|
|
react:
|
|
|
|
version: '16.3'
|
|
|
|
|
2017-10-19 23:01:08 +00:00
|
|
|
extends:
|
|
|
|
- prettier
|
|
|
|
- prettier/react
|
2020-07-02 15:29:04 +00:00
|
|
|
- plugin:@typescript-eslint/recommended
|
|
|
|
- prettier/@typescript-eslint
|
2017-10-19 23:01:08 +00:00
|
|
|
|
|
|
|
rules:
|
|
|
|
##########
|
|
|
|
# CUSTOM #
|
|
|
|
##########
|
|
|
|
insecure-random: error
|
|
|
|
|
|
|
|
###########
|
|
|
|
# PLUGINS #
|
|
|
|
###########
|
|
|
|
# TYPESCRIPT
|
2020-06-18 21:20:57 +00:00
|
|
|
'@typescript-eslint/naming-convention':
|
2017-10-19 23:01:08 +00:00
|
|
|
- error
|
2020-06-18 21:20:57 +00:00
|
|
|
- selector: interface
|
|
|
|
format:
|
|
|
|
- PascalCase
|
|
|
|
custom:
|
|
|
|
regex: '^I[A-Z]'
|
|
|
|
match: true
|
2020-07-02 11:25:13 +00:00
|
|
|
- selector: class
|
|
|
|
format:
|
|
|
|
- PascalCase
|
2020-07-02 15:00:45 +00:00
|
|
|
- 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
|
2020-06-18 21:20:57 +00:00
|
|
|
'@typescript-eslint/consistent-type-assertions':
|
|
|
|
- error
|
|
|
|
- assertionStyle: 'as'
|
|
|
|
'@typescript-eslint/no-unused-expressions': error
|
2019-01-23 14:30:55 +00:00
|
|
|
'@typescript-eslint/explicit-member-accessibility': error
|
|
|
|
'@typescript-eslint/no-unused-vars':
|
|
|
|
- error
|
|
|
|
- args: 'none'
|
|
|
|
'@typescript-eslint/no-use-before-define':
|
2017-10-19 23:01:08 +00:00
|
|
|
- error
|
|
|
|
- functions: false
|
|
|
|
variables: false
|
|
|
|
typedefs: false
|
2020-07-02 12:18:09 +00:00
|
|
|
'@typescript-eslint/member-ordering':
|
|
|
|
- error
|
|
|
|
- default:
|
|
|
|
- static-field
|
|
|
|
- static-method
|
|
|
|
- field
|
|
|
|
- abstract-method
|
|
|
|
- constructor
|
|
|
|
- method
|
2020-07-02 12:20:15 +00:00
|
|
|
'@typescript-eslint/no-extraneous-class': error
|
2020-07-02 16:01:53 +00:00
|
|
|
'@typescript-eslint/no-empty-interface': error
|
2020-07-02 16:02:47 +00:00
|
|
|
# Would love to be able to turn this on eventually
|
|
|
|
'@typescript-eslint/no-non-null-assertion': off
|
|
|
|
|
|
|
|
# This rule does a lot of good but right now it catches way
|
|
|
|
# too many cases, we're gonna want to pay down this debt
|
|
|
|
# incrementally if we want to enable it.
|
|
|
|
'@typescript-eslint/ban-types': off
|
|
|
|
|
|
|
|
# It'd be nice to be able to turn this on eventually
|
|
|
|
'@typescript-eslint/no-var-requires': off
|
|
|
|
|
|
|
|
# Don't particularly care about these
|
|
|
|
'@typescript-eslint/triple-slash-reference': off
|
|
|
|
'@typescript-eslint/explicit-module-boundary-types': off
|
|
|
|
'@typescript-eslint/no-explicit-any': off
|
|
|
|
'@typescript-eslint/no-inferrable-types': off
|
|
|
|
'@typescript-eslint/no-empty-function': off
|
2019-01-23 14:30:55 +00:00
|
|
|
|
2017-10-19 23:01:08 +00:00
|
|
|
# Babel
|
|
|
|
babel/no-invalid-this: error
|
|
|
|
|
|
|
|
# React
|
|
|
|
react/jsx-boolean-value:
|
|
|
|
- error
|
|
|
|
- always
|
|
|
|
react/jsx-key: error
|
|
|
|
react/jsx-no-bind: error
|
|
|
|
react/no-string-refs: error
|
2019-01-23 14:30:55 +00:00
|
|
|
react/jsx-uses-vars: error
|
|
|
|
react/jsx-uses-react: error
|
2020-07-02 13:15:37 +00:00
|
|
|
react/no-unused-state: error
|
2017-10-19 23:01:08 +00:00
|
|
|
|
2020-07-02 11:35:18 +00:00
|
|
|
# JSDoc
|
|
|
|
jsdoc/check-alignment: error
|
|
|
|
jsdoc/check-tag-names: error
|
|
|
|
jsdoc/check-types: error
|
|
|
|
jsdoc/implements-on-classes: error
|
|
|
|
jsdoc/newline-after-description: error
|
|
|
|
jsdoc/no-undefined-types: error
|
|
|
|
jsdoc/valid-types: error
|
|
|
|
|
2020-07-02 12:01:46 +00:00
|
|
|
# Would love to enable these at some point but
|
|
|
|
# they cause way to many issues now.
|
|
|
|
#jsdoc/check-param-names: error
|
|
|
|
#jsdoc/require-jsdoc:
|
|
|
|
# - error
|
|
|
|
# - publicOnly: true
|
|
|
|
|
2017-10-19 23:01:08 +00:00
|
|
|
###########
|
|
|
|
# BUILTIN #
|
|
|
|
###########
|
|
|
|
curly: error
|
|
|
|
no-new-wrappers: error
|
|
|
|
no-redeclare:
|
|
|
|
- error
|
|
|
|
- builtinGlobals: true
|
|
|
|
no-eval: error
|
|
|
|
no-sync: error
|
|
|
|
no-var: error
|
|
|
|
prefer-const: error
|
|
|
|
eqeqeq:
|
|
|
|
- error
|
|
|
|
- smart
|
2018-01-06 11:32:44 +00:00
|
|
|
strict:
|
|
|
|
- error
|
|
|
|
- global
|
2019-04-01 17:19:34 +00:00
|
|
|
no-buffer-constructor: error
|
2017-10-19 23:01:08 +00:00
|
|
|
|
|
|
|
###########
|
|
|
|
# SPECIAL #
|
|
|
|
###########
|
|
|
|
no-restricted-syntax:
|
|
|
|
- error
|
|
|
|
# no-default-export
|
|
|
|
- selector: ExportDefaultDeclaration
|
|
|
|
message: Use of default exports is forbidden
|
|
|
|
|
2018-01-06 11:32:44 +00:00
|
|
|
overrides:
|
|
|
|
- files: '*.d.ts'
|
|
|
|
rules:
|
|
|
|
strict:
|
|
|
|
- error
|
|
|
|
- never
|
2020-07-02 15:35:40 +00:00
|
|
|
- files: 'app/test/**/*'
|
|
|
|
rules:
|
|
|
|
'@typescript-eslint/no-non-null-assertion': off
|
|
|
|
- files: 'script/**/*'
|
|
|
|
rules:
|
|
|
|
'@typescript-eslint/no-non-null-assertion': off
|
2018-01-06 11:32:44 +00:00
|
|
|
|
2017-10-19 23:01:08 +00:00
|
|
|
parserOptions:
|
|
|
|
sourceType: module
|
|
|
|
ecmaFeatures:
|
|
|
|
jsx: true
|