Skip to content

Commit 833d93d

Browse files
authored
Merge pull request #284 from NodeSecure/update-eslint-v2
chore: update eslint-config to v2.x
2 parents a5ee0ab + d777c52 commit 833d93d

14 files changed

Lines changed: 42 additions & 37 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
},
4747
"homepage": "https://github.com/NodeSecure/vulnera#readme",
4848
"devDependencies": {
49-
"@openally/config.eslint": "^1.3.0",
49+
"@openally/config.eslint": "^2.1.0",
5050
"@openally/config.typescript": "^1.0.3",
5151
"@slimio/is": "^2.0.0",
5252
"@types/node": "^22.1.0",
@@ -60,7 +60,7 @@
6060
"@myunisoft/httpie": "^5.0.0",
6161
"@nodesecure/npm-registry-sdk": "^3.0.0",
6262
"@npmcli/arborist": "^9.0.0",
63-
"@pnpm/audit": "^1002.0.0",
63+
"@pnpm/audit": "1001.0.2",
6464
"@pnpm/lockfile-file": "^9.1.1"
6565
}
6666
}

src/database/nvd.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Import Third-Party Dependencies
1+
// Import Third-party Dependencies
22
import * as httpie from "@myunisoft/httpie";
33

44
// Import Internal Dependencies

src/database/osv.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Import Third-Party Dependencies
1+
// Import Third-party Dependencies
22
import * as httpie from "@myunisoft/httpie";
33

44
// Import Internal Dependencies

src/database/snyk.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Import Third-Party Dependencies
1+
// Import Third-party Dependencies
22
import * as httpie from "@myunisoft/httpie";
33

44
// Import Internal Dependencies

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Import Internal Dependencies
12
import {
23
GitHubAdvisoryStrategy,
34
type GithubAdvisoryStrategyDefinition,

src/strategies/sonatype.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Import Third-Party Dependencies
1+
// Import Third-party Dependencies
22
import * as httpie from "@myunisoft/httpie";
33

44
// Import Internal Dependencies

src/strategies/types/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Import Internal Types
1+
// Import Internal Dependencies
22
import type { Dependencies } from "./scanner.js";
33
import type { StandardVulnerability } from "../../formats/standard/index.js";
44
import type { Kind } from "../../constants.js";

test/database/nvd.unit.spec.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import assert from "node:assert";
44

55
// Import Internal Dependencies
66
import {
7-
kHttpClientHeaders,
7+
HTTP_CLIENT_HEADERS,
88
setupHttpAgentMock
99
} from "../strategies/utils.js";
1010
import { nvd } from "../../src/database/index.js";
@@ -29,7 +29,7 @@ describe("nvd", () => {
2929
path: `${new URL(nvd.ROOT_API).pathname}?${queryString}`,
3030
method: "GET"
3131
})
32-
.reply(200, expectedResponse, kHttpClientHeaders);
32+
.reply(200, expectedResponse, HTTP_CLIENT_HEADERS);
3333

3434
const vulns = await nvd.findOne({
3535
packageName: "express",
@@ -39,7 +39,7 @@ describe("nvd", () => {
3939
assert.deepStrictEqual(vulns, expectedResponse.vulnerabilities);
4040
});
4141

42-
test(`should send a GET http request with severity parameter`, async() => {
42+
test("should send a GET http request with severity parameter", async() => {
4343
const expectedResponse = { vulnerabilities: ["cve-data-1"] };
4444
const params = new URLSearchParams();
4545
params.append("keywordSearch", "express");
@@ -51,7 +51,7 @@ describe("nvd", () => {
5151
path: `${new URL(nvd.ROOT_API).pathname}?${queryString}`,
5252
method: "GET"
5353
})
54-
.reply(200, expectedResponse, kHttpClientHeaders);
54+
.reply(200, expectedResponse, HTTP_CLIENT_HEADERS);
5555

5656
const vulns = await nvd.findOne({
5757
packageName: "express",
@@ -62,7 +62,7 @@ describe("nvd", () => {
6262
assert.deepStrictEqual(vulns, expectedResponse.vulnerabilities);
6363
});
6464

65-
test(`should send a GET http request to the NVD API using findOneBySpec`, async() => {
65+
test("should send a GET http request to the NVD API using findOneBySpec", async() => {
6666
const expectedResponse = { vulnerabilities: ["cve-data-1", "cve-data-2"] };
6767
const packageName = "express";
6868
const params = new URLSearchParams();
@@ -74,13 +74,13 @@ describe("nvd", () => {
7474
path: `${new URL(nvd.ROOT_API).pathname}?${queryString}`,
7575
method: "GET"
7676
})
77-
.reply(200, expectedResponse, kHttpClientHeaders);
77+
.reply(200, expectedResponse, HTTP_CLIENT_HEADERS);
7878

7979
const vulns = await nvd.findOneBySpec(`${packageName}@1.0.0`);
8080
assert.deepStrictEqual(vulns, expectedResponse.vulnerabilities);
8181
});
8282

83-
test(`should send multiple GET http requests to the NVD API using findMany`, async() => {
83+
test("should send multiple GET http requests to the NVD API using findMany", async() => {
8484
const expectedResponse = { vulnerabilities: ["cve-data-1", "cve-data-2"] };
8585

8686
const paramsFirst = new URLSearchParams();
@@ -96,14 +96,14 @@ describe("nvd", () => {
9696
path: `${new URL(nvd.ROOT_API).pathname}?${queryStringFirst}`,
9797
method: "GET"
9898
})
99-
.reply(200, expectedResponse, kHttpClientHeaders);
99+
.reply(200, expectedResponse, HTTP_CLIENT_HEADERS);
100100

101101
mockedHttpClient
102102
.intercept({
103103
path: `${new URL(nvd.ROOT_API).pathname}?${queryStringSecond}`,
104104
method: "GET"
105105
})
106-
.reply(200, expectedResponse, kHttpClientHeaders);
106+
.reply(200, expectedResponse, HTTP_CLIENT_HEADERS);
107107

108108
const result = await nvd.findMany(
109109
["foobar", "yoobar"]
@@ -115,7 +115,7 @@ describe("nvd", () => {
115115
});
116116
});
117117

118-
test(`should handle empty response from NVD API`, async() => {
118+
test("should handle empty response from NVD API", async() => {
119119
const emptyResponse = {};
120120

121121
const params = new URLSearchParams();
@@ -127,7 +127,7 @@ describe("nvd", () => {
127127
path: `${new URL(nvd.ROOT_API).pathname}?${queryString}`,
128128
method: "GET"
129129
})
130-
.reply(200, emptyResponse, kHttpClientHeaders);
130+
.reply(200, emptyResponse, HTTP_CLIENT_HEADERS);
131131

132132
const vulns = await nvd.findOne({
133133
packageName: "nonexistent",

test/database/osv.unit.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import assert from "node:assert";
44

55
// Import Internal Dependencies
66
import {
7-
kHttpClientHeaders,
7+
HTTP_CLIENT_HEADERS,
88
setupHttpAgentMock
99
} from "../strategies/utils";
1010
import { osv } from "../../src/database/index";
@@ -26,7 +26,7 @@ describe("osv", () => {
2626
method: "POST",
2727
body: JSON.stringify({ package: { name: "foobar", ecosystem: "npm" } })
2828
})
29-
.reply(200, expectedResponse, kHttpClientHeaders);
29+
.reply(200, expectedResponse, HTTP_CLIENT_HEADERS);
3030

3131
const vulns = await osv.findOne({
3232
package: {
@@ -51,21 +51,21 @@ describe("osv", () => {
5151
package: { name: packageName, ecosystem: "npm" }
5252
})
5353
})
54-
.reply(200, expectedResponse, kHttpClientHeaders);
54+
.reply(200, expectedResponse, HTTP_CLIENT_HEADERS);
5555

5656
const vulns = await osv.findOneBySpec(`${packageName}@2.0.0`);
5757
assert.strictEqual(vulns, expectedResponse.vulns);
5858
});
5959

60-
test(`should send multiple POST http requests to the OSV API using findMany`, async() => {
60+
test("should send multiple POST http requests to the OSV API using findMany", async() => {
6161
const expectedResponse = { vulns: [1, 2, 3] };
6262

6363
mockedHttpClient
6464
.intercept({
6565
path: new URL("/v1/query", osv.ROOT_API).href,
6666
method: "POST"
6767
})
68-
.reply(200, expectedResponse, kHttpClientHeaders)
68+
.reply(200, expectedResponse, HTTP_CLIENT_HEADERS)
6969
.times(2);
7070

7171
const result = await osv.findMany(

test/database/snyk.unit.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { describe, test, after } from "node:test";
33
import assert from "node:assert";
44

55
// Import Internal Dependencies
6-
import { kHttpClientHeaders, setupHttpAgentMock } from "../strategies/utils";
6+
import { HTTP_CLIENT_HEADERS, setupHttpAgentMock } from "../strategies/utils";
77
import { snyk } from "../../src/database";
88
import { SNYK_ORG } from "../../src/constants";
99

@@ -15,7 +15,7 @@ describe("snyk", () => {
1515
restoreHttpAgent();
1616
});
1717

18-
test(`should send a POST http request to the Snyk API using findOne and then return the SnykAuditResponse`, async() => {
18+
test("should send a POST http request to the Snyk API using findOne and then return the SnykAuditResponse", async() => {
1919
const expectedResponse = { issues: "some issues data" };
2020
const targetFile = "some target file content";
2121
const additionalFile = "some additional file content";
@@ -31,7 +31,7 @@ describe("snyk", () => {
3131
}
3232
})
3333
})
34-
.reply(200, expectedResponse, kHttpClientHeaders);
34+
.reply(200, expectedResponse, HTTP_CLIENT_HEADERS);
3535

3636
const data = await snyk.findOne({
3737
files: {
@@ -43,7 +43,7 @@ describe("snyk", () => {
4343
assert.deepStrictEqual(data, expectedResponse);
4444
});
4545

46-
test(`should send a POST http request to the Snyk API using findOne without additional files`, async() => {
46+
test("should send a POST http request to the Snyk API using findOne without additional files", async() => {
4747
const expectedResponse = { issues: "some issues data" };
4848
const targetFile = "some target file content";
4949

@@ -57,7 +57,7 @@ describe("snyk", () => {
5757
}
5858
})
5959
})
60-
.reply(200, expectedResponse, kHttpClientHeaders);
60+
.reply(200, expectedResponse, HTTP_CLIENT_HEADERS);
6161

6262
const data = await snyk.findOne({
6363
files: { target: { contents: targetFile } }

0 commit comments

Comments
 (0)