Skip to content

Commit

Permalink
feat(create-quasar): use newer linting for q/app-vite beta
Browse files Browse the repository at this point in the history
  • Loading branch information
rstoenescu committed Mar 7, 2024
1 parent 726ea65 commit a4f76fe
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 28 deletions.
1 change: 1 addition & 0 deletions app-vite/tsconfig-preset.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
// Fix Volar issue https://github.com/johnsoncodehk/volar/issues/1153
"jsx": "preserve",
"lib": ["esnext", "dom"],
"skipLibCheck": true,
"paths": {
"src/*": ["src/*"],
"app/*": ["*"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
},
"devDependencies": {
<% if (preset.lint) { %>
"vite-plugin-checker": "^0.6.4",
"eslint": "^8.11.0",
"eslint-plugin-vue": "^9.0.0",
<% if (lintConfig === 'standard') { %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,6 @@ import { configure } from 'quasar/wrappers'

export default configure((<% if (preset.i18n) { %>ctx<% } else { %>/* ctx */<% } %>) => {
return {
<% if (preset.lint) { %>eslint: {
// fix: true,
// include: [],
// exclude: [],
// cache: false,
// rawOptions: {},
warnings: true,
errors: true
},<% } %>

// https://v2.quasar.dev/quasar-cli-vite/prefetch-feature
// preFetch: true,

Expand Down Expand Up @@ -76,7 +66,7 @@ export default configure((<% if (preset.i18n) { %>ctx<% } else { %>/* ctx */<% }
// extendViteConf (viteConf) {},
// viteVuePluginOptions: {},

<% if (preset.i18n) { %>vitePlugins: [
<% if (preset.i18n || preset.lint) { %>vitePlugins: [<% if (preset.i18n) { %>
['@intlify/unplugin-vue-i18n/vite', {
// if you want to use Vue I18n Legacy API, you need to set `compositionOnly: false`
// compositionOnly: false,
Expand All @@ -89,10 +79,15 @@ export default configure((<% if (preset.i18n) { %>ctx<% } else { %>/* ctx */<% }

// you need to set i18n resource including paths !
include: [ fileURLToPath(new URL('./src/i18n', import.meta.url)) ],
}]
}]<% } %><% if (preset.lint) { %><% if (preset.i18n) { %>,<% } %>
['vite-plugin-checker', {
eslint: {
lintCommand: 'eslint "./**/*.{js,mjs,cjs,vue}"'
}
}, { server: false }]<% } %>
]<% } else { %>
// vitePlugins: [
// [ 'package-name', { ..options.. } ]
// [ 'package-name', { ..pluginOptions.. }, { server: true, client: true } ]
// ]<% } %>
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
<% if (preset.lint) { %>
"@typescript-eslint/eslint-plugin": "^6.6.0",
"@typescript-eslint/parser": "^6.6.0",
"vite-plugin-checker": "^0.6.4",
"vue-tsc": "^1.8.22",
"eslint": "^8.11.0",
"eslint-plugin-vue": "^9.0.0",
<% if (lintConfig === 'standard') { %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,6 @@ import { configure } from 'quasar/wrappers';

export default configure((<% if (preset.i18n) { %>ctx<% } else { %>/* ctx */<% } %>) => {
return {
<% if (preset.lint) { %>eslint: {
// fix: true,
// include: [],
// exclude: [],
// cache: false,
// rawOptions: {},
warnings: true,
errors: true
},<% } %>

// https://v2.quasar.dev/quasar-cli-vite/prefetch-feature
// preFetch: true,

Expand Down Expand Up @@ -77,7 +67,7 @@ export default configure((<% if (preset.i18n) { %>ctx<% } else { %>/* ctx */<% }
// extendViteConf (viteConf) {},
// viteVuePluginOptions: {},

<% if (preset.i18n) { %>vitePlugins: [
<% if (preset.i18n || preset.lint) { %>vitePlugins: [<% if (preset.i18n) { %>
['@intlify/unplugin-vue-i18n/vite', {
// if you want to use Vue I18n Legacy API, you need to set `compositionOnly: false`
// compositionOnly: false,
Expand All @@ -90,10 +80,16 @@ export default configure((<% if (preset.i18n) { %>ctx<% } else { %>/* ctx */<% }

// you need to set i18n resource including paths !
include: [ fileURLToPath(new URL('./src/i18n', import.meta.url)) ],
}]
}]<% } %><% if (preset.lint) { %><% if (preset.i18n) { %>,<% } %>
['vite-plugin-checker', {
vueTsc: true,
eslint: {
lintCommand: 'eslint "./**/*.{js,ts,mjs,cjs,vue}"'
}
}, { server: false }]<% } %>
]<% } else { %>
// vitePlugins: [
// [ 'package-name', { ..options.. } ]
// [ 'package-name', { ..pluginOptions.. }, { server: true, client: true } ]
// ]<% } %>
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export async function script ({ scope, utils }) {
name: 'preset',
message: 'Check the features needed for your project:',
choices: [
{ title: 'ESLint', value: 'lint', description: 'recommended', selected: true },
{ title: 'ESLint + vue-tsc', value: 'lint', description: 'recommended', selected: true },
{ title: 'State Management (Pinia)', value: 'pinia', description: 'https://pinia.vuejs.org' },
{ title: 'State Management (Vuex) [DEPRECATED by Vue Team]', value: 'vuex', description: 'See https://vuejs.org/guide/scaling-up/state-management.html#pinia' },
{ title: 'Axios', value: 'axios' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@
/.quasar
/node_modules
.eslintrc.cjs
/src-ssr
/quasar.config.*.temporary.compiled*

0 comments on commit a4f76fe

Please sign in to comment.