Skip to content

Commit

Permalink
chore: replace @tsconfig/node14 with @tsconfig/node18 and `@tscon…
Browse files Browse the repository at this point in the history
…fig/strictest` (#270)
  • Loading branch information
JamieMagee authored Apr 1, 2023
1 parent 8d01e12 commit 8e99a29
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 16 deletions.
21 changes: 18 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
},
"devDependencies": {
"@qiwi/multi-semantic-release": "6.5.1",
"@tsconfig/node14": "1.0.3",
"@tsconfig/node18": "1.0.1",
"@tsconfig/strictest": "1.0.2",
"@types/eslint": "8.21.3",
"@types/jest": "29.5.0",
"@typescript-eslint/eslint-plugin": "5.56.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/osv-offline-db/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"@seald-io/nedb": "^4.0.1"
},
"devDependencies": {
"@tsconfig/node14": "1.0.3",
"@tsconfig/node18": "1.0.1",
"@tsconfig/strictest": "1.0.2",
"@types/node": "18.15.8",
"prettier": "2.8.7",
"ts-node": "10.9.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/osv-offline-db/src/lib/db.int.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { OsvOfflineDb } from './db';
import fs from 'fs-extra';
import path from 'path';
import { Vulnerability } from './osv';
import type { Vulnerability } from './osv';

describe('lib/db', () => {
let osvOfflineDb: OsvOfflineDb;
Expand Down
4 changes: 2 additions & 2 deletions packages/osv-offline-db/src/lib/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { tmpdir } from 'os';
import path from 'path';
import Datastore from '@seald-io/nedb';
import { Ecosystem, ecosystems } from './ecosystem';
import { Vulnerability } from './osv';
import { Osv } from '..';
import type { Vulnerability } from './osv';
import type { Osv } from '..';
import { packageToPurl } from './purl-helper';

export class OsvOfflineDb {
Expand Down
2 changes: 1 addition & 1 deletion packages/osv-offline-db/src/lib/purl-helper.unit.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { packageToPurl } from './purl-helper';
import { Ecosystem } from './ecosystem';
import type { Ecosystem } from './ecosystem';

describe('lib/purl-helper', () => {
describe('test ecosystems', () => {
Expand Down
3 changes: 2 additions & 1 deletion packages/osv-offline-updater/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"signale": "1.4.0"
},
"devDependencies": {
"@tsconfig/node14": "1.0.3",
"@tsconfig/node18": "1.0.1",
"@tsconfig/strictest": "1.0.2",
"@types/adm-zip": "0.5.0",
"@types/fs-extra": "11.0.1",
"@types/luxon": "3.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/osv-offline-updater/src/client/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class GitHub {

constructor() {
this.octokit = new Octokit({
auth: process.env.GITHUB_TOKEN,
auth: process.env['GITHUB_TOKEN'],
});
}

Expand Down
2 changes: 1 addition & 1 deletion packages/osv-offline-updater/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ async function deleteIfExists(path: string): Promise<void> {

const zipFile = zip.toBuffer();

if (process.env.GITHUB_TOKEN) {
if (process.env['GITHUB_TOKEN']) {
signale.info('Uploading databases');
const gh = new GitHub();
await gh.uploadDatabase(zipFile);
Expand Down
2 changes: 1 addition & 1 deletion packages/osv-offline/src/lib/download.int.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('lib/download', () => {
});

it('skips download in case of invalid GitHub token', async () => {
process.env.GITHUB_COM_TOKEN = 'some-token';
process.env['GITHUB_COM_TOKEN'] = 'some-token';

await expect(tryDownloadDb()).resolves.toBeFalse();
});
Expand Down
2 changes: 1 addition & 1 deletion packages/osv-offline/src/lib/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export async function tryDownloadDb(): Promise<boolean> {
return true;
}

const octokitOptions = { auth: process.env.GITHUB_COM_TOKEN, request: { fetch } };
const octokitOptions = { auth: process.env['GITHUB_COM_TOKEN'], request: { fetch } };

let latestRelease = null;
try {
Expand Down
5 changes: 3 additions & 2 deletions tsconfig.packages.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"extends": "@tsconfig/node14/tsconfig.json",
"extends": ["@tsconfig/strictest/tsconfig", "@tsconfig/node18/tsconfig"],
"compilerOptions": {
"esModuleInterop": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"composite": true,
"types": ["node", "jest", "jest-extended", "expect-more-jest"]
"types": ["node", "jest", "jest-extended", "expect-more-jest"],
"ignoreDeprecations": "5.0"
}
}

0 comments on commit 8e99a29

Please sign in to comment.