diff --git a/package.json b/package.json index a88f7a57b..9b65fb20b 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "jest": "^24.9.0", "lint-staged": "^8.2.1", "npm-run-all": "^4.1.5", - "prettier": "^1.18.2", + "prettier": "^2.4.1", "sass": "^1.42.1", "sinon": "^7.5.0", "vuepress": "^1.8.2", @@ -66,7 +66,7 @@ }, "lint-staged": { "{src,test}/**/*.js": [ - "prettier --single-quote --print-width 100 --write", + "prettier --single-quote --print-width 120 --arrow-parens avoid --write", "git add" ] }, diff --git a/src/style_manager/index.js b/src/style_manager/index.js index 7eafd21fc..56457868e 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -69,7 +69,7 @@ export default () => { events: { all: evAll, propertyUpdate: evPropUp, - custom: evCustom + custom: evCustom, }, name: 'StyleManager', @@ -96,21 +96,14 @@ export default () => { properties = new Properties(); sectors = new Sectors([], c); this.model = new Model({ targets: [] }); - const ev = - 'component:toggled component:update:classes change:state change:device frame:resized selector:type'; - this.model.listenTo( - em, - ev, - debounce(() => this.__upSel()) - ); - this.model.listenTo( - em, - 'styleable:change', - debounce(() => { - this.__upProps(); - this.__trgCustom(); - }) - ); + const ev = 'component:toggled component:update:classes change:state change:device frame:resized selector:type'; + const upAll = debounce(() => this.__upSel()); + const upProps = debounce(() => { + this.__upProps(); + this.__trgCustom(); + }); + this.model.listenTo(em, ev, upAll); + this.model.listenTo(em, 'styleable:change', upProps); return this; }, @@ -264,9 +257,7 @@ export default () => { let prop; if (sector) { - prop = sector - .get('properties') - .filter(prop => prop.get('property') === name || prop.get('id') === name)[0]; + prop = sector.get('properties').filter(prop => prop.get('property') === name || prop.get('id') === name)[0]; } return prop || null; @@ -466,7 +457,7 @@ export default () => { return new type.view({ model: new type.model(model), config: c, - ...view + ...view, }); } }, @@ -546,7 +537,7 @@ export default () => { el, collection: sectors, target: c.em, - config: c + config: c, }); return SectView.render().el; }, @@ -564,7 +555,7 @@ export default () => { const style = lastTarget.getStyle(); const parentStyles = lastTargetParents.map(p => ({ target: p, - style: p.getStyle() + style: p.getStyle(), })); sectors.map(sector => { @@ -599,6 +590,6 @@ export default () => { SectView && SectView.remove(); [c, properties, sectors, SectView].forEach(i => (i = {})); this.em = {}; - } + }, }; }; diff --git a/yarn.lock b/yarn.lock index a1869b0fb..65c5a06a7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2975,10 +2975,6 @@ caseless@~0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" -cash-dom@^2.3.9: - version "2.3.9" - resolved "https://registry.yarnpkg.com/cash-dom/-/cash-dom-2.3.9.tgz#ff2e29cf3b3202e62596e1e8bb52edb95ea79fec" - ccount@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/ccount/-/ccount-1.1.0.tgz#246687debb6014735131be8abab2d93898f8d043" @@ -9002,6 +8998,10 @@ prettier@^1.18.2: version "1.19.1" resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" +prettier@^2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.4.1.tgz#671e11c89c14a4cfc876ce564106c4a6726c9f5c" + pretty-error@^2.0.2, pretty-error@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/pretty-error/-/pretty-error-2.1.2.tgz#be89f82d81b1c86ec8fdfbc385045882727f93b6" @@ -10348,13 +10348,6 @@ string-length@^2.0.0: astral-regex "^1.0.0" strip-ansi "^4.0.0" -string-replace-loader@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/string-replace-loader/-/string-replace-loader-2.3.0.tgz#7f29be7d73c94dd92eccd5c5a15651181d7ecd3d" - dependencies: - loader-utils "^1.2.3" - schema-utils "^2.6.5" - string-template@~0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/string-template/-/string-template-0.2.1.tgz#42932e598a352d01fc22ec3367d9d84eec6c9add"