forked from cruise-automation/webviz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
63 lines (62 loc) · 2.11 KB
/
.eslintrc.js
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
// @flow
//
// Copyright (c) 2018-present, Cruise LLC
//
// This source code is licensed under the Apache License, Version 2.0,
// found in the LICENSE file in the root directory of this source tree.
// You may not use this file except in compliance with the License.
module.exports = {
plugins: ["header", "react-hooks"],
rules: {
"no-restricted-imports": [
"error",
{
paths: [
{ name: "lodash", importNames: ["get"], message: "Use optional chaining instead of lodash.get." },
{ name: "lodash/get", message: "Use optional chaining instead of lodash.get." },
],
patterns: ["client/*", "shared/*", "server/*", "webviz-core/migrations", "webviz-core/migrations/*"],
},
],
"no-restricted-modules": [
"error",
{ patterns: ["client/*", "shared/*", "server/*", "webviz-core/migrations", "webviz-core/migrations/*"] },
],
"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.",
},
],
"header/header": [
2,
"line",
[
" @flow",
"",
{
pattern: "^ Copyright \\(c\\) \\d{4}-present, Cruise LLC$",
template: " Copyright (c) 2021-present, Cruise LLC",
},
"",
" This source code is licensed under the Apache License, Version 2.0,",
" found in the LICENSE file in the root directory of this source tree.",
" You may not use this file except in compliance with the License.",
],
],
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "error",
"no-console": "off",
"no-unused-vars": ["error", { vars: "all", args: "after-used", varsIgnorePattern: "^_", argsIgnorePattern: "^_" }],
},
globals: {
BigInt: true,
SharedArrayBuffer: true,
},
};