@wistia/eslint-config 0.5.3 → 0.6.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/README.md +2 -1
- package/eslintRules/common.js +12 -0
- package/package.json +6 -4
package/README.md
CHANGED
|
@@ -4,13 +4,14 @@ Wistia's ESLint configuration. This repo is "pseudo-public" - private on our org
|
|
|
4
4
|
|
|
5
5
|
## How to install
|
|
6
6
|
|
|
7
|
-
TODO!
|
|
7
|
+
TODO!
|
|
8
8
|
|
|
9
9
|
## Guidelines for adding new rules
|
|
10
10
|
|
|
11
11
|
1. preference given for autofixable rules; for non-autofixable rules consider seeking consensus from co-workers (open a PR on this repo and ask for feedback in #engineering-general!)
|
|
12
12
|
2. should not contradict existing rules
|
|
13
13
|
3. person/team adding new rules handles upgrading consumers and fixing violations
|
|
14
|
+
4. rules should always be set to `error`, never `warn` (the latter are never fixed)
|
|
14
15
|
|
|
15
16
|
## Publishing
|
|
16
17
|
|
package/eslintRules/common.js
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
const restrictedGlobals = require('confusing-browser-globals');
|
|
2
|
+
|
|
1
3
|
// these rules are included in all config types
|
|
2
4
|
module.exports = {
|
|
3
5
|
// prettier configuration
|
|
4
6
|
'prettier/prettier': 'error',
|
|
7
|
+
// browser globals that commonly cause confusion and are not recommended
|
|
8
|
+
// to use without an explicit `window`.` qualifier
|
|
9
|
+
'no-restricted-globals': ['error'].concat(restrictedGlobals),
|
|
5
10
|
// this rule is not particularly useful
|
|
6
11
|
'class-methods-use-this': 'off',
|
|
7
12
|
// anonymous exports make grepping code from Dev Tools component tree more difficult
|
|
@@ -19,4 +24,11 @@ module.exports = {
|
|
|
19
24
|
],
|
|
20
25
|
// this will allow unary operators in for loops only
|
|
21
26
|
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
|
|
27
|
+
// in airbnb config these are set to `warn`
|
|
28
|
+
'func-names': ['error', 'always'],
|
|
29
|
+
'no-constant-condition': ['error'],
|
|
30
|
+
'no-alert': ['error'],
|
|
31
|
+
// prevent default exports
|
|
32
|
+
'import/no-default-export': 'error',
|
|
33
|
+
'import/prefer-default-export': 'off',
|
|
22
34
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wistia/eslint-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Wistia's ESLint configurations",
|
|
5
5
|
"main": "react.js",
|
|
6
6
|
"scripts": {
|
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@babel/core": "^7.17.10",
|
|
13
13
|
"@babel/eslint-parser": "^7.17.0",
|
|
14
|
+
"@babel/preset-react": "^7.17.12",
|
|
15
|
+
"confusing-browser-globals": "^1.0.11",
|
|
14
16
|
"eslint": "^8.14.0",
|
|
15
17
|
"eslint-config-airbnb": "^19.0.4",
|
|
16
18
|
"eslint-config-prettier": "^8.5.0",
|
|
@@ -25,15 +27,15 @@
|
|
|
25
27
|
"eslint-plugin-react": "^7.29.4",
|
|
26
28
|
"eslint-plugin-react-hooks": "^4.5.0",
|
|
27
29
|
"eslint-plugin-sonarjs": "^0.13.0",
|
|
28
|
-
"eslint-plugin-styled-components-a11y": "
|
|
30
|
+
"eslint-plugin-styled-components-a11y": "0.0.34",
|
|
29
31
|
"eslint-plugin-testing-library": "^5.3.1",
|
|
30
32
|
"postcss": "^8.4.13",
|
|
31
33
|
"postcss-scss": "^4.0.4",
|
|
32
34
|
"prettier": "^2.6.2",
|
|
33
35
|
"stylelint": "^14.8.1",
|
|
34
36
|
"stylelint-config-prettier": "^9.0.3",
|
|
35
|
-
"stylelint-config-standard": "^
|
|
36
|
-
"stylelint-config-standard-scss": "^
|
|
37
|
+
"stylelint-config-standard": "^26.0.0",
|
|
38
|
+
"stylelint-config-standard-scss": "^4.0.0",
|
|
37
39
|
"stylelint-declaration-block-no-ignored-properties": "^2.5.0",
|
|
38
40
|
"stylelint-prettier": "^2.0.0",
|
|
39
41
|
"stylelint-processor-styled-components": "^1.10.0",
|