Skip to content

Commit

Permalink
feat(create-quasar): upgrade Qv1 linting to support Vue 2.7 (postcss …
Browse files Browse the repository at this point in the history
…8 / eslint-plugin-vue 9)
  • Loading branch information
rstoenescu committed Jul 4, 2022
1 parent 4024cef commit a691cc1
Showing 13 changed files with 17 additions and 20 deletions.
2 changes: 2 additions & 0 deletions create-quasar/templates/app/quasar-v1/js/BASE/_package.json
Original file line number Diff line number Diff line change
@@ -18,8 +18,10 @@
},
"devDependencies": {
<% if (preset.lint) { %>
"@babel/eslint-parser": "^7.13.14",
"eslint": "^8.10.0",
"eslint-plugin-vue": "^9.0.0",
"eslint-webpack-plugin": "^3.1.1",
<% if (lintConfig === 'standard') { %>
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.19.1",
Original file line number Diff line number Diff line change
@@ -92,7 +92,7 @@ const linksData = [
icon: 'favorite',
link: 'https://awesome.quasar.dev'
}
];
]
export default {
name: 'MainLayout',
5 changes: 3 additions & 2 deletions create-quasar/templates/app/quasar-v1/js/lint/_.eslintrc.js
Original file line number Diff line number Diff line change
@@ -6,11 +6,12 @@ module.exports = {
root: true,

parserOptions: {
ecmaVersion: '2021' // Allows for the parsing of modern ECMAScript features
parser: '@babel/eslint-parser',
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: 'module' // Allows for the use of imports
},

env: {
node: true,
browser: true,
'vue/setup-compiler-macros': true
},
3 changes: 1 addition & 2 deletions create-quasar/templates/app/quasar-v1/ts/BASE/_package.json
Original file line number Diff line number Diff line change
@@ -10,8 +10,7 @@
"test": "echo \"No test specified\" && exit 0"
},
"dependencies": {
<% if (typescriptConfig === 'composition') { %>"@vue/composition-api": "^1.0.0-rc.3",
<% } else if (typescriptConfig === 'class') { %>
<% if (typescriptConfig === 'class') { %>
"vue-class-component": "^7.2.2",
"vue-property-decorator": "^8.3.0",
<% } %>
6 changes: 4 additions & 2 deletions create-quasar/templates/app/quasar-v1/ts/BASE/quasar.conf.js
Original file line number Diff line number Diff line change
@@ -17,7 +17,10 @@ module.exports = configure(function (/* ctx */) {
// https://v1.quasar.dev/quasar-cli/supporting-ts
supportTS: <% if (preset.lint) { %>{
tsCheckerConfig: {
eslint: true
eslint: {
enabled: true,
files: './src/**/*.{ts,tsx,js,jsx,vue}',
},
}
}<% } else { %>true<% } %>,

@@ -28,7 +31,6 @@ module.exports = configure(function (/* ctx */) {
// --> boot files are part of "main.js"
// https://v1.quasar.dev/quasar-cli/boot-files
boot: [
<% if (typescriptConfig === 'composition') { %>'composition-api',<% } %>
<% if (preset.i18n) { %>'i18n',<% } %>
<% if (preset.axios) { %>'axios',<% } %>
],
2 changes: 1 addition & 1 deletion create-quasar/templates/app/quasar-v1/ts/BASE/src/App.vue
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
</template>

<script lang="ts">
<% if (typescriptConfig === 'composition') { %>import { defineComponent } from '@vue/composition-api';
<% if (typescriptConfig === 'composition') { %>import { defineComponent } from 'vue';
export default defineComponent({
name: 'App',
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@

<script lang="ts">
<% if (typescriptConfig === 'composition') { %>
import { defineComponent } from '@vue/composition-api';
import { defineComponent } from 'vue';
export default defineComponent({
name: 'EssentialLink',
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
<% if (typescriptConfig === 'composition') { %>
import {
defineComponent, PropType, computed, ref, toRef, Ref,
} from '@vue/composition-api';
} from 'vue';
import { Todo, Meta } from './models';
function useClickCount() {
Original file line number Diff line number Diff line change
@@ -48,7 +48,7 @@

<script lang="ts">
<% if (typescriptConfig === 'composition') { %>
import { defineComponent, ref } from '@vue/composition-api';
import { defineComponent, ref } from 'vue';
import EssentialLink from 'components/EssentialLink.vue'
const linksData = [
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@

<script lang="ts">
<% if (typescriptConfig === 'composition') { %>
import { defineComponent } from '@vue/composition-api';
import { defineComponent } from 'vue';
export default defineComponent({
name: 'ErrorNotFound',
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
import { Todo, Meta } from 'components/models';
import ExampleComponent from 'components/ExampleComponent.vue';
<% if (typescriptConfig === 'composition') { %>
import { defineComponent, ref } from '@vue/composition-api';
import { defineComponent, ref } from 'vue';
export default defineComponent({
name: 'PageIndex',

This file was deleted.

1 change: 0 additions & 1 deletion create-quasar/templates/app/quasar-v1/ts/index.js
Original file line number Diff line number Diff line change
@@ -73,5 +73,4 @@ module.exports = async function ({ scope, utils }) {
if (scope.preset.i18n) utils.renderTemplate(utils.join(__dirname, 'i18n'), scope)
if (scope.preset.vuex) utils.renderTemplate(utils.join(__dirname, 'vuex'), scope)
if (scope.preset.lint) utils.renderTemplate(utils.join(__dirname, 'lint'), scope)
if (scope.typescriptConfig === 'composition') utils.renderTemplate(utils.join(__dirname, 'composition'), scope)
}

0 comments on commit a691cc1

Please sign in to comment.