Skip to content

Commit ca2c70a

Browse files
authored
chore(ui): update linter and add prefer-const (quasarframework#7435)
1 parent 6805244 commit ca2c70a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+126
-123
lines changed

ui/.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ module.exports = {
2626
// add your custom rules here
2727
'rules': {
2828
'brace-style': [2, 'stroustrup', { 'allowSingleLine': true }],
29+
'prefer-const': 2,
2930

3031
'vue/max-attributes-per-line': 'off',
3132
'vue/valid-v-for': 'off',
@@ -36,7 +37,6 @@ module.exports = {
3637
'vue/require-render-return': 'off',
3738
'vue/singleline-html-element-content-newline': 'off',
3839
'vue/no-side-effects-in-computed-properties': 'off',
39-
'vue/return-in-computed-property': 'off',
4040
'vue/array-bracket-spacing': 'off',
4141
'vue/object-curly-spacing': 'off',
4242
'vue/script-indent': 'off',

ui/dev/src/pages/components/data-table-part1.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -954,10 +954,10 @@ export default {
954954
setTimeout(() => {
955955
this.serverPagination = props.pagination
956956
957-
let
957+
const
958958
table = this.$refs.server,
959-
rows = this.data.slice(),
960959
{ page, rowsPerPage, sortBy, descending } = props.pagination
960+
let rows = this.data.slice()
961961
962962
if (props.filter) {
963963
rows = table.filterMethod(rows, props.filter)

ui/dev/src/pages/components/data-table-part2.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
bordered
2121
:dense="dense"
2222
>
23-
<template v-slot:top-right="props">
23+
<template v-slot:top-right>
2424
<q-input borderless dense debounce="300" v-model="filter" placeholder="Search">
2525
<q-icon slot="append" name="search" />
2626
</q-input>
@@ -91,7 +91,7 @@
9191
row-key="name"
9292
color="primary"
9393
>
94-
<template v-slot:top="props">
94+
<template v-slot:top>
9595
<q-btn flat dense color="primary" :disable="loadingDyn" icon="add" label="Add row" @click="addRow" />
9696
<q-btn class="on-right" flat dense color="primary" :disable="loadingDyn" icon="remove" label="Remove row" @click="removeRow" />
9797
<q-btn class="on-right" flat dense color="primary" :disable="loadingDyn" icon="refresh" label="Refresh" />
@@ -494,10 +494,10 @@ export default {
494494
setTimeout(() => {
495495
this.serverPagination = props.pagination
496496
497-
let
497+
const
498498
table = this.$refs.server,
499-
rows = this.data.slice(),
500499
{ page, rowsPerPage, sortBy, descending } = props.pagination
500+
let rows = this.data.slice()
501501
502502
if (props.filter) {
503503
console.log('filter hit')

ui/dev/src/pages/components/menu.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@
574574
<script>
575575
export default {
576576
data () {
577-
let list = []
577+
const list = []
578578
for (let i = 0; i < 26 * 30; i += 1) {
579579
const c = String.fromCharCode(97 + (i % 26))
580580
const v = `${c}${c}${c}${c}${c}#${i}`

ui/dev/src/pages/web-tests/fast-table-test.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ export default {
172172
computed: {
173173
xxl () {
174174
const rand = () => Math.floor((Math.random() % 450) * 450)
175-
let data = clone(this.data)
175+
const data = clone(this.data)
176176
for (let i = 0; i < 500; i++) {
177177
data.push({
178178
name: uid(),

ui/dev/src/router/routes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const metaChildren = [
1818
{ path: 'third', component: load('meta/pages/third') }
1919
]
2020

21-
let routes = [
21+
const routes = [
2222
{ path: '/', component: load('Index') },
2323
{
2424
path: '/meta/layout_1',

ui/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@
6666
"@rollup/plugin-node-resolve": "^7.1.0",
6767
"babel-eslint": "^10.0.2",
6868
"babel-preset-es2015-rollup": "^3.0.0",
69-
"eslint": "^5.15.3",
69+
"eslint": "^7.4.0",
7070
"eslint-config-standard": "^12.0.0",
7171
"eslint-friendly-formatter": "^4.0.1",
72-
"eslint-loader": "^2.2.1",
72+
"eslint-loader": "^4.0.2",
7373
"eslint-plugin-import": "^2.18.2",
7474
"eslint-plugin-node": "^9.1.0",
7575
"eslint-plugin-promise": "^4.2.1",

ui/src/body.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function clientUpdate () {
6767
}
6868

6969
function setColors (brand) {
70-
for (let color in brand) {
70+
for (const color in brand) {
7171
setBrand(color, brand[color])
7272
}
7373
}

ui/src/components/ajax-bar/QAjaxBar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export default Vue.extend({
113113
style () {
114114
const active = this.onScreen
115115

116-
let o = translate({
116+
const o = translate({
117117
p: this.progress,
118118
pos: this.position,
119119
active,

ui/src/components/dialog-bottom-sheet/BottomSheet.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export default Vue.extend({
135135
},
136136

137137
render (h) {
138-
let child = []
138+
const child = []
139139

140140
this.title && child.push(
141141
h(QCardSection, {

0 commit comments

Comments
 (0)