Skip to content

Commit

Permalink
fix(typescript): bump TypeScript version (#818)
Browse files Browse the repository at this point in the history
* chore(typescript): bump TypeScript version

* Revert "feat(typescript): error when no tsconfig and no rootDir (#794)"

This reverts commit cbfd779.
  • Loading branch information
benmccann authored Mar 10, 2021
1 parent f1ad31f commit 4f4c25d
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 91 deletions.
2 changes: 1 addition & 1 deletion packages/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"@types/node": "^10.0.0",
"buble": "^0.20.0",
"rollup": "^2.14.0",
"typescript": "^4.1.2"
"typescript": "^4.2.2"
},
"types": "types/index.d.ts"
}
7 changes: 0 additions & 7 deletions packages/typescript/src/preflight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ ${pluginName}: Rollup requires that TypeScript produces ES Modules. Unfortunatel
"module" other than "esnext". Unless you know what you're doing, please change "module" to "esnext"
in the target tsconfig.json file or plugin options.`.replace(/\n/g, '');

const rootDirErrorMessage = `${pluginName}: The "rootDir" or "rootDirs" option is required when the "tsconfig" option is not specified and "declaration" is "true".`;

const tsLibErrorMessage = `${pluginName}: Could not find module 'tslib', which is required by this plugin. Is it installed?`;

let undef;
Expand All @@ -30,11 +28,6 @@ export const preflight = ({ config, context, rollupOptions, tslib }: PreflightOp
context.warn(moduleErrorMessage);
}

const { options } = config;
if (options.declaration && !options.configFilePath && !options.rootDir && !options.rootDirs) {
context.error(rootDirErrorMessage);
}

if (!rollupOptions.preserveModules && tslib === null) {
context.error(tsLibErrorMessage);
}
Expand Down
25 changes: 0 additions & 25 deletions packages/typescript/test/snapshots/tsconfig.ts.md

This file was deleted.

Binary file removed packages/typescript/test/snapshots/tsconfig.ts.snap
Binary file not shown.
6 changes: 1 addition & 5 deletions packages/typescript/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1020,11 +1020,7 @@ test.serial('picks up on newly included typescript files in watch mode', async (
t.true(usage, 'should contain usage');
});

// TODO: upgrade TypeScript when there is a release containing the fix for this issue
// https://github.com/microsoft/TypeScript/pull/41811. Then enable this test
// More details at https://github.com/rollup/plugins/issues/287. This fails with the message:
// Unexpected token (Note that you need plugins to import files that are not JavaScript)
test.serial.skip('works when code is in src directory', async (t) => {
test.serial('works when code is in src directory', async (t) => {
const bundle = await rollup({
input: 'fixtures/src-dir/src/index.ts',
output: [
Expand Down
50 changes: 0 additions & 50 deletions packages/typescript/test/tsconfig.ts

This file was deleted.

28 changes: 25 additions & 3 deletions pnpm-lock.yaml

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

0 comments on commit 4f4c25d

Please sign in to comment.