Skip to content

Commit a958224

Browse files
authored
Remove unsupported TS options (facebook#5609)
1 parent 3403f05 commit a958224

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

packages/react-scripts/scripts/utils/verifyTypeScriptSetup.js

+12-4
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,13 @@ function verifyTypeScriptSetup() {
120120
value: 'preserve',
121121
reason: 'JSX is compiled by Babel',
122122
},
123+
// We do not support absolute imports, though this may come as a future
124+
// enhancement
125+
baseUrl: {
126+
value: undefined,
127+
reason: 'absolute imports are not supported (yet)',
128+
},
129+
paths: { value: undefined, reason: 'aliased imports are not supported' },
123130
};
124131

125132
const formatDiagnosticHost = {
@@ -184,22 +191,23 @@ function verifyTypeScriptSetup() {
184191
const { parsedValue, value, suggested, reason } = compilerOptions[option];
185192

186193
const valueToCheck = parsedValue === undefined ? value : parsedValue;
194+
const coloredOption = chalk.cyan('compilerOptions.' + option);
187195

188196
if (suggested != null) {
189197
if (parsedCompilerOptions[option] === undefined) {
190198
appTsConfig.compilerOptions[option] = suggested;
191199
messages.push(
192-
`${chalk.cyan('compilerOptions.' + option)} to be ${chalk.bold(
200+
`${coloredOption} to be ${chalk.bold(
193201
'suggested'
194202
)} value: ${chalk.cyan.bold(suggested)} (this can be changed)`
195203
);
196204
}
197205
} else if (parsedCompilerOptions[option] !== valueToCheck) {
198206
appTsConfig.compilerOptions[option] = value;
199207
messages.push(
200-
`${chalk.cyan('compilerOptions.' + option)} ${chalk.bold(
201-
'must'
202-
)} be ${chalk.cyan.bold(value)}` +
208+
`${coloredOption} ${chalk.bold(
209+
valueToCheck == null ? 'must not' : 'must'
210+
)} be ${valueToCheck == null ? 'set' : chalk.cyan.bold(value)}` +
203211
(reason != null ? ` (${reason})` : '')
204212
);
205213
}

0 commit comments

Comments
 (0)