Skip to content

Commit f43350a

Browse files
Merge pull request #27 from msaelices/dev
Some tslint fixes. Fixed the npm run build command
2 parents 61b522a + 2df5c67 commit f43350a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

generator/index.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,11 +266,12 @@ module.exports = async (api, options, rootOptions) => {
266266
await tsconfigSetup(options, genConfig.dirPathPrefix, genConfig.nativeAppPathModifier);
267267

268268
if (fs.existsSync(api.resolve('tslint.json'))) {
269+
await tslintSetup(genConfig.dirPathPrefix, api.resolve('tslint.json'), genConfig.tsExclusionArray);
270+
269271
const baseDir = genConfig.nativeAppPathModifier;
270272
require('../lib/tslint')({
271273
'_': [`${baseDir}**/*.ts`, `${baseDir}**/*.vue`, `${baseDir}**/*.tsx`, 'tests/**/*.ts', 'tests/**/*.tsx']
272-
}, api, true);
273-
tslintSetup(genConfig.dirPathPrefix, api.resolve('tslint.json'), genConfig.tsExclusionArray);
274+
}, api, false);
274275
}
275276
}
276277

@@ -720,7 +721,7 @@ const tslintSetup = (module.exports.tslintSetup = async (dirPathPrefix, tslintPa
720721
// setup tsconfig for native only projects
721722
const tsconfigSetup = (module.exports.tsconfigSetup = async (options, dirPathPrefix, nativeAppPathModifier) => {
722723
try {
723-
// setup the abilty to edit the tsconfig.json file in the root of the project
724+
// setup the ability to edit the tsconfig.json file in the root of the project
724725
let tsConfigContent = '';
725726
let tsConfigPath = path.join(dirPathPrefix, 'tsconfig.json');
726727

@@ -735,6 +736,9 @@ const tsconfigSetup = (module.exports.tsconfigSetup = async (options, dirPathPre
735736
tsConfigContent.compilerOptions.noImplicitAny = false;
736737
// // // tsConfigContent.compilerOptions.types = [];
737738

739+
// edit types attribute to fix build
740+
tsConfigContent.compilerOptions.types = ['node'];
741+
738742
// edit some of the options in compilerOptions.paths object array
739743
tsConfigContent.compilerOptions.paths['@/*'] = [nativeAppPathModifier + '*'];
740744
tsConfigContent.compilerOptions.paths['assets/*'] = [nativeAppPathModifier + 'assets/*'];

0 commit comments

Comments
 (0)