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
@@ -1,17 +1,11 @@
1
- /* eslint-env node */
2
-
3
1
  // Configuration for your app
4
2
  // https://v2.quasar.dev/quasar-cli-webpack/quasar-config-js
5
3
 
6
- <% if (preset.lint && lintConfig === 'airbnb') { %>
7
- /* eslint func-names: 0 */
8
- /* eslint global-require: 0 */
9
- <% } %>
10
- import { defineConfig } from '#q-app/wrappers';
4
+ import { defineConfig } from '#q-app/wrappers'
11
5
 
12
6
  export default defineConfig((ctx) => {
13
- return {
14
- <% if (preset.lint) { %>eslint: {
7
+ return {<% if (preset.eslint) { %>
8
+ eslint: {
15
9
  // fix: true,
16
10
  // include: [],
17
11
  // exclude: [],
@@ -20,17 +14,17 @@ export default defineConfig((ctx) => {
20
14
  // rawWebpackEslintPluginOptions: {},
21
15
  warnings: true,
22
16
  errors: true
23
- },<% } %>
24
-
17
+ },
18
+ <% } %>
25
19
  // https://v2.quasar.dev/quasar-cli-webpack/prefetch-feature
26
20
  // preFetch: true,
27
21
 
28
22
  // app boot file (/src/boot)
29
23
  // --> boot files are part of "main.js"
30
24
  // https://v2.quasar.dev/quasar-cli-webpack/boot-files
31
- boot: [
32
- <% if (preset.i18n) { %>'i18n',<% } %>
33
- <% if (preset.axios) { %>'axios',<% } %>
25
+ boot: [<% if (preset.i18n) { %>
26
+ 'i18n'<% } %><% if (preset.axios) { %><%= preset.i18n ? ',' : '' %>
27
+ 'axios'<% } %>
34
28
  ],
35
29
 
36
30
  // https://v2.quasar.dev/quasar-cli-webpack/quasar-config-js#Property%3A-css
@@ -70,7 +64,6 @@ export default defineConfig((ctx) => {
70
64
  },
71
65
 
72
66
  // rtl: true, // https://quasar.dev/options/rtl-support
73
- // preloadChunks: true,
74
67
  // showProgress: false,
75
68
  // gzip: true,
76
69
  // analyze: true,
@@ -145,9 +138,7 @@ export default defineConfig((ctx) => {
145
138
  // manualPostHydrationTrigger: true,
146
139
 
147
140
  pwa: false
148
-
149
141
  // pwaOfflineHtmlFilename: 'offline.html', // do NOT use index.html as name!
150
- // will mess up SSR
151
142
 
152
143
  // pwaExtendGenerateSWOptions (cfg) {},
153
144
  // pwaExtendInjectManifestOptions (cfg) {}
@@ -216,9 +207,15 @@ export default defineConfig((ctx) => {
216
207
  // extendBexScriptsConf (esbuildConf) {},
217
208
  // extendBexManifestJson (json) {},
218
209
 
219
- contentScripts: [
220
- 'my-content-script'
221
- ]
210
+ /**
211
+ * The list of extra scripts (js/ts) not in your bex manifest that you want to
212
+ * compile and use in your browser extension. Maybe dynamic use them?
213
+ *
214
+ * Each entry in the list should be a relative filename to /src-bex/
215
+ *
216
+ * @example [ 'my-script.ts', 'sub-folder/my-other-script.js' ]
217
+ */
218
+ extraScripts: []
222
219
  }
223
220
  }
224
- });
221
+ })
@@ -1,6 +1,6 @@
1
1
  import { defineRouter } from '#q-app/wrappers'
2
2
  import { createRouter, createMemoryHistory, createWebHistory, createWebHashHistory } from 'vue-router'
3
- import routes from './routes'
3
+ import routes from './routes.js'
4
4
 
5
5
  /*
6
6
  * If not building with SSR mode, you can
@@ -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-webpack/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
+ ]
@@ -1,4 +1,4 @@
1
- import enUS from './en-US'
1
+ import enUS from './en-US/index.js'
2
2
 
3
3
  export default {
4
4
  'en-US': enUS
@@ -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 (ESLint)', value: 'lint', description: 'recommended', selected: true },
8
+ { title: 'Linting (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
  }
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/prettierrc",
3
+ "semi": false,
4
+ "singleQuote": true,
5
+ "printWidth": 100
6
+ }
@@ -141,7 +141,6 @@ module.exports = configure(function (/* ctx */) {
141
141
  // https://v2.quasar.dev/quasar-cli-vite/developing-ssr/configuring-ssr
142
142
  ssr: {
143
143
  // ssrPwaHtmlFilename: 'offline.html', // do NOT use index.html as name!
144
- // will mess up SSR
145
144
 
146
145
  // extendSSRWebserverConf (esbuildConf) {},
147
146
  // extendPackageJson (json) {},
@@ -15,7 +15,7 @@ module.exports = {
15
15
  'sfcStyle',
16
16
  'css',
17
17
  'preset',
18
- 'lintConfig'
18
+ 'prettier'
19
19
  ]
20
20
  }
21
21
  }
@@ -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,.ts,.vue ./",
11
- <% if (lintConfig === 'prettier') { %>"format": "prettier --write \"**/*.{js,ts,vue,<% if (css !== 'sass') { %><%= css %><% } %>,html,md,json}\" --ignore-path .gitignore",<% } %>
12
- <% } %>
10
+ <% if (preset.eslint) { %>"lint": "eslint -c ./eslint.config.js './src*/**/*.{ts,js,cjs,mjs,vue}'",<% } %>
11
+ <% if (prettier) { %>"format": "prettier --write \"**/*.{js,ts,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,33 +24,27 @@
25
24
  "vue-router": "^4.0.12"
26
25
  },
27
26
  "devDependencies": {
28
- <% if (preset.lint) { %>
29
- "@typescript-eslint/eslint-plugin": "^7.16.0",
30
- "@typescript-eslint/parser": "^7.16.0",
31
- "vite-plugin-checker": "^0.8.0",
27
+ <% if (preset.eslint) { %>
28
+ "@eslint/js": "^9.14.0",
29
+ "eslint": "^9.14.0",
30
+ "eslint-plugin-vue": "^9.30.0",
31
+ "globals": "^15.12.0",
32
32
  "vue-tsc": "^2.0.29",
33
- "eslint": "^8.57.0",
34
- "eslint-plugin-vue": "^9.0.0",
35
- <% if (lintConfig === 'standard') { %>
36
- "eslint-config-standard": "^17.0.0",
37
- "eslint-plugin-import": "^2.19.1",
38
- "eslint-plugin-n": "^15.0.0",
39
- "eslint-plugin-promise": "^6.0.0",
40
- <% } else if (lintConfig === 'airbnb') { %>
41
- "eslint-config-airbnb-base": "^15.0.0",
42
- "eslint-plugin-import": "^2.20.1",
43
- <% } else if (lintConfig === 'prettier') { %>
44
- "eslint-config-prettier": "^9.0.0",
45
- "prettier": "^3.0.3",
46
- <% } } %>
33
+ "@vue/eslint-config-typescript": "^14.1.3",
34
+ "vite-plugin-checker": "^0.8.0",
35
+ <% } %>
36
+ <% if (prettier) { %>
37
+ "@vue/eslint-config-prettier": "^10.1.0",
38
+ "prettier": "^3.3.3",
39
+ <% } %>
47
40
  "@types/node": "^20.5.9",
48
41
  <% if (preset.i18n) { %>"@intlify/unplugin-vue-i18n": "^2.0.0",<% } %>
49
- "@quasar/app-vite": "^2.0.0-rc.1",
42
+ "@quasar/app-vite": "^2.0.0",
50
43
  "autoprefixer": "^10.4.2",
51
44
  "typescript": "~5.5.3"
52
45
  },
53
46
  "engines": {
54
- "node": "^24 || ^22 || ^20 || ^18",
47
+ "node": "^28 || ^26 || ^24 || ^22 || ^20 || ^18",
55
48
  "npm": ">= 6.13.4",
56
49
  "yarn": ">= 1.21.1"
57
50
  }
@@ -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,13 +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
- <% } %>
9
- import { defineConfig } from '#q-app/wrappers';
10
- <% if (preset.i18n) { %>import { fileURLToPath } from 'node:url';<% } %>
4
+ import { defineConfig } from '#q-app/wrappers';<% if (preset.i18n) { %>
5
+ import { fileURLToPath } from 'node:url';<% } %>
11
6
 
12
7
  export default defineConfig((<% if (preset.i18n) { %>ctx<% } else { %>/* ctx */<% } %>) => {
13
8
  return {
@@ -17,9 +12,9 @@ export default defineConfig((<% if (preset.i18n) { %>ctx<% } else { %>/* ctx */<
17
12
  // app boot file (/src/boot)
18
13
  // --> boot files are part of "main.js"
19
14
  // https://v2.quasar.dev/quasar-cli-vite/boot-files
20
- boot: [
21
- <% if (preset.i18n) { %>'i18n',<% } %>
22
- <% if (preset.axios) { %>'axios',<% } %>
15
+ boot: [<% if (preset.i18n) { %>
16
+ 'i18n'<% } %><% if (preset.axios) { %><%= preset.i18n ? ',' : '' %>
17
+ 'axios'<% } %>
23
18
  ],
24
19
 
25
20
  // https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#css
@@ -72,8 +67,8 @@ export default defineConfig((<% if (preset.i18n) { %>ctx<% } else { %>/* ctx */<
72
67
 
73
68
  // extendViteConf (viteConf) {},
74
69
  // viteVuePluginOptions: {},
75
-
76
- <% if (preset.i18n || preset.lint) { %>vitePlugins: [<% if (preset.i18n) { %>
70
+ <% if (preset.i18n || preset.eslint) { %>
71
+ vitePlugins: [<% if (preset.i18n) { %>
77
72
  ['@intlify/unplugin-vue-i18n/vite', {
78
73
  // if you want to use Vue I18n Legacy API, you need to set `compositionOnly: false`
79
74
  // compositionOnly: false,
@@ -85,12 +80,14 @@ export default defineConfig((<% if (preset.i18n) { %>ctx<% } else { %>/* ctx */<
85
80
  ssr: ctx.modeName === 'ssr',
86
81
 
87
82
  // you need to set i18n resource including paths !
88
- include: [ fileURLToPath(new URL('./src/i18n', import.meta.url)) ],
89
- }]<% } %><% if (preset.lint) { %><% if (preset.i18n) { %>,<% } %>
83
+ include: [ fileURLToPath(new URL('./src/i18n', import.meta.url)) ]
84
+ }]<% } %><% if (preset.eslint) { %><% if (preset.i18n) { %>,
85
+ <% } %>
90
86
  ['vite-plugin-checker', {
91
87
  vueTsc: true,
92
88
  eslint: {
93
- lintCommand: 'eslint "./**/*.{js,ts,mjs,cjs,vue}"'
89
+ lintCommand: 'eslint -c ./eslint.config.js "./src*/**/*.{ts,js,mjs,cjs,vue}"',
90
+ useFlatConfig: true
94
91
  }
95
92
  }, { server: false }]<% } %>
96
93
  ]<% } else { %>
@@ -101,7 +98,7 @@ export default defineConfig((<% if (preset.i18n) { %>ctx<% } else { %>/* ctx */<
101
98
 
102
99
  // Full list of options: https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#devServer
103
100
  devServer: {
104
- // https: true
101
+ // https: true,
105
102
  open: true // opens browser window automatically
106
103
  },
107
104
 
@@ -158,7 +155,6 @@ export default defineConfig((<% if (preset.i18n) { %>ctx<% } else { %>/* ctx */<
158
155
  // manualPostHydrationTrigger: true,
159
156
 
160
157
  pwa: false
161
-
162
158
  // pwaOfflineHtmlFilename: 'offline.html', // do NOT use index.html as name!
163
159
 
164
160
  // pwaExtendGenerateSWOptions (cfg) {},
@@ -228,6 +224,14 @@ export default defineConfig((<% if (preset.i18n) { %>ctx<% } else { %>/* ctx */<
228
224
  // extendBexScriptsConf (esbuildConf) {},
229
225
  // extendBexManifestJson (json) {},
230
226
 
227
+ /**
228
+ * The list of extra scripts (js/ts) not in your bex manifest that you want to
229
+ * compile and use in your browser extension. Maybe dynamic use them?
230
+ *
231
+ * Each entry in the list should be a relative filename to /src-bex/
232
+ *
233
+ * @example [ 'my-script.ts', 'sub-folder/my-other-script.js' ]
234
+ */
231
235
  extraScripts: []
232
236
  }
233
237
  }
@@ -1,5 +1,3 @@
1
- /* eslint-disable */
2
-
3
1
  declare namespace NodeJS {
4
2
  interface ProcessEnv {
5
3
  NODE_ENV: string;
@@ -0,0 +1,94 @@
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'
5
+ import vueTsEslintConfig from '@vue/eslint-config-typescript'<% if (prettier) { %>
6
+ import prettierSkipFormatting from '@vue/eslint-config-prettier/skip-formatting'<% } %>
7
+
8
+ export default [
9
+ {
10
+ /**
11
+ * Ignore the following files.
12
+ * Please note that pluginQuasar.configs.recommended already ignores
13
+ * the "node_modules" folder for you (and all other Quasar project
14
+ * relevant folders and files).
15
+ *
16
+ * ESLint requires "ignores" key to be the only one in this object
17
+ */
18
+ // ignores: []
19
+ },
20
+
21
+ ...pluginQuasar.configs.recommended(),
22
+ js.configs.recommended,
23
+
24
+ /**
25
+ * https://eslint.vuejs.org
26
+ *
27
+ * pluginVue.configs.base
28
+ * -> Settings and rules to enable correct ESLint parsing.
29
+ * pluginVue.configs[ 'flat/essential']
30
+ * -> base, plus rules to prevent errors or unintended behavior.
31
+ * pluginVue.configs["flat/strongly-recommended"]
32
+ * -> Above, plus rules to considerably improve code readability and/or dev experience.
33
+ * pluginVue.configs["flat/recommended"]
34
+ * -> Above, plus rules to enforce subjective community defaults to ensure consistency.
35
+ */
36
+ ...pluginVue.configs[ 'flat/essential' ],
37
+
38
+ // https://github.com/vuejs/eslint-config-typescript
39
+ ...vueTsEslintConfig({
40
+ // Optional: extend additional configurations from typescript-eslint'.
41
+ // Supports all the configurations in
42
+ // https://typescript-eslint.io/users/configs#recommended-configurations
43
+ extends: [
44
+ // By default, only the recommended rules are enabled.
45
+ 'recommended'
46
+ // You can also manually enable the stylistic rules.
47
+ // "stylistic",
48
+
49
+ // Other utility configurations, such as 'eslintRecommended', (note that it's in camelCase)
50
+ // are also extendable here. But we don't recommend using them directly.
51
+ ]
52
+ }),
53
+
54
+ {
55
+ languageOptions: {
56
+ ecmaVersion: 'latest',
57
+ sourceType: 'module',
58
+
59
+ globals: {
60
+ ...globals.browser,
61
+ ...globals.node, // SSR, Electron, config files
62
+ process: 'readonly', // process.env.*
63
+ ga: 'readonly', // Google Analytics
64
+ cordova: 'readonly',
65
+ Capacitor: 'readonly',
66
+ chrome: 'readonly', // BEX related
67
+ browser: 'readonly' // BEX related
68
+ }
69
+ },
70
+
71
+ // add your custom rules here
72
+ rules: {
73
+ 'prefer-promise-reject-errors': 'off',
74
+ '@typescript-eslint/consistent-type-imports': [
75
+ 'error',
76
+ { prefer: 'type-imports' }
77
+ ],
78
+
79
+ // allow debugger during development only
80
+ 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
81
+ }
82
+ },
83
+
84
+ {
85
+ files: [ 'src-pwa/custom-service-worker.ts' ],
86
+ languageOptions: {
87
+ globals: {
88
+ ...globals.serviceworker
89
+ }
90
+ }
91
+ }<% if (prettier) { %>,
92
+
93
+ prettierSkipFormatting<% } %>
94
+ ]
@@ -8,7 +8,7 @@ export type MessageLanguages = keyof typeof messages;
8
8
  export type MessageSchema = typeof messages['en-US'];
9
9
 
10
10
  // See https://vue-i18n.intlify.dev/guide/advanced/typescript.html#global-resource-schema-type-definition
11
- /* eslint-disable @typescript-eslint/no-empty-interface */
11
+ /* eslint-disable @typescript-eslint/no-empty-object-type */
12
12
  declare module 'vue-i18n' {
13
13
  // define the locale messages schema
14
14
  export interface DefineLocaleMessage extends MessageSchema {}
@@ -19,10 +19,10 @@ declare module 'vue-i18n' {
19
19
  // define the number format schema
20
20
  export interface DefineNumberFormat {}
21
21
  }
22
- /* eslint-enable @typescript-eslint/no-empty-interface */
22
+ /* eslint-enable @typescript-eslint/no-empty-object-type */
23
23
 
24
24
  export default defineBoot(({ app }) => {
25
- const i18n = createI18n({
25
+ const i18n = createI18n<{ message: MessageSchema }, MessageLanguages>({
26
26
  locale: 'en-US',<% if (sfcStyle === 'composition' || sfcStyle === 'composition-setup') { %>
27
27
  legacy: false,<% } %>
28
28
  messages,
@@ -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 + vue-tsc)', value: 'lint', description: 'recommended', selected: true },
8
+ { title: 'Linting (vite-plugin-checker + ESLint + vue-tsc)', 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,29 +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) {
34
- utils.renderTemplate('lint', scope)
35
- if (scope.lintConfig === 'prettier') {
36
- utils.renderTemplate('prettier', scope)
37
- }
38
- }
39
-
33
+ if (scope.preset.eslint) utils.renderTemplate('eslint', scope)
34
+ if (scope.prettier) utils.renderTemplate('prettier', scope)
40
35
  if (scope.preset.pinia) utils.renderTemplate('pinia', scope)
41
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
5
  counter: 0,
6
6
  }),
7
+
7
8
  getters: {
8
9
  doubleCount: (state) => state.counter * 2,
9
10
  },
11
+
10
12
  actions: {
11
13
  increment() {
12
14
  this.counter++;
13
15
  },
14
16
  },
15
17
  });
18
+
19
+ if (import.meta.hot) {
20
+ import.meta.hot.accept(acceptHMRUpdate(useCounterStore, import.meta.hot));
21
+ }