Skip to content

Commit

Permalink
cleanup comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cspotcode committed Feb 27, 2021
1 parent c3c5a3e commit 1a06089
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
2 changes: 0 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1065,8 +1065,6 @@ export function create (rawOptions: CreateOptions = {}): Service {
getOutput = (code: string, fileName: string): SourceOutput => {
let result: _ts.TranspileOutput
if (customTranspiler) {
// TODO allow custom transpilers to report diagnostics?
// Or keep it simple and let them throw?
result = customTranspiler.transpile(code, {
fileName
})
Expand Down
8 changes: 0 additions & 8 deletions src/transpilers/swc.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
// TODO
// Rewrite into transpiler factory
// Takes options, returns a transpileModule-equivalent function.
// throw if transpiler specified without transpileOnly
// throw if transpiler specified with transformers
// Create spec for returning diagnostics? Or allow transpiler to throw an error?

import type * as ts from 'typescript'
import type * as swcWasm from '@swc/wasm'
import type * as swcTypes from '@swc/core'
Expand All @@ -17,7 +10,6 @@ export interface SwcTranspilerOptions extends CreateTranspilerOptions {
* Default: '@swc/core', falling back to '@swc/wasm'
*/
swc?: string | typeof swcWasm
// TODO Receive RegisterOptions somehow
}

export function create (createOptions: SwcTranspilerOptions): Transpiler {
Expand Down
3 changes: 3 additions & 0 deletions src/transpilers/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ export interface CreateTranspilerOptions {
service: Pick<Service, 'config' | 'options'>
}
export interface Transpiler {
// TODOs
// Create spec for returning diagnostics? Currently transpilers are allowed to
// throw an error but that's it.
transpile (input: string, options: TranspileOptions): TranspileOutput
}
export interface TranspileOptions {
Expand Down

0 comments on commit 1a06089

Please sign in to comment.