@shopgate/eslint-config 7.30.0-alpha.4 → 7.30.0-alpha.6
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/package.json +1 -1
- package/ruleset/main.js +38 -1
package/package.json
CHANGED
package/ruleset/main.js
CHANGED
|
@@ -29,7 +29,44 @@ module.exports = {
|
|
|
29
29
|
exports: 'always-multiline',
|
|
30
30
|
functions: 'never',
|
|
31
31
|
}],
|
|
32
|
-
'import/extensions': [
|
|
32
|
+
'import/extensions': [
|
|
33
|
+
'error',
|
|
34
|
+
'ignorePackages',
|
|
35
|
+
{
|
|
36
|
+
js: 'never',
|
|
37
|
+
jsx: 'never',
|
|
38
|
+
ts: 'never',
|
|
39
|
+
tsx: 'never',
|
|
40
|
+
json: 'always',
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
'no-restricted-syntax': [
|
|
44
|
+
'error',
|
|
45
|
+
// Rules copied from airbnb base ruleset
|
|
46
|
+
{
|
|
47
|
+
selector: 'ForInStatement',
|
|
48
|
+
message: 'for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
selector: 'ForOfStatement',
|
|
52
|
+
message: 'iterators/generators require regenerator-runtime, which is too heavyweight for this guide to allow them. Separately, loops should be avoided in favor of array iterations.',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
selector: 'LabeledStatement',
|
|
56
|
+
message: 'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
selector: 'WithStatement',
|
|
60
|
+
message: '`with` is disallowed in strict mode because it makes code impossible to predict and optimize.',
|
|
61
|
+
},
|
|
62
|
+
// Disallow named imports from JSON files since it violates the ESM specifications
|
|
63
|
+
{
|
|
64
|
+
selector:
|
|
65
|
+
'ImportDeclaration[source.value=/\\.([Jj][Ss][Oo][Nn]|[Jj][Ss][Oo][Nn]5)(?:$|[?#])/] > ImportSpecifier',
|
|
66
|
+
message:
|
|
67
|
+
'Named imports from JSON are not allowed since they will not be supported by Webpack in future versions. Import the default and destructure.',
|
|
68
|
+
},
|
|
69
|
+
],
|
|
33
70
|
'import/prefer-default-export': 'off',
|
|
34
71
|
'import/no-extraneous-dependencies': 'off',
|
|
35
72
|
'import/named': 'error',
|