-
Notifications
You must be signed in to change notification settings - Fork 1
/
no-restricted-imports.js
47 lines (47 loc) · 1.17 KB
/
no-restricted-imports.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
module.exports = {
// Documentation: https://eslint.org/docs/rules/no-restricted-imports#options
paths: [
{
name: "lodash",
importNames: ["lowerCase"],
message: "Use the native String.toLowerCase method instead.",
},
],
patterns: [
{
group: ["lodash/*"],
message: 'You can import "lodash" instead of "lodash/*".',
},
{
group: ["immer/*"],
importNames: ["WritableDraft"],
message: 'Use this instead: import { type Draft } from "immer"',
},
{
group: ["react-spinners"],
message:
"Use the local <Loader/> component instead, it's already centered.",
},
{
group: ["react-bootstrap/*", "!react-bootstrap/types"],
message:
'You can import "react-bootstrap" instead of "react-bootstrap/*".',
},
{
group: ["formik"],
importNames: ["Form", "Formik"],
message: 'Use this instead: import "@/components/form/Form"',
},
{
group: ["react-bootstrap"],
importNames: ["Form"],
message: 'Use this instead: import "@/components/form/Form"',
},
{
group: ["webext-detect-page"],
importNames: ["isDevToolsPage"],
message:
'Use this instead: import { isPageEditor } from "@/utils/expectContext";',
},
],
};