@guardian/eslint-config 0.5.0 → 1.0.0
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 +12 -0
- package/package.json +9 -7
package/index.js
CHANGED
|
@@ -15,6 +15,9 @@ module.exports = {
|
|
|
15
15
|
],
|
|
16
16
|
plugins: ['eslint-comments'],
|
|
17
17
|
rules: {
|
|
18
|
+
// prevent dangling returns without braces
|
|
19
|
+
curly: ['error', 'multi-line'],
|
|
20
|
+
|
|
18
21
|
// require a `eslint-enable` comment for every `eslint-disable` comment
|
|
19
22
|
'eslint-comments/disable-enable-pair': [2, { allowWholeFile: true }],
|
|
20
23
|
|
|
@@ -36,8 +39,14 @@ module.exports = {
|
|
|
36
39
|
// and sometimes tools or 3rd parties require it
|
|
37
40
|
'no-underscore-dangle': 0,
|
|
38
41
|
|
|
42
|
+
// encourages consistent token use across code bases
|
|
43
|
+
// (you have to deliberately rename an import) and
|
|
44
|
+
// makes the location of errors easier to discover:
|
|
45
|
+
// https://twitter.com/addyosmani/status/1411233253948747777
|
|
39
46
|
'import/no-default-export': 2,
|
|
40
47
|
'import/prefer-default-export': 0,
|
|
48
|
+
|
|
49
|
+
// less diff noise (they're hoisted anyway)
|
|
41
50
|
'import/first': 2,
|
|
42
51
|
|
|
43
52
|
// fixable import formatting, designed to minimise diff noise
|
|
@@ -70,5 +79,8 @@ module.exports = {
|
|
|
70
79
|
},
|
|
71
80
|
},
|
|
72
81
|
],
|
|
82
|
+
|
|
83
|
+
// prevent circular dependencies
|
|
84
|
+
'import/no-cycle': 2,
|
|
73
85
|
},
|
|
74
86
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guardian/eslint-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "ESLint config for Guardian JavaScript projects",
|
|
5
5
|
"homepage": "https://github.com/guardian/configs#readme",
|
|
6
6
|
"license": "MIT",
|
|
@@ -12,15 +12,17 @@
|
|
|
12
12
|
"bugs": {
|
|
13
13
|
"url": "https://github.com/guardian/configs/issues"
|
|
14
14
|
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"eslint-config-prettier": "8.3.0",
|
|
17
|
+
"eslint-plugin-eslint-comments": "3.2.0",
|
|
18
|
+
"eslint-plugin-import": "2.25.3",
|
|
19
|
+
"eslint-plugin-prettier": "4.0.0"
|
|
20
|
+
},
|
|
15
21
|
"peerDependencies": {
|
|
16
|
-
"eslint": "^
|
|
17
|
-
"eslint-config-prettier": "^8.0.0",
|
|
18
|
-
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
19
|
-
"eslint-plugin-import": "^2.22.1",
|
|
20
|
-
"eslint-plugin-prettier": "^3.3.0"
|
|
22
|
+
"eslint": "^8.0.0"
|
|
21
23
|
},
|
|
22
24
|
"publishConfig": {
|
|
23
25
|
"access": "public"
|
|
24
26
|
},
|
|
25
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "8262a118420b333acc0d3928a253702bc3d0e1a0"
|
|
26
28
|
}
|