Skip to content

Commit

Permalink
Fix eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dflock committed Jan 14, 2017
1 parent 2a17ce6 commit 6cfde46
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions src/fields/abstractField.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,22 +100,22 @@ export default {
getFieldID(schema) {
// Try to get a reasonable default id from the schema,
// then slugify it.
if (typeof schema.id !== 'undefined') {
if (typeof schema.id !== "undefined") {
// If an ID's been explicitly set, use it unchanged
return schema.id
return schema.id;
} else {
return (schema.inputName || schema.label || schema.model)
.toString()
.trim()
.toLowerCase()
// Spaces to dashes
.replace(/ /g, '-')
.replace(/ /g, "-")
// Multiple dashes to one
.replace(/-{2,}/g, '-')
.replace(/-{2,}/g, "-")
// Remove leading & trailing dashes
.replace(/^-+|-+$/g, '')
.replace(/^-+|-+$/g, "")
// Remove anything that isn't a (English/ASCII) letter or number.
.replace(/([^a-zA-Z0-9\._-]+)/g, '')
.replace(/([^a-zA-Z0-9\._-]+)/g, "")
;
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/formGenerator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,11 @@ div
// Should field type have a label?
fieldTypeHasLabel(field) {
switch (field.type) {
case 'button':
case 'submit':
return false;
default:
return true;
case "button":
case "submit":
return false;
default:
return true;
}
},
Expand Down

0 comments on commit 6cfde46

Please sign in to comment.