Skip to content

Commit 60e1689

Browse files
committed
Fix a tslint race condition which happens if the tslint fixing process is launched before tsconfig.json is changed in Native only.
1 parent 7295526 commit 60e1689

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

generator/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ module.exports = async (api, options, rootOptions) => {
238238
});
239239
}
240240

241-
api.onCreateComplete(() => {
241+
api.onCreateComplete(async () => {
242242
// make changes to .gitignore
243243
gitignoreAdditions(api);
244244

@@ -261,17 +261,17 @@ module.exports = async (api, options, rootOptions) => {
261261
}
262262

263263
if (api.hasPlugin('typescript')) {
264+
// we need to edit the tsconfig.json file in /app
265+
// for a Native only project to remove references to /src
266+
await tsconfigSetup(options, genConfig.dirPathPrefix, genConfig.nativeAppPathModifier);
267+
264268
if (fs.existsSync(api.resolve('tslint.json'))) {
265269
const baseDir = genConfig.nativeAppPathModifier;
266270
require('../lib/tslint')({
267-
'_': [`${baseDir}/**/*.ts`, `${baseDir}/**/*.vue`, `${baseDir}/**/*.tsx`, 'tests/**/*.ts', 'tests/**/*.tsx']
271+
'_': [`${baseDir}**/*.ts`, `${baseDir}**/*.vue`, `${baseDir}**/*.tsx`, 'tests/**/*.ts', 'tests/**/*.tsx']
268272
}, api, true);
269273
tslintSetup(genConfig.dirPathPrefix, api.resolve('tslint.json'), genConfig.tsExclusionArray);
270274
}
271-
272-
// we need to edit the tsconfig.json file in /app
273-
// for a Native only project to remove references to /src
274-
tsconfigSetup(options, genConfig.dirPathPrefix, genConfig.nativeAppPathModifier);
275275
}
276276

277277
// the main difference between New and Existing for this section is

0 commit comments

Comments
 (0)