Skip to content

feat: Add .cts to support typescript 4.7 #90

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

Merged
merged 5 commits into from
Jun 29, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Remove non ts-node code
  • Loading branch information
phated committed Jun 29, 2022
commit fd3e4ba457a1e4a2e814518735defc1ec36b9339
30 changes: 1 addition & 29 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ function endsInJsx(filename) {
function endsInTs(filename) {
return filename.endsWith('.ts');
}
function endsInCts(filename) {
return filename.endsWith('.cts');
}
function endsInTsx(filename) {
return filename.endsWith('.tsx');
}
Expand Down Expand Up @@ -428,32 +425,7 @@ var extensions = {
},
},
],
'.cts': [
'ts-node/register',
{
module: '@swc/register',
register: function (hook, config) {
config = config || {
only: [endsInCts],
ignore: [isNodeModules],
jsc: {
parser: {
syntax: 'typescript',
},
},
module: {
type: 'commonjs',
},
};

hook(
Object.assign({}, config, {
extensions: '.cts',
})
);
},
},
],
'.cts': ['ts-node/register'],
'.tsx': [
'ts-node/register',
'sucrase/register/tsx',
Expand Down
5 changes: 0 additions & 5 deletions test/fixtures/cts/1/package.json

This file was deleted.

25 changes: 0 additions & 25 deletions test/fixtures/cts/1/test.cts

This file was deleted.

11 changes: 0 additions & 11 deletions test/fixtures/cts/1/tsconfig.json

This file was deleted.

8 changes: 0 additions & 8 deletions test/fixtures/cts/2/package.json

This file was deleted.

19 changes: 0 additions & 19 deletions test/fixtures/cts/2/test.cts

This file was deleted.

6 changes: 0 additions & 6 deletions test/fixtures/cts/3/package.json

This file was deleted.

13 changes: 0 additions & 13 deletions test/fixtures/cts/3/test.cts

This file was deleted.

6 changes: 0 additions & 6 deletions test/fixtures/cts/4/package.json

This file was deleted.

15 changes: 0 additions & 15 deletions test/fixtures/cts/4/test.cts

This file was deleted.