@shelf/eslint-config 2.22.0 → 2.22.2
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 +0 -12
- package/frontend-typescript.js +7 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -76,18 +76,6 @@ $ yarn add @shelf/eslint-config --dev
|
|
|
76
76
|
}
|
|
77
77
|
```
|
|
78
78
|
|
|
79
|
-
#### React with testing-library `.eslintrc`
|
|
80
|
-
|
|
81
|
-
```json
|
|
82
|
-
{
|
|
83
|
-
"extends": ["@shelf/eslint-config/frontend-testing-library"],
|
|
84
|
-
"rules": {
|
|
85
|
-
"testing-library/no-wait-for-empty-callback": "error",
|
|
86
|
-
"testing-library/no-await-sync-query": "error"
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
```
|
|
90
|
-
|
|
91
79
|
## Publish
|
|
92
80
|
|
|
93
81
|
```sh
|
package/frontend-typescript.js
CHANGED
|
@@ -2,7 +2,6 @@ const commonExtends = require('./common/extends.json');
|
|
|
2
2
|
const commonPlugins = require('./common/plugins');
|
|
3
3
|
const tsParser = require('./common/ts-parser');
|
|
4
4
|
const {allowRequireInConfigs, noExplicitReturnTypeInTests} = require('./common/overrides');
|
|
5
|
-
const consistentTypeAssertions = require('./rules/consistent-type-assertions.json');
|
|
6
5
|
const consistentTypeImports = require('./rules/consistent-type-imports.json');
|
|
7
6
|
const frontendConfig = require('./frontend');
|
|
8
7
|
const typescriptRules = require('./rules/typescript');
|
|
@@ -21,10 +20,11 @@ module.exports = {
|
|
|
21
20
|
'jest/lowercase-name': 'off',
|
|
22
21
|
'react/prop-types': 'off',
|
|
23
22
|
'react/display-name': 'warn',
|
|
24
|
-
...consistentTypeAssertions,
|
|
25
23
|
'testing-library/await-async-query': 'error',
|
|
26
24
|
'testing-library/no-await-sync-query': 'error',
|
|
27
|
-
'testing-library/no-
|
|
25
|
+
'testing-library/no-wait-for-empty-callback': 'error',
|
|
26
|
+
// It's enabled in overrides
|
|
27
|
+
'testing-library/no-debugging-utils': 'off',
|
|
28
28
|
'testing-library/consistent-data-testid': [
|
|
29
29
|
2,
|
|
30
30
|
{
|
|
@@ -32,11 +32,13 @@ module.exports = {
|
|
|
32
32
|
},
|
|
33
33
|
],
|
|
34
34
|
...consistentTypeImports,
|
|
35
|
-
|
|
35
|
+
'you-dont-need-lodash-underscore/get': 'error',
|
|
36
36
|
// it fail to compile TS on react static class properties (displayName | defaultProps | etc..)
|
|
37
37
|
'@typescript-eslint/explicit-member-accessibility': 0,
|
|
38
|
+
'@typescript-eslint/consistent-type-assertions': 'warn',
|
|
38
39
|
// Don`t need for typescript files
|
|
39
40
|
'@typescript-eslint/no-empty-function': 'off',
|
|
41
|
+
'@typescript-eslint/no-unused-vars': ['error', {ignoreRestSiblings: true}],
|
|
40
42
|
...typescriptRules,
|
|
41
43
|
...restrictedPackagesImportRules,
|
|
42
44
|
},
|
|
@@ -52,6 +54,7 @@ module.exports = {
|
|
|
52
54
|
rules: {
|
|
53
55
|
camelcase: 'off',
|
|
54
56
|
'sonarjs/no-duplicate-string': 'off',
|
|
57
|
+
'testing-library/no-debugging-utils': 'error',
|
|
55
58
|
},
|
|
56
59
|
},
|
|
57
60
|
{
|