1 |
|
2 |
|
3 |
|
4 | const { chalk, hasGit } = require('@vue/cli-shared-utils')
|
5 |
|
6 | const prompts = module.exports = [
|
7 | {
|
8 | name: `classComponent`,
|
9 | type: `confirm`,
|
10 | message: `Use class-style component syntax?`,
|
11 | default: true
|
12 | },
|
13 | {
|
14 | name: `useTsWithBabel`,
|
15 | type: `confirm`,
|
16 | message: 'Use Babel alongside TypeScript (required for modern mode, auto-detected polyfills, transpiling JSX)?'
|
17 | },
|
18 | {
|
19 | name: `lint`,
|
20 | type: `confirm`,
|
21 | message: `Use TSLint?`
|
22 | },
|
23 | {
|
24 | name: `lintOn`,
|
25 | type: `checkbox`,
|
26 | when: answers => answers.lint,
|
27 | message: `Pick lint features:`,
|
28 | choices: [
|
29 | {
|
30 | name: 'Lint on save',
|
31 | value: 'save',
|
32 | checked: true
|
33 | },
|
34 | {
|
35 | name: 'Lint and fix on commit' + (hasGit() ? '' : chalk.red(' (requires Git)')),
|
36 | value: 'commit'
|
37 | }
|
38 | ]
|
39 | },
|
40 | {
|
41 | name: `convertJsToTs`,
|
42 | type: `confirm`,
|
43 | message: `Convert all .js files to .ts?`,
|
44 | default: true
|
45 | },
|
46 | {
|
47 | name: `allowJs`,
|
48 | type: `confirm`,
|
49 | message: `Allow .js files to be compiled?`,
|
50 | default: false
|
51 | },
|
52 | {
|
53 | name: 'skipLibCheck',
|
54 | type: `confirm`,
|
55 | message: `Skip type checking of all declaration files (recommended for apps)?`,
|
56 | default: true
|
57 | }
|
58 | ]
|
59 |
|
60 |
|
61 |
|
62 |
|
63 | module.exports.getPrompts = pkg => {
|
64 | prompts[2].when = () => !('@vue/cli-plugin-eslint' in (pkg.devDependencies || {}))
|
65 | return prompts
|
66 | }
|