chore: Linter run
This commit is contained in:
parent
220b0ee0a7
commit
0b1137f09b
49 changed files with 192 additions and 201 deletions
|
@ -4,13 +4,12 @@ import Pattern from './pattern'
|
|||
const hide = () => false
|
||||
|
||||
export default function Design(config, plugins = false, conditionalPlugins = false) {
|
||||
|
||||
// Add default hide() method to config.options
|
||||
for (const option in config.options) {
|
||||
if (typeof config.options[option] === 'object') {
|
||||
config.options[option] = {
|
||||
hide,
|
||||
...config.options[option]
|
||||
...config.options[option],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ function Part() {
|
|||
this.height = false
|
||||
this.render = true
|
||||
this.utils = utils
|
||||
this.layout = { move: { x: 0, y:0 }}
|
||||
this.layout = { move: { x: 0, y: 0 } }
|
||||
|
||||
this.Point = Point
|
||||
this.Path = Path
|
||||
|
|
|
@ -130,9 +130,7 @@ Path.prototype.attr = function (name, value, overwrite = false) {
|
|||
'Called `Path.attr(name, value, overwrite=false)` but `name` is undefined or false'
|
||||
)
|
||||
if (typeof value === 'undefined')
|
||||
this.raise.warning(
|
||||
'Called `Path.attr(name, value, overwrite=false)` but `value` is undefined'
|
||||
)
|
||||
this.raise.warning('Called `Path.attr(name, value, overwrite=false)` but `value` is undefined')
|
||||
if (overwrite)
|
||||
this.raise.debug(
|
||||
`Overwriting \`Path.attribute.${name}\` with ${value} (was: ${this.attributes.get(name)})`
|
||||
|
|
|
@ -68,7 +68,6 @@ export default function Pattern(config = { options: {} }) {
|
|||
this.Snippet = Snippet // Snippet constructor
|
||||
this.Attributes = Attributes // Attributes constructor
|
||||
|
||||
|
||||
if (typeof this.config.dependencies === 'undefined') this.config.dependencies = {}
|
||||
if (typeof this.config.inject === 'undefined') this.config.inject = {}
|
||||
if (typeof this.config.hide === 'undefined') this.config.hide = []
|
||||
|
@ -514,12 +513,13 @@ Pattern.prototype.pack = function () {
|
|||
part.attr('transform', `translate(${bin.x}, ${bin.y})`)
|
||||
this.autoLayout.parts[bin.id].move = {
|
||||
x: bin.x + part.layout.move.x,
|
||||
y: bin.y + part.layout.move.y }
|
||||
}
|
||||
else this.autoLayout.parts[bin.id].move = {
|
||||
x: part.layout.move.x,
|
||||
y: part.layout.move.y,
|
||||
}
|
||||
y: bin.y + part.layout.move.y,
|
||||
}
|
||||
} else
|
||||
this.autoLayout.parts[bin.id].move = {
|
||||
x: part.layout.move.x,
|
||||
y: part.layout.move.y,
|
||||
}
|
||||
}
|
||||
this.width = size.width
|
||||
this.height = size.height
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue