eslint-config-beslogic 2.4.6 → 2.4.8
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 +8 -0
- package/javascript.js +0 -6
- package/lib/utils.js +3 -4
- package/package.json +5 -3
- package/typescript.js +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.4.8
|
|
4
|
+
|
|
5
|
+
Go back to explicit `@typescript-eslint/parser` and `@typescript-eslint/eslint-plugin` dependencies instead of `typescript-eslint` due to <https://github.com/danielnixon/eslint-plugin-total-functions/issues/477#issuecomment-2327088201>.
|
|
6
|
+
|
|
7
|
+
## 2.4.7
|
|
8
|
+
|
|
9
|
+
- No longer recommending to explicitely annotate void returning awaitable arrow functions as `(param): void => { statement }` in JavaScript.
|
|
10
|
+
|
|
3
11
|
## 2.4.6
|
|
4
12
|
|
|
5
13
|
- Replaced `@typescript-eslint/*` with `typescript-eslint`
|
package/javascript.js
CHANGED
|
@@ -31,12 +31,6 @@ const noRestrictedSyntax = [
|
|
|
31
31
|
"message":
|
|
32
32
|
"Prefer `Promise.resolve().then()` instead of `setTimeout` without a specified delay. " +
|
|
33
33
|
"See: https://developer.mozilla.org/en-US/docs/Web/API/setTimeout#reasons_for_delays_longer_than_specified and https://angular.io/guide/change-detection-zone-pollution"
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"selector":
|
|
37
|
-
"ArrowFunctionExpression[body.body.length=1][body.body.0.type=\"ExpressionStatement\"]:not([returnType.typeAnnotation.type=\"TSVoidKeyword\"])",
|
|
38
|
-
"message": "Consider removing braces around the arrow function's body. " +
|
|
39
|
-
"If it really needs to return `void` you can mark its return type explicitely with `(param): void => { statement }` to disable this warning."
|
|
40
34
|
}
|
|
41
35
|
]
|
|
42
36
|
|
package/lib/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// const isPreCommitCI = __dirname.startsWith("/pc/clone/")
|
|
1
|
+
// TEST const isPreCommitCI = __dirname.startsWith("/pc/clone/")
|
|
2
2
|
// console.log(__dirname)
|
|
3
3
|
// console.log(__filename)
|
|
4
4
|
|
|
@@ -23,10 +23,10 @@ const getModuleVersion = (
|
|
|
23
23
|
|
|
24
24
|
const resolveModuleLocation = (/** @type {string} */ nodeModule) => {
|
|
25
25
|
try {
|
|
26
|
-
// console.log(__dirname)
|
|
27
|
-
// console.log(__filename)
|
|
28
26
|
const resolved = require.resolve(nodeModule)
|
|
29
27
|
// DEBUG: console.log(resolved)
|
|
28
|
+
console.log(resolved)
|
|
29
|
+
console.log(resolved.startsWith("/pc/clone/"))
|
|
30
30
|
if (resolved.startsWith("/pc/clone/")) {
|
|
31
31
|
// Assume it's omitted from the pre-commit.ci run
|
|
32
32
|
return false
|
|
@@ -86,7 +86,6 @@ const idLenghtConfig = {
|
|
|
86
86
|
module.exports = {
|
|
87
87
|
getModuleVersion,
|
|
88
88
|
idLenghtConfig,
|
|
89
|
-
// isPreCommitCI,
|
|
90
89
|
jestFilePatterns,
|
|
91
90
|
jestNoRestrictedSyntax,
|
|
92
91
|
resolveModuleLocation
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-beslogic",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.8",
|
|
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",
|
|
@@ -39,9 +39,12 @@
|
|
|
39
39
|
"author": "Samuel Therrien <samuel.therrien@beslogic.com>",
|
|
40
40
|
"license": "MIT",
|
|
41
41
|
"// @babel/eslint-parser": "Bumped json5 to fix prototype Pollution in minimist <1.2.6",
|
|
42
|
+
"// typescript-eslint": "Can't use the proxy package because of total-functions: https://github.com/danielnixon/eslint-plugin-total-functions/issues/477#issuecomment-2327088201",
|
|
42
43
|
"dependencies": {
|
|
43
44
|
"@babel/eslint-parser": "^7.20.12",
|
|
44
45
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.1",
|
|
46
|
+
"@typescript-eslint/eslint-plugin": "^7.4",
|
|
47
|
+
"@typescript-eslint/parser": "^7.4",
|
|
45
48
|
"confusing-browser-globals": "^1.0",
|
|
46
49
|
"dprint": "^0.40.2",
|
|
47
50
|
"eslint": "^8.56",
|
|
@@ -60,8 +63,7 @@
|
|
|
60
63
|
"eslint-plugin-sonarjs": "^1.0",
|
|
61
64
|
"eslint-plugin-testing-library": "^6.0",
|
|
62
65
|
"eslint-plugin-unicorn": ">=49.0",
|
|
63
|
-
"eslint-plugin-unused-imports": "^3.2"
|
|
64
|
-
"typescript-eslint": "^7.4"
|
|
66
|
+
"eslint-plugin-unused-imports": "^3.2"
|
|
65
67
|
},
|
|
66
68
|
"// eslint-plugin-total-functions": "Supported version is dictated by TypeScript and ESLint",
|
|
67
69
|
"// (cont)": "Also made optional because of extra strictness",
|
package/typescript.js
CHANGED
|
@@ -12,6 +12,12 @@ const hasTotalFunctions = !!resolveModuleLocation("eslint-plugin-total-functions
|
|
|
12
12
|
const commaDangleDefault = "always-multiline"
|
|
13
13
|
const noRestrictedSyntax = [
|
|
14
14
|
...javascriptConfig.rules?.["no-restricted-syntax"] ?? {},
|
|
15
|
+
{
|
|
16
|
+
"selector":
|
|
17
|
+
"ArrowFunctionExpression[body.body.length=1][body.body.0.type=\"ExpressionStatement\"]:not([returnType.typeAnnotation.type=\"TSVoidKeyword\"])",
|
|
18
|
+
"message": "Consider removing braces around the arrow function's body. " +
|
|
19
|
+
"If it really needs to return `void` you can mark its return type explicitely with `(param): void => { statement }` to disable this warning."
|
|
20
|
+
},
|
|
15
21
|
// @typescript-eslint won't make this a rule
|
|
16
22
|
// https://github.com/typescript-eslint/typescript-eslint/issues/4247
|
|
17
23
|
{
|