Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!: target es2020 #848

Merged
merged 7 commits into from
May 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions scripts/copyMimeTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
);
Expand All @@ -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,
Expand All @@ -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}`);
}
);
});
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"compilerOptions": {
"target": "ES5",
Shinigami92 marked this conversation as resolved.
Show resolved Hide resolved
"target": "ES2020",
"moduleResolution": "Node",
"rootDir": "src",
"outDir": "dist",
"declaration": true,
Expand Down
14 changes: 14 additions & 0 deletions tsconfig.lint.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
{
"compilerOptions": {
"target": "ES2020",
"moduleResolution": "Node",
"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
},
Expand Down