Skip to content

Commit 63f6361

Browse files
authored
refactor!: target es2020 (#848)
1 parent 683ee34 commit 63f6361

3 files changed

Lines changed: 20 additions & 7 deletions

File tree

scripts/copyMimeTypes.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import options from '../.prettierrc.cjs';
66

77
const rootPath = path.resolve(__dirname, '..');
88
const mimeDbPath = path.resolve(rootPath, 'node_modules/mime-db/db.json');
9-
const mimeDbLicencePath = path.resolve(
9+
const mimeDbLicensePath = path.resolve(
1010
rootPath,
1111
'node_modules/mime-db/LICENSE'
1212
);
@@ -20,10 +20,8 @@ fs.readFile(mimeDbPath, 'utf8', (err, data) => {
2020
throw err;
2121
}
2222

23-
const licence = fs.readFileSync(mimeDbLicencePath, { encoding: 'utf8' });
24-
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${
25-
licence as string
26-
}*/\n\nexport default ${data as string};\n`;
23+
const license = fs.readFileSync(mimeDbLicensePath, { encoding: 'utf8' });
24+
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`;
2725

2826
fs.writeFile(
2927
mimeTypesTsPath,
@@ -33,7 +31,7 @@ fs.readFile(mimeDbPath, 'utf8', (err, data) => {
3331
throw err;
3432
}
3533

36-
console.log(`Mime types copied to ${mimeTypesTsPath as string}`);
34+
console.log(`Mime types copied to ${mimeTypesTsPath}`);
3735
}
3836
);
3937
});

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"compilerOptions": {
3-
"target": "ES5",
3+
"target": "ES2020",
4+
"moduleResolution": "Node",
45
"rootDir": "src",
56
"outDir": "dist",
67
"declaration": true,

tsconfig.lint.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
{
22
"compilerOptions": {
3+
"target": "ES2020",
4+
"moduleResolution": "Node",
5+
"esModuleInterop": true,
6+
"allowJs": true,
7+
"alwaysStrict": true,
8+
// "strictNullChecks": true,
9+
// "strictBindCallApply": true,
10+
"strictFunctionTypes": true,
11+
// "strictPropertyInitialization": true,
12+
// "noImplicitAny": true,
13+
// "noImplicitThis": true,
14+
"useUnknownInCatchVariables": true,
15+
"stripInternal": true,
16+
317
"rootDir": ".",
418
"noEmit": true
519
},

0 commit comments

Comments
 (0)