create-quasar 1.10.1 → 1.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/package.json +3 -3
  2. package/templates/app/quasar-v2/index.js +4 -4
  3. package/templates/app/quasar-v2/js-vite-1/BASE/quasar.config.js +0 -1
  4. package/templates/app/quasar-v2/js-vite-2/.eslintrc.cjs +1 -1
  5. package/templates/app/quasar-v2/js-vite-2/BASE/README.md +3 -4
  6. package/templates/app/quasar-v2/js-vite-2/BASE/_.editorconfig +2 -4
  7. package/templates/app/quasar-v2/js-vite-2/BASE/_.vscode/extensions.json +2 -2
  8. package/templates/app/quasar-v2/js-vite-2/BASE/_.vscode/settings.json +2 -2
  9. package/templates/app/quasar-v2/js-vite-2/BASE/_package.json +15 -21
  10. package/templates/app/quasar-v2/js-vite-2/BASE/postcss.config.js +0 -1
  11. package/templates/app/quasar-v2/js-vite-2/BASE/quasar.config.js +22 -17
  12. package/templates/app/quasar-v2/js-vite-2/eslint/_eslint.config.js +73 -0
  13. package/templates/app/quasar-v2/js-vite-2/index.js +11 -10
  14. package/templates/app/quasar-v2/js-vite-2/pinia/src/stores/example-store.js +13 -7
  15. package/templates/app/quasar-v2/js-vite-2/prettier/_.prettierrc.json +6 -0
  16. package/templates/app/quasar-v2/js-webpack-4/.eslintrc.cjs +1 -1
  17. package/templates/app/quasar-v2/js-webpack-4/BASE/README.md +3 -4
  18. package/templates/app/quasar-v2/js-webpack-4/BASE/_.editorconfig +2 -4
  19. package/templates/app/quasar-v2/js-webpack-4/BASE/_.vscode/extensions.json +2 -2
  20. package/templates/app/quasar-v2/js-webpack-4/BASE/_.vscode/settings.json +2 -2
  21. package/templates/app/quasar-v2/js-webpack-4/BASE/_package.json +17 -22
  22. package/templates/app/quasar-v2/js-webpack-4/BASE/{babel.config.cjs → babel.config.js} +1 -3
  23. package/templates/app/quasar-v2/js-webpack-4/BASE/{postcss.config.cjs → postcss.config.js} +3 -3
  24. package/templates/app/quasar-v2/js-webpack-4/BASE/quasar.config.js +18 -21
  25. package/templates/app/quasar-v2/js-webpack-4/BASE/src/router/index.js +1 -1
  26. package/templates/app/quasar-v2/js-webpack-4/eslint/_eslint.config.js +73 -0
  27. package/templates/app/quasar-v2/js-webpack-4/i18n/src/i18n/index.js +1 -1
  28. package/templates/app/quasar-v2/js-webpack-4/index.js +11 -10
  29. package/templates/app/quasar-v2/js-webpack-4/prettier/_.prettierrc.json +6 -0
  30. package/templates/app/quasar-v2/ts-vite-1/BASE/quasar.config.js +0 -1
  31. package/templates/app/quasar-v2/ts-vite-2/.eslintrc.cjs +1 -1
  32. package/templates/app/quasar-v2/ts-vite-2/BASE/README.md +3 -4
  33. package/templates/app/quasar-v2/ts-vite-2/BASE/_.editorconfig +2 -4
  34. package/templates/app/quasar-v2/ts-vite-2/BASE/_.vscode/extensions.json +2 -2
  35. package/templates/app/quasar-v2/ts-vite-2/BASE/_.vscode/settings.json +2 -2
  36. package/templates/app/quasar-v2/ts-vite-2/BASE/_package.json +16 -23
  37. package/templates/app/quasar-v2/ts-vite-2/BASE/postcss.config.js +0 -1
  38. package/templates/app/quasar-v2/ts-vite-2/BASE/quasar.config.ts +21 -17
  39. package/templates/app/quasar-v2/ts-vite-2/BASE/src/env.d.ts +0 -2
  40. package/templates/app/quasar-v2/ts-vite-2/eslint/_eslint.config.js +94 -0
  41. package/templates/app/quasar-v2/ts-vite-2/i18n/src/boot/i18n.ts +3 -3
  42. package/templates/app/quasar-v2/ts-vite-2/index.js +11 -16
  43. package/templates/app/quasar-v2/ts-vite-2/pinia/src/stores/example-store.ts +7 -1
  44. package/templates/app/quasar-v2/ts-vite-2/prettier/_.prettierrc.json +6 -0
  45. package/templates/app/quasar-v2/ts-webpack-4/.eslintrc.cjs +1 -1
  46. package/templates/app/quasar-v2/ts-webpack-4/BASE/README.md +3 -4
  47. package/templates/app/quasar-v2/ts-webpack-4/BASE/_.editorconfig +2 -4
  48. package/templates/app/quasar-v2/ts-webpack-4/BASE/_.vscode/extensions.json +2 -2
  49. package/templates/app/quasar-v2/ts-webpack-4/BASE/_.vscode/settings.json +2 -2
  50. package/templates/app/quasar-v2/ts-webpack-4/BASE/_package.json +19 -24
  51. package/templates/app/quasar-v2/ts-webpack-4/BASE/babel.config.cjs +0 -2
  52. package/templates/app/quasar-v2/ts-webpack-4/BASE/postcss.config.cjs +0 -1
  53. package/templates/app/quasar-v2/ts-webpack-4/BASE/quasar.config.ts +11 -13
  54. package/templates/app/quasar-v2/ts-webpack-4/BASE/src/env.d.ts +0 -2
  55. package/templates/app/quasar-v2/ts-webpack-4/eslint/_eslint.config.js +94 -0
  56. package/templates/app/quasar-v2/ts-webpack-4/i18n/src/boot/i18n.ts +3 -3
  57. package/templates/app/quasar-v2/ts-webpack-4/index.js +11 -16
  58. package/templates/app/quasar-v2/ts-webpack-4/prettier/_.prettierrc.json +6 -0
  59. package/templates/app-extension/ae-ts/BASE/app-extension/_package.json +4 -4
  60. package/templates/app-extension/ae-ts/BASE/app-extension/src/index.ts +2 -2
  61. package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-vite/_package.json +1 -1
  62. package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-vite/quasar.config.ts +8 -0
  63. package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-webpack/_package.json +1 -1
  64. package/templates/app-extension/ae-ts/install-script/app-extension/src/install.ts +2 -2
  65. package/templates/ui-kit/quasar-v2/ae/app-extension/src/index.js +2 -2
  66. package/templates/ui-kit/quasar-v2/ae-install/app-extension/src/install.js +2 -2
  67. package/utils/index.js +2 -2
  68. package/templates/app/quasar-v2/js-vite-2/lint/_.eslintignore +0 -7
  69. package/templates/app/quasar-v2/js-vite-2/lint/_.eslintrc.cjs +0 -100
  70. package/templates/app/quasar-v2/js-vite-2/pinia/src/stores/store-flag.d.ts +0 -13
  71. package/templates/app/quasar-v2/js-webpack-4/lint/_.eslintignore +0 -8
  72. package/templates/app/quasar-v2/js-webpack-4/lint/_.eslintrc.cjs +0 -101
  73. package/templates/app/quasar-v2/ts-vite-2/lint/_.eslintignore +0 -7
  74. package/templates/app/quasar-v2/ts-vite-2/lint/_.eslintrc.cjs +0 -135
  75. package/templates/app/quasar-v2/ts-vite-2/prettier/_.prettierrc +0 -4
  76. package/templates/app/quasar-v2/ts-webpack-4/lint/_.eslintignore +0 -8
  77. package/templates/app/quasar-v2/ts-webpack-4/lint/_.eslintrc.cjs +0 -139
  78. package/templates/app/quasar-v2/ts-webpack-4/prettier/_.prettierrc +0 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-quasar",
3
- "version": "1.10.1",
3
+ "version": "1.11.0",
4
4
  "description": "Scaffolds Quasar Apps, AppExtensions or UI kits",
5
5
  "type": "module",
6
6
  "author": {
@@ -27,12 +27,12 @@
27
27
  "node": ">=16"
28
28
  },
29
29
  "dependencies": {
30
- "fast-glob": "^3.3.2",
31
30
  "fs-extra": "^11.2.0",
32
31
  "kolorist": "^1.8.0",
33
32
  "lodash": "^4.17.21",
34
33
  "minimist": "^1.2.8",
35
- "prompts": "^2.4.2"
34
+ "prompts": "^2.4.2",
35
+ "tinyglobby": "^0.2.10"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/lodash": "^4.17.7",
@@ -6,10 +6,10 @@ export async function script ({ scope, utils }) {
6
6
  message: 'Pick Quasar App CLI variant:',
7
7
  initial: 0,
8
8
  choices: [
9
- { title: 'Quasar App CLI with Vite 2 (stable | v1)', value: 'vite-1', description: 'recommended' },
10
- { title: 'Quasar App CLI with Vite 6 (Release Candidate | next major version - v2)', value: 'vite-2' },
11
- { title: 'Quasar App CLI with Webpack (stable | v3)', value: 'webpack-3' },
12
- { title: 'Quasar App CLI with Webpack (Release Candidate | next major version - v4)', value: 'webpack-4' }
9
+ { title: 'Quasar App CLI with Vite 6 (v2)', value: 'vite-2', description: 'recommended' },
10
+ { title: 'Quasar App CLI with Webpack (v4)', value: 'webpack-4' },
11
+ { title: '[Legacy] Quasar App CLI with Vite 2 (v1)', value: 'vite-1' },
12
+ { title: '[Legacy] Quasar App CLI with Webpack (v3)', value: 'webpack-3' }
13
13
  ]
14
14
  },
15
15
  {
@@ -137,7 +137,6 @@ module.exports = configure(function (/* ctx */) {
137
137
  // https://v2.quasar.dev/quasar-cli-vite/developing-ssr/configuring-ssr
138
138
  ssr: {
139
139
  // ssrPwaHtmlFilename: 'offline.html', // do NOT use index.html as name!
140
- // will mess up SSR
141
140
 
142
141
  // extendSSRWebserverConf (esbuildConf) {},
143
142
  // extendPackageJson (json) {},
@@ -18,7 +18,7 @@ module.exports = {
18
18
  // Quasar v2 - JS
19
19
  'css',
20
20
  'preset',
21
- 'lintConfig'
21
+ 'prettier'
22
22
  ]
23
23
  }
24
24
  }
@@ -13,7 +13,7 @@ npm install
13
13
  ```bash
14
14
  quasar dev
15
15
  ```
16
- <% if (preset.lint) { %>
16
+ <% if (preset.eslint) { %>
17
17
 
18
18
  ### Lint the files
19
19
  ```bash
@@ -21,7 +21,7 @@ yarn lint
21
21
  # or
22
22
  npm run lint
23
23
  ```
24
- <% if (lintConfig === 'prettier') { %>
24
+ <% if (prettier) { %>
25
25
 
26
26
  ### Format the files
27
27
  ```bash
@@ -29,8 +29,7 @@ yarn format
29
29
  # or
30
30
  npm run format
31
31
  ```
32
- <% } %>
33
- <% } %>
32
+ <% } } %>
34
33
 
35
34
  ### Build the app for production
36
35
  ```bash
@@ -1,9 +1,7 @@
1
- root = true
2
-
3
- [*]
1
+ [*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue}]
4
2
  charset = utf-8
5
- indent_style = space
6
3
  indent_size = 2
4
+ indent_style = space
7
5
  end_of_line = lf
8
6
  insert_final_newline = true
9
7
  trim_trailing_whitespace = true
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "recommendations": [
3
- <% if (preset.lint) { %>"dbaeumer.vscode-eslint",
4
- <% if (lintConfig === 'prettier') { %>"esbenp.prettier-vscode",<% } } %>
3
+ <% if (preset.eslint) { %>"dbaeumer.vscode-eslint",<% } %>
4
+ <% if (prettier) { %>"esbenp.prettier-vscode",<% } %>
5
5
  "editorconfig.editorconfig",
6
6
  "vue.volar",
7
7
  "wayou.vscode-todo-highlight"
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "editor.bracketPairColorization.enabled": true,
3
- "editor.guides.bracketPairs": true<% if (preset.lint) { %>,
3
+ "editor.guides.bracketPairs": true<% if (preset.eslint) { %>,
4
4
  "editor.formatOnSave": true,
5
- "editor.defaultFormatter": <% if (lintConfig === 'prettier') { %>"esbenp.prettier-vscode"<% } else { %>"dbaeumer.vscode-eslint"<% } %>,
5
+ "editor.defaultFormatter": <% if (prettier) { %>"esbenp.prettier-vscode"<% } else { %>"dbaeumer.vscode-eslint"<% } %>,
6
6
  "editor.codeActionsOnSave": [
7
7
  "source.fixAll.eslint"
8
8
  ],
@@ -7,9 +7,8 @@
7
7
  "type": "module",
8
8
  "private": true,
9
9
  "scripts": {
10
- <% if (preset.lint) { %>"lint": "eslint --ext .js,.vue ./",
11
- <% if (lintConfig === 'prettier') { %>"format": "prettier --write \"**/*.{js,vue<% if (css !== 'sass') { %>,<%= css %><% } %>,html,md,json}\" --ignore-path .gitignore",<% } %>
12
- <% } %>
10
+ <% if (preset.eslint) { %>"lint": "eslint -c ./eslint.config.js './src*/**/*.{js,cjs,mjs,vue}'",<% } %>
11
+ <% if (prettier) { %>"format": "prettier --write \"**/*.{js,vue<% if (css !== 'sass') { %>,<%= css %><% } %>,html,md,json}\" --ignore-path .gitignore",<% } %>
13
12
  "test": "echo \"No test specified\" && exit 0",
14
13
  "dev": "quasar dev",
15
14
  "build": "quasar build",
@@ -25,29 +24,24 @@
25
24
  "vue-router": "^4.0.0"
26
25
  },
27
26
  "devDependencies": {
28
- <% if (preset.lint) { %>
29
- "vite-plugin-checker": "^0.8.0",
30
- "eslint": "^8.57.0",
31
- "eslint-plugin-vue": "^9.0.0",
32
- <% if (lintConfig === 'standard') { %>
33
- "eslint-config-standard": "^17.0.0",
34
- "eslint-plugin-import": "^2.19.1",
35
- "eslint-plugin-n": "^15.0.0",
36
- "eslint-plugin-promise": "^6.0.0",
37
- <% } else if (lintConfig === 'airbnb') { %>
38
- "eslint-config-airbnb-base": "^15.0.0",
39
- "eslint-plugin-import": "^2.20.1",
40
- <% } else if (lintConfig === 'prettier') { %>
41
- "eslint-config-prettier": "^9.0.0",
42
- "prettier": "^3.0.3",
43
- <% } } %>
44
27
  <% if (preset.i18n) { %>"@intlify/unplugin-vue-i18n": "^2.0.0",<% } %>
45
- "@quasar/app-vite": "^2.0.0-rc.1",
28
+ <% if (preset.eslint) { %>
29
+ "@eslint/js": "^9.14.0",
30
+ "eslint": "^9.14.0",
31
+ "eslint-plugin-vue": "^9.30.0",
32
+ "globals": "^15.12.0",
33
+ "vite-plugin-checker": "^0.8.0",
34
+ <% } %>
35
+ <% if (prettier) { %>
36
+ "@vue/eslint-config-prettier": "^10.1.0",
37
+ "prettier": "^3.3.3",
38
+ <% } %>
39
+ "@quasar/app-vite": "^2.0.0",
46
40
  "autoprefixer": "^10.4.2",
47
41
  "postcss": "^8.4.14"
48
42
  },
49
43
  "engines": {
50
- "node": "^24 || ^22 || ^20 || ^18",
44
+ "node": "^28 || ^26 || ^24 || ^22 || ^20 || ^18",
51
45
  "npm": ">= 6.13.4",
52
46
  "yarn": ">= 1.21.1"
53
47
  }
@@ -1,4 +1,3 @@
1
- /* eslint-disable */
2
1
  // https://github.com/michael-ciniawsky/postcss-load-config
3
2
 
4
3
  import autoprefixer from 'autoprefixer'
@@ -1,12 +1,8 @@
1
- /* eslint-env node */
2
-
3
1
  // Configuration for your app
4
2
  // https://v2.quasar.dev/quasar-cli-vite/quasar-config-js
5
3
 
6
- <% if (preset.lint && lintConfig === 'airbnb') { %>/* eslint func-names: 0 */
7
- /* eslint global-require: 0 */<% } %>
8
- import { defineConfig } from '#q-app/wrappers'
9
- <% if (preset.i18n) { %>import { fileURLToPath } from 'node:url';<% } %>
4
+ import { defineConfig } from '#q-app/wrappers'<% if (preset.i18n) { %>
5
+ import { fileURLToPath } from 'node:url'<% } %>
10
6
 
11
7
  export default defineConfig((<% if (preset.i18n) { %>ctx<% } else { %>/* ctx */<% } %>) => {
12
8
  return {
@@ -16,9 +12,9 @@ export default defineConfig((<% if (preset.i18n) { %>ctx<% } else { %>/* ctx */<
16
12
  // app boot file (/src/boot)
17
13
  // --> boot files are part of "main.js"
18
14
  // https://v2.quasar.dev/quasar-cli-vite/boot-files
19
- boot: [
20
- <% if (preset.i18n) { %>'i18n',<% } %>
21
- <% if (preset.axios) { %>'axios',<% } %>
15
+ boot: [<% if (preset.i18n) { %>
16
+ 'i18n'<% } %><% if (preset.axios) { %><%= preset.i18n ? ',' : '' %>
17
+ 'axios'<% } %>
22
18
  ],
23
19
 
24
20
  // https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#css
@@ -65,8 +61,8 @@ export default defineConfig((<% if (preset.i18n) { %>ctx<% } else { %>/* ctx */<
65
61
 
66
62
  // extendViteConf (viteConf) {},
67
63
  // viteVuePluginOptions: {},
68
-
69
- <% if (preset.i18n || preset.lint) { %>vitePlugins: [<% if (preset.i18n) { %>
64
+ <% if (preset.i18n || preset.eslint) { %>
65
+ vitePlugins: [<% if (preset.i18n) { %>
70
66
  ['@intlify/unplugin-vue-i18n/vite', {
71
67
  // if you want to use Vue I18n Legacy API, you need to set `compositionOnly: false`
72
68
  // compositionOnly: false,
@@ -78,11 +74,13 @@ export default defineConfig((<% if (preset.i18n) { %>ctx<% } else { %>/* ctx */<
78
74
  ssr: ctx.modeName === 'ssr',
79
75
 
80
76
  // you need to set i18n resource including paths !
81
- include: [ fileURLToPath(new URL('./src/i18n', import.meta.url)) ],
82
- }]<% } %><% if (preset.lint) { %><% if (preset.i18n) { %>,<% } %>
77
+ include: [ fileURLToPath(new URL('./src/i18n', import.meta.url)) ]
78
+ }]<% } %><% if (preset.eslint) { %><% if (preset.i18n) { %>,
79
+ <% } %>
83
80
  ['vite-plugin-checker', {
84
81
  eslint: {
85
- lintCommand: 'eslint "./**/*.{js,mjs,cjs,vue}"'
82
+ lintCommand: 'eslint -c ./eslint.config.js "./src*/**/*.{js,mjs,cjs,vue}"',
83
+ useFlatConfig: true
86
84
  }
87
85
  }, { server: false }]<% } %>
88
86
  ]<% } else { %>
@@ -93,7 +91,7 @@ export default defineConfig((<% if (preset.i18n) { %>ctx<% } else { %>/* ctx */<
93
91
 
94
92
  // Full list of options: https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#devServer
95
93
  devServer: {
96
- // https: true
94
+ // https: true,
97
95
  open: true // opens browser window automatically
98
96
  },
99
97
 
@@ -150,7 +148,6 @@ export default defineConfig((<% if (preset.i18n) { %>ctx<% } else { %>/* ctx */<
150
148
  // manualPostHydrationTrigger: true,
151
149
 
152
150
  pwa: false
153
-
154
151
  // pwaOfflineHtmlFilename: 'offline.html', // do NOT use index.html as name!
155
152
 
156
153
  // pwaExtendGenerateSWOptions (cfg) {},
@@ -220,7 +217,15 @@ export default defineConfig((<% if (preset.i18n) { %>ctx<% } else { %>/* ctx */<
220
217
  // extendBexScriptsConf (esbuildConf) {},
221
218
  // extendBexManifestJson (json) {},
222
219
 
220
+ /**
221
+ * The list of extra scripts (js/ts) not in your bex manifest that you want to
222
+ * compile and use in your browser extension. Maybe dynamic use them?
223
+ *
224
+ * Each entry in the list should be a relative filename to /src-bex/
225
+ *
226
+ * @example [ 'my-script.ts', 'sub-folder/my-other-script.js' ]
227
+ */
223
228
  extraScripts: []
224
229
  }
225
230
  }
226
- });
231
+ })
@@ -0,0 +1,73 @@
1
+ import js from '@eslint/js'
2
+ import globals from 'globals'
3
+ import pluginVue from 'eslint-plugin-vue'
4
+ import pluginQuasar from '@quasar/app-vite/eslint'<% if (prettier) { %>
5
+ import prettierSkipFormatting from '@vue/eslint-config-prettier/skip-formatting'<% } %>
6
+
7
+ export default [
8
+ {
9
+ /**
10
+ * Ignore the following files.
11
+ * Please note that pluginQuasar.configs.recommended already ignores
12
+ * the "node_modules" folder for you (and all other Quasar project
13
+ * relevant folders and files).
14
+ *
15
+ * ESLint requires "ignores" key to be the only one in this object
16
+ */
17
+ // ignores: []
18
+ },
19
+
20
+ ...pluginQuasar.configs.recommended(),
21
+ js.configs.recommended,
22
+
23
+ /**
24
+ * https://eslint.vuejs.org
25
+ *
26
+ * pluginVue.configs.base
27
+ * -> Settings and rules to enable correct ESLint parsing.
28
+ * pluginVue.configs[ 'flat/essential']
29
+ * -> base, plus rules to prevent errors or unintended behavior.
30
+ * pluginVue.configs["flat/strongly-recommended"]
31
+ * -> Above, plus rules to considerably improve code readability and/or dev experience.
32
+ * pluginVue.configs["flat/recommended"]
33
+ * -> Above, plus rules to enforce subjective community defaults to ensure consistency.
34
+ */
35
+ ...pluginVue.configs[ 'flat/essential' ],
36
+
37
+ {
38
+ languageOptions: {
39
+ ecmaVersion: 'latest',
40
+ sourceType: 'module',
41
+
42
+ globals: {
43
+ ...globals.browser,
44
+ ...globals.node, // SSR, Electron, config files
45
+ process: 'readonly', // process.env.*
46
+ ga: 'readonly', // Google Analytics
47
+ cordova: 'readonly',
48
+ Capacitor: 'readonly',
49
+ chrome: 'readonly', // BEX related
50
+ browser: 'readonly' // BEX related
51
+ }
52
+ },
53
+
54
+ // add your custom rules here
55
+ rules: {
56
+ 'prefer-promise-reject-errors': 'off',
57
+
58
+ // allow debugger during development only
59
+ 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
60
+ }
61
+ },
62
+
63
+ {
64
+ files: [ 'src-pwa/custom-service-worker.js' ],
65
+ languageOptions: {
66
+ globals: {
67
+ ...globals.serviceworker
68
+ }
69
+ }
70
+ }<% if (prettier) { %>,
71
+
72
+ prettierSkipFormatting<% } %>
73
+ ]
@@ -5,7 +5,7 @@ export async function script ({ scope, utils }) {
5
5
  name: 'preset',
6
6
  message: 'Check the features needed for your project:',
7
7
  choices: [
8
- { title: 'Linting (vite-plugin-checker + ESLint)', value: 'lint', description: 'recommended', selected: true },
8
+ { title: 'Linting (vite-plugin-checker + ESLint)', value: 'eslint', description: 'recommended', selected: true },
9
9
  { title: 'State Management (Pinia)', value: 'pinia', description: 'https://pinia.vuejs.org' },
10
10
  { title: 'axios', value: 'axios' },
11
11
  { title: 'vue-i18n', value: 'i18n' }
@@ -13,23 +13,24 @@ export async function script ({ scope, utils }) {
13
13
  format: utils.convertArrayToObject
14
14
  },
15
15
  {
16
- type: (_, { preset }) => (preset.lint ? 'select' : null),
17
- name: 'lintConfig',
18
- message: 'Pick an ESLint preset:',
19
- choices: [
20
- { title: 'Prettier', value: 'prettier', description: 'https://github.com/prettier/prettier' },
21
- { title: 'Standard', value: 'standard', description: 'https://github.com/standard/standard' },
22
- { title: 'Airbnb', value: 'airbnb', description: 'https://github.com/airbnb/javascript' }
23
- ]
16
+ type: (_, { preset }) => (preset.eslint ? 'confirm' : null),
17
+ name: 'prettier',
18
+ initial: true,
19
+ message: 'Add Prettier for code formatting?'
24
20
  }
25
21
  ])
26
22
 
23
+ // ensure it's defined since if not selecting ESLint,
24
+ // user won't be asked about it hence it won't be defined
25
+ scope.prettier = scope.prettier || false
26
+
27
27
  utils.createTargetDir(scope)
28
28
  utils.renderTemplate('BASE', scope)
29
29
  utils.renderTemplate(scope.css, scope)
30
30
 
31
31
  if (scope.preset.axios) utils.renderTemplate('axios', scope)
32
32
  if (scope.preset.i18n) utils.renderTemplate('i18n', scope)
33
- if (scope.preset.lint) utils.renderTemplate('lint', scope)
33
+ if (scope.preset.eslint) utils.renderTemplate('eslint', scope)
34
+ if (scope.prettier) utils.renderTemplate('prettier', scope)
34
35
  if (scope.preset.pinia) utils.renderTemplate('pinia', scope)
35
36
  }
@@ -1,15 +1,21 @@
1
- import { defineStore } from 'pinia';
1
+ import { defineStore, acceptHMRUpdate } from 'pinia'
2
2
 
3
3
  export const useCounterStore = defineStore('counter', {
4
4
  state: () => ({
5
- counter: 0,
5
+ counter: 0
6
6
  }),
7
+
7
8
  getters: {
8
- doubleCount: (state) => state.counter * 2,
9
+ doubleCount: (state) => state.counter * 2
9
10
  },
11
+
10
12
  actions: {
11
13
  increment() {
12
- this.counter++;
13
- },
14
- },
15
- });
14
+ this.counter++
15
+ }
16
+ }
17
+ })
18
+
19
+ if (import.meta.hot) {
20
+ import.meta.hot.accept(acceptHMRUpdate(useCounterStore, import.meta.hot))
21
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/prettierrc",
3
+ "semi": false,
4
+ "singleQuote": true,
5
+ "printWidth": 100
6
+ }
@@ -18,7 +18,7 @@ module.exports = {
18
18
  // Quasar v2 - JS
19
19
  'css',
20
20
  'preset',
21
- 'lintConfig'
21
+ 'prettier'
22
22
  ]
23
23
  }
24
24
  }
@@ -13,7 +13,7 @@ npm install
13
13
  ```bash
14
14
  quasar dev
15
15
  ```
16
- <% if (preset.lint) { %>
16
+ <% if (preset.eslint) { %>
17
17
 
18
18
  ### Lint the files
19
19
  ```bash
@@ -21,7 +21,7 @@ yarn lint
21
21
  # or
22
22
  npm run lint
23
23
  ```
24
- <% if (lintConfig === 'prettier') { %>
24
+ <% if (prettier) { %>
25
25
 
26
26
  ### Format the files
27
27
  ```bash
@@ -29,8 +29,7 @@ yarn format
29
29
  # or
30
30
  npm run format
31
31
  ```
32
- <% } %>
33
- <% } %>
32
+ <% } } %>
34
33
 
35
34
  ### Build the app for production
36
35
  ```bash
@@ -1,9 +1,7 @@
1
- root = true
2
-
3
- [*]
1
+ [*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue}]
4
2
  charset = utf-8
5
- indent_style = space
6
3
  indent_size = 2
4
+ indent_style = space
7
5
  end_of_line = lf
8
6
  insert_final_newline = true
9
7
  trim_trailing_whitespace = true
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "recommendations": [
3
- <% if (preset.lint) { %>"dbaeumer.vscode-eslint",
4
- <% if (lintConfig === 'prettier') { %>"esbenp.prettier-vscode",<% } } %>
3
+ <% if (preset.eslint) { %>"dbaeumer.vscode-eslint",<% } %>
4
+ <% if (prettier) { %>"esbenp.prettier-vscode",<% } %>
5
5
  "editorconfig.editorconfig",
6
6
  "vue.volar",
7
7
  "wayou.vscode-todo-highlight"
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "editor.bracketPairColorization.enabled": true,
3
- "editor.guides.bracketPairs": true<% if (preset.lint) { %>,
3
+ "editor.guides.bracketPairs": true<% if (preset.eslint) { %>,
4
4
  "editor.formatOnSave": true,
5
- "editor.defaultFormatter": <% if (lintConfig === 'prettier') { %>"esbenp.prettier-vscode"<% } else { %>"dbaeumer.vscode-eslint"<% } %>,
5
+ "editor.defaultFormatter": <% if (prettier) { %>"esbenp.prettier-vscode"<% } else { %>"dbaeumer.vscode-eslint"<% } %>,
6
6
  "editor.codeActionsOnSave": [
7
7
  "source.fixAll.eslint"
8
8
  ],
@@ -5,10 +5,10 @@
5
5
  "productName": "<%= productName %>",
6
6
  "author": "<%= author %>",
7
7
  "private": true,
8
+ "type": "module",
8
9
  "scripts": {
9
- <% if (preset.lint) { %>"lint": "eslint --ext .js,.vue ./",
10
- <% if (lintConfig === 'prettier') { %>"format": "prettier --write \"**/*.{js,vue<% if (css !== 'sass') { %>,<%= css %><% } %>,html,md,json}\" --ignore-path .gitignore",<% } %>
11
- <% } %>
10
+ <% if (preset.eslint) { %>"lint": "eslint -c ./eslint.config.js './src*/**/*.{js,cjs,mjs,vue}'",<% } %>
11
+ <% if (prettier) { %>"format": "prettier --write \"**/*.{js,vue<% if (css !== 'sass') { %>,<%= css %><% } %>,html,md,json}\" --ignore-path .gitignore",<% } %>
12
12
  "test": "echo \"No test specified\" && exit 0",
13
13
  "dev": "quasar dev",
14
14
  "build": "quasar build",
@@ -25,24 +25,19 @@
25
25
  "vue-router": "^4.0.12"
26
26
  },
27
27
  "devDependencies": {
28
- <% if (preset.lint) { %>
29
- "@babel/eslint-parser": "^7.13.14",
30
- "eslint": "^8.57.0",
31
- "eslint-plugin-vue": "^9.0.0",
32
- "eslint-webpack-plugin": "^3.1.1",
33
- <% if (lintConfig === 'standard') { %>
34
- "eslint-config-standard": "^17.0.0",
35
- "eslint-plugin-import": "^2.19.1",
36
- "eslint-plugin-n": "^15.0.0",
37
- "eslint-plugin-promise": "^6.0.0",
38
- <% } else if (lintConfig === 'airbnb') { %>
39
- "eslint-config-airbnb-base": "^15.0.0",
40
- "eslint-plugin-import": "^2.20.1",
41
- <% } else if (lintConfig === 'prettier') { %>
42
- "eslint-config-prettier": "^9.0.0",
43
- "prettier": "^3.0.3",
44
- <% } } %>
45
- "@quasar/app-webpack": "^4.0.0-rc.1"
28
+ <% if (preset.eslint) { %>
29
+ "@eslint/js": "^9.14.0",
30
+ "eslint": "^9.14.0",
31
+ "eslint-plugin-vue": "^9.30.0",
32
+ "eslint-webpack-plugin": "^4.2.0",
33
+ "globals": "^15.12.0",
34
+ <% } %>
35
+ <% if (prettier) { %>
36
+ "@vue/eslint-config-prettier": "^10.1.0",
37
+ "prettier": "^3.3.3",
38
+ <% } %>
39
+ "@quasar/app-webpack": "^4.0.0",
40
+ "autoprefixer": "^10.4.2"
46
41
  },
47
42
  "browserslist": [
48
43
  "last 10 Chrome versions",
@@ -56,7 +51,7 @@
56
51
  "last 5 Opera versions"
57
52
  ],
58
53
  "engines": {
59
- "node": "^24 || ^22 || ^20 || ^18",
54
+ "node": "^28 || ^26 || ^24 || ^22 || ^20 || ^18",
60
55
  "npm": ">= 6.13.4",
61
56
  "yarn": ">= 1.21.1"
62
57
  }
@@ -1,6 +1,4 @@
1
- /* eslint-disable */
2
-
3
- module.exports = api => {
1
+ export default api => {
4
2
  return {
5
3
  presets: [
6
4
  [
@@ -1,9 +1,9 @@
1
- /* eslint-disable */
2
1
  // https://github.com/michael-ciniawsky/postcss-load-config
2
+ import autoprefixer from 'autoprefixer'
3
3
 
4
- module.exports = {
4
+ export default {
5
5
  plugins: [
6
6
  // to edit target browsers: use "browserslist" field in package.json
7
- require('autoprefixer')
7
+ autoprefixer
8
8
  ]
9
9
  }