From 369057b557e40b4746317bb5209d0012e05bf2ad Mon Sep 17 00:00:00 2001 From: Shinigami92 Date: Wed, 20 Apr 2022 10:21:23 +0200 Subject: [PATCH 1/3] refactor: target es2020 --- tsconfig.json | 2 +- tsconfig.lint.json | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 2e040b1b501..bbb9a361530 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "ES5", + "target": "ES2020", "rootDir": "src", "outDir": "dist", "declaration": true, diff --git a/tsconfig.lint.json b/tsconfig.lint.json index d2bed87be05..1f6fa9f789e 100644 --- a/tsconfig.lint.json +++ b/tsconfig.lint.json @@ -1,5 +1,18 @@ { "compilerOptions": { + "target": "ES2020", + "esModuleInterop": true, + "allowJs": true, + "alwaysStrict": true, + // "strictNullChecks": true, + // "strictBindCallApply": true, + "strictFunctionTypes": true, + // "strictPropertyInitialization": true, + // "noImplicitAny": true, + // "noImplicitThis": true, + "useUnknownInCatchVariables": true, + "stripInternal": true, + "rootDir": ".", "noEmit": true }, From a3f00f4f7506718e9c9edef140d0985fd7080d64 Mon Sep 17 00:00:00 2001 From: Shinigami92 Date: Wed, 20 Apr 2022 10:29:14 +0200 Subject: [PATCH 2/3] build: set moduleResolution to Node --- tsconfig.json | 1 + tsconfig.lint.json | 1 + 2 files changed, 2 insertions(+) diff --git a/tsconfig.json b/tsconfig.json index bbb9a361530..99a90a33f91 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,7 @@ { "compilerOptions": { "target": "ES2020", + "moduleResolution": "Node", "rootDir": "src", "outDir": "dist", "declaration": true, diff --git a/tsconfig.lint.json b/tsconfig.lint.json index 1f6fa9f789e..362d4c3e057 100644 --- a/tsconfig.lint.json +++ b/tsconfig.lint.json @@ -1,6 +1,7 @@ { "compilerOptions": { "target": "ES2020", + "moduleResolution": "Node", "esModuleInterop": true, "allowJs": true, "alwaysStrict": true, From b0f60189d220c58ef80bfa0052d73c8a36930324 Mon Sep 17 00:00:00 2001 From: Shinigami92 Date: Tue, 3 May 2022 20:40:53 +0200 Subject: [PATCH 3/3] fix: lint errors --- scripts/copyMimeTypes.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/scripts/copyMimeTypes.ts b/scripts/copyMimeTypes.ts index 9691070ce58..f56acff973a 100644 --- a/scripts/copyMimeTypes.ts +++ b/scripts/copyMimeTypes.ts @@ -6,7 +6,7 @@ import options from '../.prettierrc.cjs'; const rootPath = path.resolve(__dirname, '..'); const mimeDbPath = path.resolve(rootPath, 'node_modules/mime-db/db.json'); -const mimeDbLicencePath = path.resolve( +const mimeDbLicensePath = path.resolve( rootPath, 'node_modules/mime-db/LICENSE' ); @@ -20,10 +20,8 @@ fs.readFile(mimeDbPath, 'utf8', (err, data) => { throw err; } - const licence = fs.readFileSync(mimeDbLicencePath, { encoding: 'utf8' }); - const mimeTypeFileContent = `// This file is generated by scripts/copyMimeTypes.ts\n// Do not edit this file directly. Instead, update mime-db and run \`pnpm run copy:mime-types\`\n\n/*\n${ - licence as string - }*/\n\nexport default ${data as string};\n`; + const license = fs.readFileSync(mimeDbLicensePath, { encoding: 'utf8' }); + const mimeTypeFileContent = `// This file is generated by scripts/copyMimeTypes.ts\n// Do not edit this file directly. Instead, update mime-db and run \`pnpm run copy:mime-types\`\n\n/*\n${license}*/\n\nexport default ${data};\n`; fs.writeFile( mimeTypesTsPath, @@ -33,7 +31,7 @@ fs.readFile(mimeDbPath, 'utf8', (err, data) => { throw err; } - console.log(`Mime types copied to ${mimeTypesTsPath as string}`); + console.log(`Mime types copied to ${mimeTypesTsPath}`); } ); });