Skip to content

Commit ac172ca

Browse files
Run lint after installation
1 parent c1c2313 commit ac172ca

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

generator/index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,4 +119,18 @@ module.exports = (api, { addBadges, addLicense, componentName, copyrightHolders,
119119
const licenseText = replaceInLicense(licenseTextTemplate, 'year', year);
120120
files['LICENSE'] = replaceInLicense(licenseText, 'copyright holders', copyrightHolders);
121121
})
122+
123+
api.onCreateComplete(() => {
124+
if (!api.hasPlugin('eslint')) {
125+
return;
126+
}
127+
// Lint generated/modified files
128+
try {
129+
const lint = require('@vue/cli-plugin-eslint/lint');
130+
const files = ['*.js', '.*.js', '*.ts', '*.vue', 'src'];
131+
lint({ silent: true, _: files }, api);
132+
} catch (e) {
133+
api.exitLog('lint not performed', 'warn');
134+
}
135+
})
122136
}

0 commit comments

Comments
 (0)