Skip to content

Commit 5a3e8b3

Browse files
committed
chore: fix linting errors
1 parent 44b4943 commit 5a3e8b3

File tree

12 files changed

+55
-53
lines changed

12 files changed

+55
-53
lines changed

ui/.eslintrc.js

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,32 @@ module.exports = {
1919
'vue'
2020
],
2121
globals: {
22-
'cordova': true,
23-
'__THEME__': true,
24-
'__statics': true
22+
cordova: true,
23+
__THEME__: true,
24+
__statics: true
2525
},
2626
// add your custom rules here
27-
'rules': {
28-
'brace-style': [2, 'stroustrup', { 'allowSingleLine': true }],
27+
rules: {
28+
'brace-style': [ 2, 'stroustrup', { allowSingleLine: true } ],
2929
'prefer-const': 2,
30+
'no-undefined': 2,
31+
'no-void': 0,
3032

31-
'vue/max-attributes-per-line': 'off',
32-
'vue/valid-v-for': 'off',
33-
'vue/require-default-prop': 'off',
34-
'vue/require-prop-types': 'off',
35-
'vue/require-v-for-key': 'off',
36-
'vue/return-in-computed-property': 'off',
37-
'vue/require-render-return': 'off',
38-
'vue/singleline-html-element-content-newline': 'off',
39-
'vue/no-side-effects-in-computed-properties': 'off',
40-
'vue/array-bracket-spacing': 'off',
41-
'vue/object-curly-spacing': 'off',
42-
'vue/script-indent': 'off',
33+
'vue/max-attributes-per-line': 0,
34+
'vue/valid-v-for': 0,
35+
'vue/require-default-prop': 0,
36+
'vue/require-prop-types': 0,
37+
'vue/require-v-for-key': 0,
38+
'vue/return-in-computed-property': 0,
39+
'vue/require-render-return': 0,
40+
'vue/singleline-html-element-content-newline': 0,
41+
'vue/no-side-effects-in-computed-properties': 0,
42+
'vue/array-bracket-spacing': 0,
43+
'vue/object-curly-spacing': 0,
44+
'vue/script-indent': 0,
4345

4446
// allow async-await
45-
'generator-star-spacing': 'off',
47+
'generator-star-spacing': 0,
4648

4749
// allow paren-less arrow functions
4850
'arrow-parens': 0,

ui/build/build.api.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ function parseObject ({ banner, api, itemName, masterType, verifyCategory }) {
217217

218218
const def = objectTypes[type]
219219

220-
for (let prop in obj) {
220+
for (const prop in obj) {
221221
if ([ 'type', '__exemption' ].includes(prop)) {
222222
continue
223223
}
@@ -298,7 +298,7 @@ function parseObject ({ banner, api, itemName, masterType, verifyCategory }) {
298298
;[ 'params', 'definition', 'scope', 'props' ].forEach(prop => {
299299
if (!obj[prop]) { return }
300300

301-
for (let item in obj[prop]) {
301+
for (const item in obj[prop]) {
302302
parseObject({
303303
banner: `${banner}/"${prop}"/"${item}"`,
304304
api: api[itemName][prop],
@@ -375,7 +375,7 @@ function parseAPI (file, apiType) {
375375
}
376376

377377
// "props", "slots", ...
378-
for (let type in api) {
378+
for (const type in api) {
379379
if (!topSections[apiType].includes(type)) {
380380
logError(`${banner} "${type}" is not recognized for a ${apiType}`)
381381
process.exit(1)
@@ -428,7 +428,7 @@ function parseAPI (file, apiType) {
428428

429429
const isComponent = banner.indexOf('component') > -1
430430

431-
for (let itemName in api[type]) {
431+
for (const itemName in api[type]) {
432432
parseObject({
433433
banner: `${banner} "${type}"/"${itemName}"`,
434434
api: api[type],

ui/build/build.types.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function convertTypeVal (type, def, required) {
6868
if (fallbackComplexTypeMap.has(t)) {
6969
if (def.definition) {
7070
const propDefinitions = getPropDefinitions(def.definition, required, true)
71-
let lines = []
71+
const lines = []
7272
propDefinitions.forEach(p => lines.push(...p.split('\n')))
7373
return propDefinitions && propDefinitions.length > 0 ? `{\n ${lines.join('\n ')} }${t === 'Array' ? '[]' : ''}` : fallbackComplexTypeMap.get(t)
7474
}
@@ -143,7 +143,7 @@ function getMethodDefinition (key, methodDef, required) {
143143
}
144144

145145
function getObjectParamDefinition (def, required) {
146-
let res = []
146+
const res = []
147147

148148
Object.keys(def).forEach(propName => {
149149
const propDef = def[propName]
@@ -365,10 +365,10 @@ function writeIndexDTS (apis) {
365365
for (const key in injections) {
366366
const injectionDefs = injections[key]
367367
if (injectionDefs) {
368-
const injectionName = `${ key.toUpperCase().replace('$', '') }VueGlobals`
369-
writeLine(contents, `import { ${ injectionName }, QSingletonGlobals } from "./globals";`)
368+
const injectionName = `${key.toUpperCase().replace('$', '')}VueGlobals`
369+
writeLine(contents, `import { ${injectionName}, QSingletonGlobals } from "./globals";`)
370370
writeLine(contents, `declare module "./globals" {`)
371-
writeLine(contents, `export interface ${ injectionName } {`)
371+
writeLine(contents, `export interface ${injectionName} {`)
372372
for (const defKey in injectionDefs) {
373373
writeLines(contents, injectionDefs[defKey], 1)
374374
}

ui/build/build.web-types.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ module.exports.generate = function (data) {
3737
html: {
3838
'types-syntax': 'typescript',
3939
tags: data.components.map(({ api: { events, props, scopedSlots, slots, meta }, name }) => {
40-
let slotTypes = []
40+
const slotTypes = []
4141
if (slots) {
4242
Object.entries(slots).forEach(([name, slotApi]) => {
4343
slotTypes.push({
@@ -71,7 +71,7 @@ module.exports.generate = function (data) {
7171
symbol: name
7272
},
7373
attributes: props && Object.entries(props).map(([name, propApi]) => {
74-
let result = {
74+
const result = {
7575
name,
7676
value: {
7777
kind: 'expression',
@@ -122,8 +122,8 @@ module.exports.generate = function (data) {
122122
return result
123123
}),
124124
attributes: data.directives.map(({ name, api: { modifiers, value, meta } }) => {
125-
let valueType = value.type
126-
let result = {
125+
const valueType = value.type
126+
const result = {
127127
name: 'v-' + kebabCase(name),
128128
source: {
129129
module: 'quasar',
@@ -151,7 +151,7 @@ module.exports.generate = function (data) {
151151
}
152152
}
153153
}, null, 2)
154-
let webTypesPath = path.resolve(__dirname, '../dist/web-types')
154+
const webTypesPath = path.resolve(__dirname, '../dist/web-types')
155155

156156
if (!fs.existsSync(webTypesPath)) {
157157
fs.mkdirSync(webTypesPath)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export default {
106106
selectableNodes (v) {
107107
this.selected = v
108108
? this.selected || null
109-
: undefined
109+
: void 0
110110
}
111111
},
112112
data () {

ui/dev/src/pages/form/date-part1-basic.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ export default {
419419
persian (val) {
420420
if (val === true) {
421421
this.date = '1397/08/12'
422-
this.nullDate = undefined
422+
this.nullDate = void 0
423423
this.defaultYearMonth = '1364/11'
424424
}
425425
else {

ui/src/components/editor/QEditor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ export default Vue.extend({
537537
},
538538
domProps: isSSR
539539
? { innerHTML: this.value }
540-
: undefined,
540+
: void 0,
541541
on
542542
}
543543
)

ui/src/ie-compat/ie.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,15 @@ typeof window !== 'undefined' && (function (window) {
5959
Object.defineProperty(Object, 'assign', {
6060
value: function assign (target, varArgs) { // .length of function is 2
6161
'use strict'
62-
if (target === null || target === undefined) {
62+
if (target === null || target === void 0) {
6363
throw new TypeError('Cannot convert undefined or null to object')
6464
}
6565

6666
var to = Object(target)
6767

6868
for (var index = 1; index < arguments.length; index++) {
6969
var nextSource = arguments[index]
70-
if (nextSource !== null && nextSource !== undefined) {
70+
if (nextSource !== null && nextSource !== void 0) {
7171
for (var nextKey in nextSource) {
7272
// Avoid bugs when hasOwnProperty is shadowed
7373
if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
@@ -302,7 +302,7 @@ function setAsap(asapFn) {
302302
asap = asapFn;
303303
}
304304

305-
var browserWindow = typeof window !== 'undefined' ? window : undefined;
305+
var browserWindow = typeof window !== 'undefined' ? window : void 0;
306306
var browserGlobal = browserWindow || {};
307307
var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
308308
var isNode = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';
@@ -367,8 +367,8 @@ function flush() {
367367

368368
callback(arg);
369369

370-
queue[i] = undefined;
371-
queue[i + 1] = undefined;
370+
queue[i] = void 0;
371+
queue[i + 1] = void 0;
372372
}
373373

374374
len = 0;
@@ -392,7 +392,7 @@ if (isNode) {
392392
scheduleFlush = useMutationObserver();
393393
} else if (isWorker) {
394394
scheduleFlush = useMessageChannel();
395-
} else if (browserWindow === undefined && typeof require === 'function') {
395+
} else if (browserWindow === void 0 && typeof require === 'function') {
396396
scheduleFlush = attemptVertx();
397397
} else {
398398
scheduleFlush = useSetTimeout();
@@ -403,7 +403,7 @@ function then(onFulfillment, onRejection) {
403403

404404
var child = new this.constructor(noop);
405405

406-
if (child[PROMISE_ID] === undefined) {
406+
if (child[PROMISE_ID] === void 0) {
407407
makePromise(child);
408408
}
409409

@@ -536,7 +536,7 @@ function handleOwnThenable(promise, thenable) {
536536
} else if (thenable._state === REJECTED) {
537537
reject(promise, thenable._result);
538538
} else {
539-
subscribe(thenable, undefined, function (value) {
539+
subscribe(thenable, void 0, function (value) {
540540
return resolve(promise, value);
541541
}, function (reason) {
542542
return reject(promise, reason);
@@ -551,7 +551,7 @@ function handleMaybeThenable(promise, maybeThenable, then$$1) {
551551
if (then$$1 === TRY_CATCH_ERROR) {
552552
reject(promise, TRY_CATCH_ERROR.error);
553553
TRY_CATCH_ERROR.error = null;
554-
} else if (then$$1 === undefined) {
554+
} else if (then$$1 === void 0) {
555555
fulfill(promise, maybeThenable);
556556
} else if (isFunction(then$$1)) {
557557
handleForeignThenable(promise, maybeThenable, then$$1);
@@ -712,8 +712,8 @@ function nextId() {
712712

713713
function makePromise(promise) {
714714
promise[PROMISE_ID] = id++;
715-
promise._state = undefined;
716-
promise._result = undefined;
715+
promise._state = void 0;
716+
promise._result = void 0;
717717
promise._subscribers = [];
718718
}
719719

@@ -805,7 +805,7 @@ var Enumerator = function () {
805805
Enumerator.prototype._willSettleAt = function _willSettleAt(promise, i) {
806806
var enumerator = this;
807807

808-
subscribe(promise, undefined, function (value) {
808+
subscribe(promise, void 0, function (value) {
809809
return enumerator._settledAt(FULFILLED, i, value);
810810
}, function (reason) {
811811
return enumerator._settledAt(REJECTED, i, reason);
@@ -1106,7 +1106,7 @@ function needsNew() {
11061106
var Promise$2 = function () {
11071107
function Promise(resolver) {
11081108
this[PROMISE_ID] = nextId();
1109-
this._result = this._state = undefined;
1109+
this._result = this._state = void 0;
11101110
this._subscribers = [];
11111111

11121112
if (noop !== resolver) {

ui/src/install.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export default function (Vue, opts = {}) {
5656

5757
opts.directives && Object.keys(opts.directives).forEach(key => {
5858
const d = opts.directives[key]
59-
if (d.name !== undefined && d.unbind !== void 0) {
59+
if (d.name !== void 0 && d.unbind !== void 0) {
6060
Vue.directive(d.name, d)
6161
}
6262
})

ui/src/plugins/Cookies.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ function set (key, val, opts = {}, ssr) {
111111

112112
if (expire !== void 0 && expireValue < 0) {
113113
const val = get(key, ssr)
114-
if (val !== undefined) {
114+
if (val !== void 0) {
115115
all = all
116116
.replace(`${key}=${val}; `, '')
117117
.replace(`; ${key}=${val}`, '')

0 commit comments

Comments
 (0)