Skip to content

Commit 38af058

Browse files
committed
fixes jdorn#734 remove unnecessary conole.log() calls; enable eslint rule for no-console
1 parent bcbd57e commit 38af058

File tree

8 files changed

+14
-8
lines changed

8 files changed

+14
-8
lines changed

.eslintrc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
22
"extends":["standard"],
3-
"env": {"browser": true}
4-
}
3+
"env": {"browser": true},
4+
"rules": {
5+
"no-console": "error"
6+
}
7+
}

src/defaults.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ Object.entries(editors).forEach(([i, editor]) => { editors[i].options = editor.o
303303

304304
/* Default upload handler */
305305
function upload (type, file, cbs) {
306+
// eslint-disable-next-line no-console
306307
console.log('Upload handler required for upload editor')
307308
}
308309

src/editors/autocomplete.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export class AutocompleteEditor extends StringEditor {
3030
/* single property options from schema "options.autocomplete" */
3131
options = this.expandCallbacks('autocomplete', extend({}, {
3232
search: (jseditor, input) => {
33+
// eslint-disable-next-line no-console
3334
console.log(`No "search" callback defined for autocomplete in property "${jseditor.key}"`)
3435
return []
3536
},

src/editors/upload.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ export class UploadEditor extends AbstractEditor {
189189
this.preview.appendChild(img)
190190
}
191191
img.onerror = error => {
192+
// eslint-disable-next-line no-console
192193
console.error('upload error', error, error.currentTarget)
193194
}
194195
img.src = this.container.querySelector('a').href

src/schemaloader.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ export class SchemaLoader {
9898
: ''
9999
const ref = this._getRef(fetchUrl, refObj)
100100
if (!this.refs[ref]) { /* if reference not found */
101+
// eslint-disable-next-line no-console
101102
console.warn(`reference:'${ref}' not found!`)
102103
} else if (recurseAllOf && hasOwnProperty(this.refs[ref], 'allOf')) {
103104
const allOf = this.refs[ref].allOf
@@ -224,7 +225,8 @@ export class SchemaLoader {
224225
try {
225226
response = JSON.parse(r.responseText)
226227
} catch (e) {
227-
window.console.log(e)
228+
// eslint-disable-next-line no-console
229+
console.log(e)
228230
throw new Error(`Failed to parse external ref ${fetchUrl}`)
229231
}
230232
if (!(typeof response === 'boolean' || typeof response === 'object') || response === null || Array.isArray(response)) {
@@ -243,7 +245,8 @@ export class SchemaLoader {
243245
}, fetchUrl, fileBase)
244246
} else {
245247
/* Request failed */
246-
window.console.log(r)
248+
// eslint-disable-next-line no-console
249+
console.log(r)
247250
throw new Error(`Failed to fetch ref via ajax- ${url}`)
248251
}
249252
}

src/themes/bootstrap4.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ export class bootstrap4Theme extends AbstractTheme {
246246
if (window.jQuery && window.jQuery().tooltip) {
247247
window.jQuery(button).tooltip()
248248
} else {
249+
// eslint-disable-next-line no-console
249250
console.warn('Could not find popper jQuery plugin of Bootstrap.')
250251
}
251252
} else if (this.options.tooltip === 'css') {

src/themes/spectre.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ export class spectreTheme extends AbstractTheme {
146146
}
147147

148148
getMultiCheckboxHolder (controls, label, description, infoText) {
149-
console.log('mul')
150149
return super.getMultiCheckboxHolder(controls, label, description, infoText)
151150
}
152151

src/validator.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,6 @@ export class Validator {
244244
/* If this item has a specific schema tied to it */
245245
/* Validate against it */
246246
if (schema.items[i]) {
247-
console.log('-->')
248247
errors.push(...this._validateSchema(schema.items[i], value[i], `${path}.${i}`))
249248
/* If all additional items are allowed */
250249
} else if (schema.additionalItems === true) {
@@ -385,8 +384,6 @@ export class Validator {
385384
k = keys[i]
386385
/* Check property names that don't match */
387386
if (typeof schema.propertyNames === 'boolean') {
388-
console.log(schema.propertyNames ? 'TRUE' : 'FALSE')
389-
console.log('*' + k + '*')
390387
if (schema.propertyNames === true) {
391388
continue
392389
}

0 commit comments

Comments
 (0)