This repository has been archived by the owner on Mar 24, 2024. It is now read-only.
/
.eslintrc.yaml
84 lines (76 loc) · 2.92 KB
/
.eslintrc.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
env:
browser: true
es6: true
node: true
plugins:
- react
- react-hooks
- "@typescript-eslint"
- header
extends:
- eslint:recommended
- plugin:react/recommended
- plugin:@typescript-eslint/eslint-recommended
- plugin:@typescript-eslint/recommended
- plugin:import/errors
- plugin:import/warnings
- plugin:import/typescript
- plugin:prettier/recommended
parser: "@typescript-eslint/parser"
parserOptions:
ecmaFeatures:
jsx: true
ecmaVersion: 12
sourceType: module
project: tsconfig.json
settings:
react:
version: detect
import/internal-regex: "^@foxglove-studio/"
rules:
no-console: off # configured in no-restricted-syntax
"@typescript-eslint/ban-ts-comment": off # TODO: remove once we fix all TS issues
# It's sometimes useful to explicitly name to guard against future changes
"@typescript-eslint/no-inferrable-types": off
"@typescript-eslint/no-empty-function": off
"@typescript-eslint/prefer-nullish-coalescing": warn
react/react-in-jsx-scope: off
react/prop-types: warn
react-hooks/rules-of-hooks: error
react-hooks/exhaustive-deps: error
header/header:
- error
- line
# We do not provide a default license header template, because eslint-plugin-header
# is too eager to delete existing license blocks (which must be handled carefully)
- pattern: "^ This Source Code Form"
template: null
curly: error
"@typescript-eslint/no-unused-vars":
[error, { vars: all, args: after-used, varsIgnorePattern: "^_", argsIgnorePattern: "^_" }]
no-underscore-dangle: [error, { allowAfterThis: true }]
# Some good ones that people really should be adding to import/recommended:
import/first: error
import/no-self-import: error
import/no-useless-path-segments: error
import/no-mutable-exports: error
import/newline-after-import: error
import/no-duplicates: error # https://github.com/benmosher/eslint-plugin-import/issues/242#issuecomment-230118951
# Group imports into two groups: packages and files. Sort alphabetically
# within those groups.
import/order:
- error
- alphabetize: { order: asc }
newlines-between: always
groups: [[builtin, external], [internal, parent, sibling, index]]
prefer-arrow-callback: [error, { allowNamedFunctions: true }]
"@typescript-eslint/no-shadow": error
no-restricted-syntax:
- error
- selector: "MethodDefinition[kind='get'], Property[kind='get']"
message: "Property getters are not allowed; prefer function syntax instead."
- selector: "MethodDefinition[kind='set'], Property[kind='set']"
message: "Property setters are not allowed; prefer function syntax instead."
# We disable console methods here rather than using no-console so that it doesn't prohibit overrides such as "console.info = ..."
- selector: "CallExpression[callee.object.name='console'][callee.property.name!=/^(warn|error|debug|assert)$/]"
message: "Unexpected property on console object was called"