1
0
Fork 0

chore: Linter

This commit is contained in:
Joost De Cock 2021-01-31 09:22:15 +01:00
parent adb9e93024
commit 1a46c8e724
227 changed files with 660 additions and 936 deletions

View file

@ -5,7 +5,7 @@ export default {
name: name,
version: version,
hooks: {
preDraft: function(pattern) {
preDraft: function (pattern) {
if (typeof pattern.settings.measurements === 'undefined')
return pattern.debug({
type: 'error',
@ -35,7 +35,7 @@ export default {
}
}
},
postDraft: function(pattern) {
postDraft: function (pattern) {
for (let partId in pattern.parts) {
let part = pattern.parts[partId]
let { debug } = part.shorthand()

View file

@ -1,6 +1,6 @@
const validate = {}
validate.point = function(point, partId, pointId, debug) {
validate.point = function (point, partId, pointId, debug) {
if (typeof point !== 'object') {
debug({
type: 'error',
@ -47,7 +47,7 @@ validate.point = function(point, partId, pointId, debug) {
return true
}
validate.text = function(type, item, partId, itemId, debug) {
validate.text = function (type, item, partId, itemId, debug) {
let text = item.attributes.getAsArray('data-text')
if (text === false) return true
else {
@ -86,7 +86,7 @@ validate.text = function(type, item, partId, itemId, debug) {
return true
}
validate.path = function(path, partId, pathId, debug) {
validate.path = function (path, partId, pathId, debug) {
if (typeof path !== 'object') {
debug({
type: 'error',
@ -173,7 +173,7 @@ validate.path = function(path, partId, pathId, debug) {
return true
}
validate.snippet = function(snippet, partId, snippetId, debug) {
validate.snippet = function (snippet, partId, snippetId, debug) {
if (typeof snippet !== 'object') return false
if (!validate.point(snippet.anchor, partId, '_unknown_', debug)) return false
if (typeof snippet.attributes !== 'object') return false