Skip to content

Commit 67f2137

Browse files
simon-oharakaisermann
authored andcommitted
fix: rename typescript configuration option to honor the readme docs
1 parent 260a511 commit 67f2137

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/transformers/typescript.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,9 @@ function compileFileFromMemory(compilerOptions, { filename, content }) {
155155

156156
module.exports = ({ content, filename, options }) => {
157157
const fileDirectory = options.tsconfigDirectory || dirname(filename)
158-
const tsconfigPath =
159-
options.tsconfigPath || ts.findConfigFile(fileDirectory, ts.sys.fileExists)
160-
const basePath = tsconfigPath ? dirname(tsconfigPath) : process.cwd()
158+
const tsconfigFile =
159+
options.tsconfigFile || ts.findConfigFile(fileDirectory, ts.sys.fileExists)
160+
const basePath = tsconfigFile ? dirname(tsconfigFile) : process.cwd()
161161

162162
let compilerOptionsJSON = Object.assign(
163163
// default options
@@ -169,8 +169,8 @@ module.exports = ({ content, filename, options }) => {
169169
options.compilerOptions,
170170
)
171171

172-
if (tsconfigPath) {
173-
const { error, config } = ts.readConfigFile(tsconfigPath, ts.sys.readFile)
172+
if (tsconfigFile) {
173+
const { error, config } = ts.readConfigFile(tsconfigFile, ts.sys.readFile)
174174
if (error) {
175175
throw new Error(formatDiagnostics(error, basePath))
176176
}

test/transformers/typescript.test.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ describe('transformer - typescript', () => {
4242
expect(preprocessed.toString()).toContain(EXPECTED_SCRIPT)
4343
})
4444

45-
it('should work with tsconfigPath', async () => {
45+
it('should work with tsconfigFile', async () => {
4646
const opts = getAutoPreprocess({
4747
typescript: {
48-
tsconfigPath: './test/fixtures/tsconfig.json',
48+
tsconfigFile: './test/fixtures/tsconfig.json',
4949
},
5050
})
5151
const preprocessed = await preprocess(template, opts)
@@ -55,7 +55,7 @@ describe('transformer - typescript', () => {
5555
it('should report config syntactic errors in tsconfig file', () => {
5656
const opts = getAutoPreprocess({
5757
typescript: {
58-
tsconfigPath: './test/fixtures/tsconfig.syntactic.json',
58+
tsconfigFile: './test/fixtures/tsconfig.syntactic.json',
5959
},
6060
})
6161
return expect(preprocess(template, opts)).rejects.toThrow('TS1005')
@@ -64,7 +64,7 @@ describe('transformer - typescript', () => {
6464
it('should report config semantic errors in tsconfig file', () => {
6565
const opts = getAutoPreprocess({
6666
typescript: {
67-
tsconfigPath: './test/fixtures/tsconfig.semantic.json',
67+
tsconfigFile: './test/fixtures/tsconfig.semantic.json',
6868
},
6969
})
7070
return expect(preprocess(template, opts)).rejects.toThrow('TS6046')

0 commit comments

Comments
 (0)