diff --git a/packages/@vue/cli-plugin-typescript/lib/tslint.js b/packages/@vue/cli-plugin-typescript/lib/tslint.js index 1d34f90a70..8241a14af3 100644 --- a/packages/@vue/cli-plugin-typescript/lib/tslint.js +++ b/packages/@vue/cli-plugin-typescript/lib/tslint.js @@ -80,7 +80,9 @@ module.exports = function lint (args = {}, api, silent) { patchProgram(this.program) } - const tslintConfigPath = api.resolve('tslint.json') + const tslintConfigPath = tslint.Configuration.CONFIG_FILENAMES + .map(filename => api.resolve(filename)) + .find(file => fs.existsSync(file)) const config = tslint.Configuration.findConfiguration(tslintConfigPath).results // create a patched config that disables the blank lines rule, @@ -113,7 +115,7 @@ module.exports = function lint (args = {}, api, silent) { // respect linterOptions.exclude from tslint.json if (config.linterOptions && config.linterOptions.exclude) { // use the raw tslint.json data because config contains absolute paths - const rawTslintConfig = JSON.parse(fs.readFileSync(tslintConfigPath, 'utf-8')) + const rawTslintConfig = tslint.Configuration.readConfigurationFile(tslintConfigPath) const excludedGlobs = rawTslintConfig.linterOptions.exclude excludedGlobs.forEach((g) => files.push('!' + g)) }