Skip to content

Commit c5cf2b9

Browse files
spawniaclaude
andauthored
build: Update @mll-lab/eslint-plugin to ^1.4.0 (#56)
* Update @mll-lab/eslint-plugin to ^1.4.0 Apply new prefer-loose-nullish-equality rule. Co-Authored-By: Claude <noreply@anthropic.com> * Fix test: preserve null/undefined distinction in errorMessage The errorMessage function intentionally treats null and undefined differently (null returns "null" via JSON.stringify, undefined returns "undefined" string). Added eslint-disable comment to preserve this. Co-Authored-By: Claude <noreply@anthropic.com> * turn around --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 80a8822 commit c5cf2b9

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"@babel/preset-env": "^7.13.0",
5353
"@babel/runtime": "^7.13.6",
5454
"@mll-lab/eslint-config": "^3.1.0",
55-
"@mll-lab/eslint-plugin": "^1.3.4",
55+
"@mll-lab/eslint-plugin": "^1.4.0",
5656
"@mll-lab/prettier-config": "^1.0.0",
5757
"@mll-lab/tsconfig": "^1.1.0",
5858
"@rollup/plugin-babel": "^5.3.0",

src/error.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
export function errorMessage(error: unknown): string {
88
const message = hasMessage(error) ? error.message : error;
99

10+
// eslint-disable-next-line @mll-lab/prefer-loose-nullish-equality -- intentionally distinguish null and undefined
1011
if (message === undefined) {
1112
return 'undefined';
1213
}
@@ -15,5 +16,5 @@ export function errorMessage(error: unknown): string {
1516
}
1617

1718
function hasMessage(error: unknown): error is { message: unknown } {
18-
return typeof error === 'object' && error !== null && 'message' in error;
19+
return error != null && typeof error === 'object' && 'message' in error;
1920
}

src/germanNumber.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export function formatGermanNumber(
3535
export function parseGermanNumber(
3636
value: string | null | undefined,
3737
): number | null {
38-
if (value === null || value === undefined) {
38+
if (value == null) {
3939
return null;
4040
}
4141

src/number.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function firstDecimalDigit(number: number): number {
1616
const regExp = /\d*\.(\d)/;
1717
const regExpMatchArray = number.toString().match(regExp);
1818

19-
if (regExpMatchArray === null) {
19+
if (regExpMatchArray == null) {
2020
throw new Error(`Invalid number for regex matching: ${number}`);
2121
}
2222

yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1829,14 +1829,14 @@ __metadata:
18291829
languageName: node
18301830
linkType: hard
18311831

1832-
"@mll-lab/eslint-plugin@npm:^1.3.4":
1833-
version: 1.3.4
1834-
resolution: "@mll-lab/eslint-plugin@npm:1.3.4"
1832+
"@mll-lab/eslint-plugin@npm:^1.4.0":
1833+
version: 1.4.0
1834+
resolution: "@mll-lab/eslint-plugin@npm:1.4.0"
18351835
dependencies:
18361836
"@typescript-eslint/experimental-utils": "npm:^5.62"
18371837
peerDependencies:
18381838
eslint: ^8.8.0
1839-
checksum: 10c0/228442c1ddaccf094e0fd4e2d7116fbbac29977d4ba12d7c4b435453f730a4a93c66c428f9df8afacb26bcd5e728ea51404a556b1f9bf4053243e1d68d3cbcdd
1839+
checksum: 10c0/695c1f8720a89418222c63f527e03a898eca8d325549685b40b52fe31ddd252517501aebf76effca003f7acada303bc6ca316845c16837b53800c89f57d44cc9
18401840
languageName: node
18411841
linkType: hard
18421842

@@ -1850,7 +1850,7 @@ __metadata:
18501850
"@babel/preset-env": "npm:^7.13.0"
18511851
"@babel/runtime": "npm:^7.13.6"
18521852
"@mll-lab/eslint-config": "npm:^3.1.0"
1853-
"@mll-lab/eslint-plugin": "npm:^1.3.4"
1853+
"@mll-lab/eslint-plugin": "npm:^1.4.0"
18541854
"@mll-lab/prettier-config": "npm:^1.0.0"
18551855
"@mll-lab/tsconfig": "npm:^1.1.0"
18561856
"@rollup/plugin-babel": "npm:^5.3.0"

0 commit comments

Comments
 (0)