eslint-config-beslogic 2.4.12 → 2.4.13
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/CHANGELOG.md +4 -0
- package/README.md +1 -0
- package/package.json +1 -1
- package/typescript.js +23 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.4.13
|
|
4
|
+
|
|
5
|
+
- Made `eslint-import-resolver-typescript` optional since it can't correctly resolve our shared `tsconfig.json` when ran in pre-commit.ci
|
|
6
|
+
|
|
3
7
|
## 2.4.12
|
|
4
8
|
|
|
5
9
|
- Restored `regexp/prefer-d` pre-2.4 behaviour of prefering `/[\d_]/` over `/[0-9_]/`
|
package/README.md
CHANGED
|
@@ -85,6 +85,7 @@ As you'll easily bust the 250MiB limit on the free tier, omit the following depe
|
|
|
85
85
|
|
|
86
86
|
- `dprint`
|
|
87
87
|
- `@eslint-community/eslint-plugin-eslint-comments`
|
|
88
|
+
- `eslint-import-resolver-typescript`
|
|
88
89
|
- `eslint-plugin-total-functions`
|
|
89
90
|
- `esling-plugin-no-autofix`
|
|
90
91
|
- `eslint-plugin-testing-library`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-beslogic",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.13",
|
|
4
4
|
"description": "ESLint rules, plugins and configs used at Beslogic",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"// dependencies": "Run for ourselves when we install dependencies w/o running npm i afterward",
|
package/typescript.js
CHANGED
|
@@ -6,10 +6,14 @@ const { jestNoRestrictedSyntax, jestFilePatterns, resolveModuleLocation, isPreCo
|
|
|
6
6
|
"./lib/utils"
|
|
7
7
|
)
|
|
8
8
|
|
|
9
|
+
const hasTotalFunctions = !!resolveModuleLocation("eslint-plugin-total-functions")
|
|
9
10
|
// The only autofix we use is `no-implicit-any-catch` and this is a big module for pre-commit
|
|
10
11
|
// Outside of pre-commit, `eslint-plugin-etc` should NOT be considered optional !
|
|
11
12
|
const hasEtc = !!resolveModuleLocation("eslint-plugin-etc")
|
|
12
|
-
|
|
13
|
+
// Causes the following error in pre-commit.ci:
|
|
14
|
+
// Resolve error: File 'eslint-config-beslogic/tsconfig.5.0.json' not found.
|
|
15
|
+
// Outside of pre-commit, `eslint-import-resolver-typescript` should NOT be considered optional !
|
|
16
|
+
const hasImportResolverTypescript = !!resolveModuleLocation("eslint-import-resolver-typescript")
|
|
13
17
|
|
|
14
18
|
const commaDangleDefault = "always-multiline"
|
|
15
19
|
const noRestrictedSyntax = [
|
|
@@ -54,31 +58,35 @@ module.exports = {
|
|
|
54
58
|
...hasEtc
|
|
55
59
|
? ["plugin:etc/recommended"]
|
|
56
60
|
: [],
|
|
57
|
-
|
|
61
|
+
...hasImportResolverTypescript
|
|
62
|
+
? ["plugin:import/typescript"]
|
|
63
|
+
: []
|
|
58
64
|
],
|
|
59
65
|
"env": {
|
|
60
66
|
"es2021": true
|
|
61
67
|
},
|
|
62
68
|
"settings": {
|
|
69
|
+
...hasImportResolverTypescript
|
|
70
|
+
? {
|
|
71
|
+
"import/resolver": {
|
|
72
|
+
"typescript": {
|
|
73
|
+
// Recommended by eslint-import-resolver-typescript
|
|
74
|
+
// Always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
|
|
75
|
+
"alwaysTryTypes": true,
|
|
76
|
+
"project": [
|
|
77
|
+
"tsconfig?(.*).json",
|
|
78
|
+
"projects/*/tsconfig?(.*).json"
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
: {},
|
|
63
84
|
"import/parsers": {
|
|
64
85
|
"@typescript-eslint/parser": [
|
|
65
86
|
".ts",
|
|
66
87
|
".tsx"
|
|
67
88
|
]
|
|
68
89
|
},
|
|
69
|
-
"import/resolver": {
|
|
70
|
-
"typescript": {
|
|
71
|
-
"typescript": {
|
|
72
|
-
// Recommended by eslint-import-resolver-typescript
|
|
73
|
-
// Always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
|
|
74
|
-
"alwaysTryTypes": true,
|
|
75
|
-
"project": [
|
|
76
|
-
"tsconfig?(.*).json",
|
|
77
|
-
"projects/*/tsconfig?(.*).json"
|
|
78
|
-
]
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
90
|
// Required even with plugin:import/typescript
|
|
83
91
|
"import/extensions": [
|
|
84
92
|
".ts",
|