-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
52 lines (50 loc) · 1.57 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
// @flow strict
/* eslint-disable no-unused-vars */
const OFF = 0;
const WARN = 1;
const ERROR = 2;
/* eslint-enable no-unused-vars */
module.exports = {
env: {
browser: true,
},
extends: [
'@adeira/eslint-config/strict', // preset with almost everything
'@adeira/eslint-config/fbt', // additional FBT rules
],
rules: {
// TODO: this should be true for all users of `@adeira/sx-design` so we should make it reusable?
'react/forbid-elements': [
'error',
{
forbid: [
{ element: 'a', message: 'use <Link/> or <LinkButton/> instead' },
{ element: 'button', message: 'use <Button/> or <ButtonLink/> instead' },
{ element: 'h1', message: 'use <Text as="h1"/> instead' },
{ element: 'h2', message: 'use <Text as="h2"/> instead' },
{ element: 'h3', message: 'use <Text as="h3"/> instead' },
{ element: 'h4', message: 'use <Text as="h4"/> instead' },
{ element: 'h5', message: 'use <Text as="h5"/> instead' },
{ element: 'h6', message: 'use <Text as="h6"/> instead' },
{ element: 'img', message: 'use <Image/> instead' },
{ element: 'kbd', message: 'use <Kbd/> instead' },
],
},
],
'no-restricted-imports': [
ERROR,
{
paths: [
{
name: '@testing-library/user-event',
message: "Please use 'test-utils' instead.",
},
{
name: '@testing-library/react',
message: "Please use 'test-utils' instead.",
},
],
},
],
},
};