forked from danskernesdigitalebibliotek/dpl-design-system
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc
115 lines (115 loc) · 2.92 KB
/
.eslintrc
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
{
"parser": "@typescript-eslint/parser",
"extends": [
"airbnb",
"airbnb-typescript",
"airbnb/hooks",
"plugin:@typescript-eslint/recommended",
"prettier",
"plugin:prettier/recommended",
"plugin:react/jsx-runtime"
],
"settings": {
"react": {
"version": "16.11.0"
}
},
"env": {
"browser": true,
"es6": true
},
"parserOptions": {
"sourceType": "module",
"allowImportExportEverywhere": false,
"ecmaFeatures": {
"jsx": true,
"globalReturn": false,
},
"project": "./tsconfig.json"
},
"rules": {
"prefer-arrow-callback": [
"error",
{
"allowNamedFunctions": false,
"allowUnboundThis": true
}
],
"no-param-reassign": [
"error",
{
"props": true,
"ignorePropertyModificationsFor": [
"state"
]
}
],
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": true
}
],
// We like to use arrow function syntax also for functional components.
"react/function-component-definition": "off",
// No complaints about missing trailing comma
"@typescript-eslint/comma-dangle": "off"
},
"overrides": [
{
"files": [
"*.tsx"
],
"rules": {
// We do not use prop-types in ts.
"react/prop-types": "off",
"react/require-default-props": "off",
"react/no-unused-prop-types": "off",
"no-underscore-dangle": [
"error",
{
"allow": [
"__typename"
]
}
],
// We do not create any functionality for our components
// outside of making them work for storybook viewing
"jsx-a11y/click-events-have-key-events": "off",
"jsx-a11y/no-noninteractive-element-interactions": "off",
"react/button-has-type": "off",
"jsx-a11y/alt-text": "off",
"react/no-unstable-nested-components": "off",
"react/no-array-index-key": "off",
"jsx-a11y/anchor-is-valid": "off",
"global-require": "off",
"jsx-a11y/no-static-element-interactions": "off",
"react/jsx-props-no-spreading": "off",
"jsx-a11y/label-has-associated-control": "off",
// We do not need return types on react components.
"@typescript-eslint/explicit-module-boundary-types": "off"
}
},
{
"files": [
"*.stories.jsx",
"*.stories.tsx",
"*.hoc.tsx"
],
"rules": {
// We need a simple way of passing args in stories via object spreading.
"react/jsx-props-no-spreading": "off"
}
},
{
"files": [
"*.entry.tsx"
],
"rules": {
// Since we use High Order Functional Component in entries for text props
// and want to show the props being used we disable this rule.
"@typescript-eslint/no-unused-vars": "off"
}
}
]
}