@sb1/eslint-config-ffe 8.0.3 → 8.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +7 -10
- package/package.json +10 -8
- package/rules/jsx-a11y.js +1 -1
- package/rules/jsx.js +15 -7
- package/CHANGELOG.md +0 -193
package/index.js
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
2
|
+
extends: [
|
|
3
3
|
'@sb1/eslint-config-ffe-base',
|
|
4
4
|
'./rules/jsx',
|
|
5
|
-
'./rules/jsx-a11y'
|
|
5
|
+
'./rules/jsx-a11y',
|
|
6
6
|
].map(require.resolve),
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
'parserOptions': {
|
|
12
|
-
'ecmaFeatures': {
|
|
13
|
-
'jsx': true
|
|
7
|
+
plugins: ['react', 'jsx-a11y', 'react-hooks'],
|
|
8
|
+
parserOptions: {
|
|
9
|
+
ecmaFeatures: {
|
|
10
|
+
jsx: true,
|
|
14
11
|
},
|
|
15
12
|
},
|
|
16
|
-
|
|
13
|
+
rules: {},
|
|
17
14
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sb1/eslint-config-ffe",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.1.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "SpareBank 1",
|
|
@@ -17,21 +17,23 @@
|
|
|
17
17
|
"lint": "eslint ."
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@sb1/eslint-config-ffe-base": "^3.0.
|
|
20
|
+
"@sb1/eslint-config-ffe-base": "^3.0.4"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"eslint": "^5.9.0",
|
|
24
|
-
"eslint-plugin-import": "^2.
|
|
24
|
+
"eslint-plugin-import": "^2.20.1",
|
|
25
25
|
"eslint-plugin-jsx-a11y": "^6.0.3",
|
|
26
|
-
"eslint-plugin-react": "^7.0.0"
|
|
26
|
+
"eslint-plugin-react": "^7.0.0",
|
|
27
|
+
"eslint-plugin-react-hooks": "^2.0.1"
|
|
27
28
|
},
|
|
28
29
|
"peerDependencies": {
|
|
29
|
-
"eslint": "
|
|
30
|
-
"eslint-plugin-jsx-a11y": "
|
|
31
|
-
"eslint-plugin-react": "
|
|
30
|
+
"eslint": "*",
|
|
31
|
+
"eslint-plugin-jsx-a11y": "*",
|
|
32
|
+
"eslint-plugin-react": "*",
|
|
33
|
+
"eslint-plugin-react-hooks": "*"
|
|
32
34
|
},
|
|
33
35
|
"publishConfig": {
|
|
34
36
|
"access": "public"
|
|
35
37
|
},
|
|
36
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "2bbaa979bf25dc291f521354217b28b17c04a270"
|
|
37
39
|
}
|
package/rules/jsx-a11y.js
CHANGED
|
@@ -67,7 +67,7 @@ module.exports = {
|
|
|
67
67
|
|
|
68
68
|
// Enforce that elements with explicit or implicit roles defined contain only aria-* properties supported by that role.
|
|
69
69
|
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/role-supports-aria-props.md
|
|
70
|
-
'jsx-a11y/role-supports-aria-props':
|
|
70
|
+
'jsx-a11y/role-supports-aria-props': 1,
|
|
71
71
|
|
|
72
72
|
// Enforce tabIndex value is not greater than zero.
|
|
73
73
|
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/tabindex-no-positive.md
|
package/rules/jsx.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
2
|
+
rules: {
|
|
3
3
|
// Enforce boolean attributes notation in JSX
|
|
4
4
|
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md
|
|
5
|
-
'react/jsx-boolean-value': [2, 'always'
|
|
5
|
+
'react/jsx-boolean-value': [2, 'always'],
|
|
6
6
|
|
|
7
7
|
// Validate JSX has key prop when in array or iterator
|
|
8
8
|
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-key.md
|
|
@@ -30,11 +30,11 @@ module.exports = {
|
|
|
30
30
|
|
|
31
31
|
// Ensure correct position of the first property.
|
|
32
32
|
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-first-prop-new-line.md
|
|
33
|
-
'react/jsx-first-prop-new-line'
|
|
33
|
+
'react/jsx-first-prop-new-line': [2, 'multiline'],
|
|
34
34
|
|
|
35
35
|
// Enforce the closing bracket location for JSX multiline elements.
|
|
36
36
|
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-closing-bracket-location.md
|
|
37
|
-
'react/jsx-closing-bracket-location'
|
|
37
|
+
'react/jsx-closing-bracket-location': [2],
|
|
38
38
|
|
|
39
39
|
// Prevent usage of dangerous JSX properties
|
|
40
40
|
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-danger.md
|
|
@@ -58,7 +58,7 @@ module.exports = {
|
|
|
58
58
|
|
|
59
59
|
// Prevent multiple component definition per file
|
|
60
60
|
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-multi-comp.md
|
|
61
|
-
'react/no-multi-comp': [2, {
|
|
61
|
+
'react/no-multi-comp': [2, { ignoreStateless: true }],
|
|
62
62
|
|
|
63
63
|
// Prevent usage of unknown DOM property
|
|
64
64
|
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unknown-property.md
|
|
@@ -86,6 +86,14 @@ module.exports = {
|
|
|
86
86
|
|
|
87
87
|
// Prevent missing props validation in a React component definition
|
|
88
88
|
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prop-types.md
|
|
89
|
-
'react/prop-types': [2]
|
|
90
|
-
|
|
89
|
+
'react/prop-types': [2],
|
|
90
|
+
|
|
91
|
+
// Prevent breaking rules of hooks
|
|
92
|
+
// https://reactjs.org/docs/hooks-rules.html
|
|
93
|
+
'react-hooks/rules-of-hooks': 'error',
|
|
94
|
+
|
|
95
|
+
// Warn about hook usage that is probably wrong
|
|
96
|
+
// https://reactjs.org/docs/hooks-rules.html
|
|
97
|
+
'react-hooks/exhaustive-deps': 'warn',
|
|
98
|
+
},
|
|
91
99
|
};
|
package/CHANGELOG.md
DELETED
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
# Change Log
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
-
|
|
6
|
-
## [8.0.3](https://github.com/SpareBank1/designsystem/compare/@sb1/eslint-config-ffe@8.0.2...@sb1/eslint-config-ffe@8.0.3) (2018-12-04)
|
|
7
|
-
|
|
8
|
-
**Note:** Version bump only for package @sb1/eslint-config-ffe
|
|
9
|
-
|
|
10
|
-
<a name="8.0.2"></a>
|
|
11
|
-
|
|
12
|
-
## [8.0.2](https://github.com/SpareBank1/designsystem/compare/@sb1/eslint-config-ffe@8.0.1...@sb1/eslint-config-ffe@8.0.2) (2018-08-15)
|
|
13
|
-
|
|
14
|
-
**Note:** Version bump only for package @sb1/eslint-config-ffe
|
|
15
|
-
|
|
16
|
-
<a name="8.0.1"></a>
|
|
17
|
-
|
|
18
|
-
## [8.0.1](https://github.com/SpareBank1/designsystem/compare/@sb1/eslint-config-ffe@8.0.0...@sb1/eslint-config-ffe@8.0.1) (2018-08-09)
|
|
19
|
-
|
|
20
|
-
**Note:** Version bump only for package @sb1/eslint-config-ffe
|
|
21
|
-
|
|
22
|
-
<a name="8.0.0"></a>
|
|
23
|
-
|
|
24
|
-
# 8.0.0 (2018-02-25)
|
|
25
|
-
|
|
26
|
-
### Bug Fixes
|
|
27
|
-
|
|
28
|
-
- Replace eslint ignore with customized lint rule. ([d98ed78](https://github.com/SpareBank1/designsystem/commit/d98ed78))
|
|
29
|
-
|
|
30
|
-
### Chores
|
|
31
|
-
|
|
32
|
-
- add [@sb1](https://github.com/sb1)/ scope to all packages ([37efbb4](https://github.com/SpareBank1/designsystem/commit/37efbb4))
|
|
33
|
-
|
|
34
|
-
### Features
|
|
35
|
-
|
|
36
|
-
- **eslint-config-ffe:** Add contribute.md link to readme ([68645d6](https://github.com/SpareBank1/designsystem/commit/68645d6))
|
|
37
|
-
- **eslint-config-ffe:** Upgrade to eslint 4 ([cd8b1c6](https://github.com/SpareBank1/designsystem/commit/cd8b1c6))
|
|
38
|
-
|
|
39
|
-
### BREAKING CHANGES
|
|
40
|
-
|
|
41
|
-
- All packages have been renamed to add the @sb1 scope.
|
|
42
|
-
|
|
43
|
-
See links [1] and [2] to read more about package scopes.
|
|
44
|
-
|
|
45
|
-
Unfortunately this requires you update both your dependencies in
|
|
46
|
-
`package.json` and all `import` or `require` statements in your code.
|
|
47
|
-
Also, you unfortunately have to upgrade all FFE packages at once due to
|
|
48
|
-
dependency between packages. If you are on the latest version prior to
|
|
49
|
-
this breaking change the upgrade should be a matter of updating
|
|
50
|
-
`package.json` with new package names and versions, and updating your
|
|
51
|
-
imports.
|
|
52
|
-
|
|
53
|
-
To help find the proper package versions you can either browse to the
|
|
54
|
-
packages you need or check out the list of Git tags either on
|
|
55
|
-
Github [3] or by cloning the repository and running the `git tag`
|
|
56
|
-
command. All package versions get a tag in the format
|
|
57
|
-
_package@version_.
|
|
58
|
-
|
|
59
|
-
Update your `package.json` with the latest package version and add the
|
|
60
|
-
@sb1 scope to the package name:
|
|
61
|
-
|
|
62
|
-
```diff
|
|
63
|
-
- "ffe-core": "11.0.2",
|
|
64
|
-
+ "@sb1/ffe-core": "11.0.2",
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
Scoped packages all get put in a subdirectory in `node_modules/`. In our
|
|
68
|
-
case packages will be put in the `node_modules/@sb1/` directory. If your
|
|
69
|
-
build depends on file paths (for instance for copying fonts) you need to
|
|
70
|
-
update that path to include the scope.
|
|
71
|
-
|
|
72
|
-
The directory structure also means you have to update your imports, both
|
|
73
|
-
in Less and in JavaScript.
|
|
74
|
-
|
|
75
|
-
Using `less-plugin-npm-import`:
|
|
76
|
-
|
|
77
|
-
```diff
|
|
78
|
-
- @import 'npm://ffe-core/less/ffe';
|
|
79
|
-
+ @import 'npm://@sb1/ffe-core/less/ffe';
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
Using Webpack:
|
|
83
|
-
|
|
84
|
-
```diff
|
|
85
|
-
- @import '~ffe-core/less/ffe';
|
|
86
|
-
+ @import '~@sb1/ffe-core/less/ffe';
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
Using plain old paths:
|
|
90
|
-
|
|
91
|
-
```diff
|
|
92
|
-
- @import '../path/to/node_modules/ffe-core/less/ffe';
|
|
93
|
-
+ @import '../path/to/node_modules/@sb1/ffe-core/less/ffe';
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
JavaScript `import`:
|
|
97
|
-
|
|
98
|
-
```diff
|
|
99
|
-
- import { ActionButton } from 'ffe-buttons-react';
|
|
100
|
-
+ import { ActionButton } from '@sb1/ffe-buttons-react';
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
JavaScript `require`:
|
|
104
|
-
|
|
105
|
-
```diff
|
|
106
|
-
- const { ActionButton } = require('ffe-buttons-react').default;
|
|
107
|
-
+ const { ActionButton } = require('@sb1/ffe-buttons-react').default;
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
[1]: https://docs.npmjs.com/misc/scope
|
|
111
|
-
[2]: https://docs.npmjs.com/getting-started/scoped-packages
|
|
112
|
-
[3]: https://github.com/sparebank1/designsystem/tags
|
|
113
|
-
|
|
114
|
-
- **eslint-config-ffe:** Removes deprecated ecmaFeature setting and drops
|
|
115
|
-
support for eslint 3 and older.
|
|
116
|
-
|
|
117
|
-
<a name="7.0.2"></a>
|
|
118
|
-
|
|
119
|
-
## [7.0.2](https://github.com/SpareBank1/designsystem/compare/eslint-config-ffe@7.0.1...eslint-config-ffe@7.0.2) (2018-02-22)
|
|
120
|
-
|
|
121
|
-
**Note:** Version bump only for package eslint-config-ffe
|
|
122
|
-
|
|
123
|
-
<a name="7.0.1"></a>
|
|
124
|
-
|
|
125
|
-
## [7.0.1](https://github.com/SpareBank1/designsystem/compare/eslint-config-ffe@7.0.0...eslint-config-ffe@7.0.1) (2018-01-10)
|
|
126
|
-
|
|
127
|
-
### Bug Fixes
|
|
128
|
-
|
|
129
|
-
- Replace eslint ignore with customized lint rule.
|
|
130
|
-
|
|
131
|
-
<a name="7.0.0"></a>
|
|
132
|
-
|
|
133
|
-
# 7.0.0 (2017-12-22)
|
|
134
|
-
|
|
135
|
-
### Features
|
|
136
|
-
|
|
137
|
-
- **eslint-config-ffe:** Add contribute.md link to readme
|
|
138
|
-
- **eslint-config-ffe:** Upgrade to eslint 4
|
|
139
|
-
|
|
140
|
-
### BREAKING CHANGES
|
|
141
|
-
|
|
142
|
-
- **eslint-config-ffe:** Removes deprecated ecmaFeature setting and drops
|
|
143
|
-
support for eslint 3 and older.
|
|
144
|
-
|
|
145
|
-
## 6.0.2 (13.10.2017)
|
|
146
|
-
|
|
147
|
-
- (patch) added support for `eslint-plugin-react@7`
|
|
148
|
-
- (patch) added various devDependencies
|
|
149
|
-
|
|
150
|
-
## 6.0.1 (08.03.2017)
|
|
151
|
-
|
|
152
|
-
- (patch) at least one rule in `eslint-plugin-react` no longer work without an array prop.
|
|
153
|
-
|
|
154
|
-
# 6.0.0 (29.12.2016)
|
|
155
|
-
|
|
156
|
-
- (breaking) jsx-a11y rules are included by default and require eslint-plugin-jsx-a11y.
|
|
157
|
-
|
|
158
|
-
# 5.1.0 (28.12.2016)
|
|
159
|
-
|
|
160
|
-
- (feature) Include rules for eslint-plugin-jsx-a11y. Consumers must explicit included the rules.
|
|
161
|
-
|
|
162
|
-
## 5.0.1 (18.10.2016)
|
|
163
|
-
|
|
164
|
-
- (patch) Remove eslint-plugin-import from peerDependencies, we get that from eslint-config-ffe-base. To avoid having to maintain the version number in two places.
|
|
165
|
-
|
|
166
|
-
# 5.0.0 (04.10.2016)
|
|
167
|
-
|
|
168
|
-
- (patch) Add eslint@3.0.0 to peerDependencies
|
|
169
|
-
- (patch) Update eslint-plugin-import to 1.10.1 to get updated peerDependencies
|
|
170
|
-
- (breaking) Add elinst-plugin-react@6.0.0 to peerDependencies
|
|
171
|
-
|
|
172
|
-
# 4.0.0 (20.09.2016)
|
|
173
|
-
|
|
174
|
-
- (breaking) Enforce line brake after first prop in components if multiline props
|
|
175
|
-
- (breaking) Enforce closing tag of components to be on new line if multiline props
|
|
176
|
-
|
|
177
|
-
# 3.0.0 (10.08.2016)
|
|
178
|
-
|
|
179
|
-
- (breaking) Add new version of eslint-config-ffe-base which removes the "no-eq-null"-rule
|
|
180
|
-
|
|
181
|
-
# 2.0.0 (12.05.2016)
|
|
182
|
-
|
|
183
|
-
- (breaking) Move most rules to eslint-config-ffe-base
|
|
184
|
-
|
|
185
|
-
## 1.0.1 (06.05.2016)
|
|
186
|
-
|
|
187
|
-
- (bugfix) Removed duplicate rule "no-duplicates"
|
|
188
|
-
- (feature) Added "prop-types" rule
|
|
189
|
-
- (bugfix) Added "ignoreStateless"-option to "no-multi-comp"-rule
|
|
190
|
-
|
|
191
|
-
# 1.0.0 (02.05.2016)
|
|
192
|
-
|
|
193
|
-
- Initial release
|