Skip to content

Commit

Permalink
feat(create-quasar): replace internal linting with vite-plugin-checke…
Browse files Browse the repository at this point in the history
…r for current q/app-vite templates too
  • Loading branch information
rstoenescu committed Mar 8, 2024
1 parent 041dc99 commit a65459e
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"prettier": "^3.0.3",
<% } } %>
<% if (preset.i18n) { %>"@intlify/unplugin-vue-i18n": "^2.0.0",<% } %>
"@quasar/app-vite": "^2.0.0-beta.1",
"@quasar/app-vite": "^2.0.0-beta.5",
"autoprefixer": "^10.4.2",
"postcss": "^8.4.14"
},
Expand Down
6 changes: 3 additions & 3 deletions create-quasar/templates/app/quasar-v2/js-vite-beta/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ 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: 'vite-plugin-checker (ESLint)', 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' },
{ title: 'Vue-i18n', value: 'i18n' }
{ title: 'axios', value: 'axios' },
{ title: 'vue-i18n', value: 'i18n' }
],
format: values => {
let result = values
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<% if (preset.lint) { %>
"eslint": "^8.11.0",
"eslint-plugin-vue": "^9.0.0",
"vite-plugin-checker": "^0.6.4",
<% if (lintConfig === 'standard') { %>
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.19.1",
Expand All @@ -40,7 +41,7 @@
"prettier": "^2.5.1",
<% } } %>
<% if (preset.i18n) { %>"@intlify/vite-plugin-vue-i18n": "^3.3.1",<% } %>
"@quasar/app-vite": "^1.4.3",
"@quasar/app-vite": "^1.8.0",
"autoprefixer": "^10.4.2",
"postcss": "^8.4.14"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,6 @@ const { configure } = require('quasar/wrappers');

module.exports = configure(function (/* ctx */) {
return {
<% if (preset.lint) { %>eslint: {
// fix: true,
// include: [],
// exclude: [],
// rawOptions: {},
warnings: true,
errors: true
},<% } %>

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

Expand Down Expand Up @@ -80,7 +71,7 @@ module.exports = configure(function (/* ctx */) {
// extendViteConf (viteConf) {},
// viteVuePluginOptions: {},

<% if (preset.i18n) { %>vitePlugins: [
<% if (preset.i18n || preset.lint) { %>vitePlugins: [<% if (preset.i18n) { %>
['@intlify/vite-plugin-vue-i18n', {
// if you want to use Vue I18n Legacy API, you need to set `compositionOnly: false`
// compositionOnly: false,
Expand All @@ -91,10 +82,15 @@ module.exports = configure(function (/* ctx */) {

// you need to set i18n resource including paths !
include: path.resolve(__dirname, './src/i18n/**')
}]
}]<% } %><% 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
6 changes: 3 additions & 3 deletions create-quasar/templates/app/quasar-v2/js-vite/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ 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: 'vite-plugin-checker (ESLint)', 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' },
{ title: 'Vue-i18n', value: 'i18n' }
{ title: 'axios', value: 'axios' },
{ title: 'vue-i18n', value: 'i18n' }
],
format: values => {
let result = values
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<% } } %>
"@types/node": "^20.5.9",
<% if (preset.i18n) { %>"@intlify/unplugin-vue-i18n": "^2.0.0",<% } %>
"@quasar/app-vite": "^2.0.0-beta.1",
"@quasar/app-vite": "^2.0.0-beta.5",
"autoprefixer": "^10.4.2",
"typescript": "~5.3.0"
},
Expand Down
6 changes: 3 additions & 3 deletions create-quasar/templates/app/quasar-v2/ts-vite-beta/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ export async function script ({ scope, utils }) {
name: 'preset',
message: 'Check the features needed for your project:',
choices: [
{ title: 'ESLint + vue-tsc', value: 'lint', description: 'recommended', selected: true },
{ title: 'vite-plugin-checker (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' },
{ title: 'Vue-i18n', value: 'i18n' }
{ title: 'axios', value: 'axios' },
{ title: 'vue-i18n', value: 'i18n' }
],
format: values => {
let result = values
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
<% if (preset.lint) { %>
"@typescript-eslint/eslint-plugin": "^5.10.0",
"@typescript-eslint/parser": "^5.10.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 All @@ -44,7 +46,7 @@
<% } } %>
"@types/node": "^12.20.21",
<% if (preset.i18n) { %>"@intlify/vite-plugin-vue-i18n": "^3.3.1",<% } %>
"@quasar/app-vite": "^1.4.3",
"@quasar/app-vite": "^1.8.0",
"autoprefixer": "^10.4.2",
"typescript": "^4.5.4"
},
Expand Down
23 changes: 11 additions & 12 deletions create-quasar/templates/app/quasar-v2/ts-vite/BASE/quasar.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,6 @@ const { configure } = require('quasar/wrappers');

module.exports = configure(function (/* ctx */) {
return {
<% if (preset.lint) { %>eslint: {
// fix: true,
// include: [],
// exclude: [],
// rawOptions: {},
warnings: true,
errors: true
},<% } %>

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

Expand Down Expand Up @@ -81,7 +72,7 @@ module.exports = configure(function (/* ctx */) {
// extendViteConf (viteConf) {},
// viteVuePluginOptions: {},

<% if (preset.i18n) { %>vitePlugins: [
<% if (preset.i18n || preset.lint) { %>vitePlugins: [<% if (preset.i18n) { %>
['@intlify/vite-plugin-vue-i18n', {
// if you want to use Vue I18n Legacy API, you need to set `compositionOnly: false`
// compositionOnly: false,
Expand All @@ -92,10 +83,18 @@ module.exports = configure(function (/* ctx */) {

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

Expand Down
6 changes: 3 additions & 3 deletions create-quasar/templates/app/quasar-v2/ts-vite/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ 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: 'vite-plugin-checker (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' },
{ title: 'Vue-i18n', value: 'i18n' }
{ title: 'axios', value: 'axios' },
{ title: 'vue-i18n', value: 'i18n' }
],
format: values => {
let result = values
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*
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"skipLibCheck": true
}
}

0 comments on commit a65459e

Please sign in to comment.