Skip to content

Commit

Permalink
chore: reconfigure prettier and update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
rigor789 committed Sep 10, 2019
1 parent b07b513 commit 87631d0
Show file tree
Hide file tree
Showing 8 changed files with 9,775 additions and 4,447 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ root = true

[*]
indent_style = space
indent_size = 4
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
Expand Down
13,540 changes: 9,433 additions & 4,107 deletions package-lock.json

Large diffs are not rendered by default.

56 changes: 35 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@
"bezier-easing": "2.1.0"
},
"devDependencies": {
"@babel/core": "7.3.4",
"@babel/core": "7.6.0",
"@babel/plugin-transform-object-assign": "7.2.0",
"@babel/preset-env": "7.3.4",
"@semantic-release/changelog": "^3.0.4",
"@semantic-release/git": "^7.0.16",
"@vuepress/plugin-google-analytics": "1.0.0-alpha.44",
"lint-staged": "8.1.5",
"@babel/preset-env": "7.6.0",
"@semantic-release/changelog": "3.0.4",
"@semantic-release/git": "7.0.16",
"@vuepress/plugin-google-analytics": "1.0.4",
"lint-staged": "9.2.5",
"pre-commit": "1.2.2",
"prettier": "1.16.4",
"rollup": "1.6.0",
"rollup-plugin-babel": "4.3.2",
"rollup-plugin-commonjs": "9.2.1",
"rollup-plugin-node-resolve": "4.0.1",
"semantic-release": "^15.13.24",
"vuepress": "^1.0.0-alpha.44"
"prettier": "1.18.2",
"rollup": "1.21.2",
"rollup-plugin-babel": "4.3.3",
"rollup-plugin-commonjs": "10.1.0",
"rollup-plugin-node-resolve": "5.2.0",
"semantic-release": "15.13.24",
"vuepress": "1.0.4"
},
"scripts": {
"build": "rollup -c",
Expand All @@ -52,7 +52,7 @@
},
"lint-staged": {
"src/**.js": [
"prettier --write --tab-width=4",
"prettier --write",
"git add"
]
},
Expand All @@ -61,15 +61,29 @@
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
["@semantic-release/changelog", {
"changelogFile": "docs/changelog/README.md"
}],
["@semantic-release/git", {
"assets": ["docs/changelog/README.md"],
"message": "chore(changelog): ${nextRelease.version} [ci skip]"
}],
[
"@semantic-release/changelog",
{
"changelogFile": "docs/changelog/README.md"
}
],
[
"@semantic-release/git",
{
"assets": [
"docs/changelog/README.md"
],
"message": "chore(changelog): ${nextRelease.version} [ci skip]"
}
],
"@semantic-release/npm",
"@semantic-release/github"
]
},
"prettier": {
"semi": false,
"singleQuote": true,
"trailingComma": "es5",
"tabWidth": 2
}
}
88 changes: 44 additions & 44 deletions src/directive.js
Original file line number Diff line number Diff line change
@@ -1,65 +1,65 @@
import scrollTo from "./scrollTo";
import _ from "./utils";
import scrollTo from './scrollTo'
import _ from './utils'

let bindings = []; // store binding data
let bindings = [] // store binding data

function deleteBinding(el) {
for (let i = 0; i < bindings.length; ++i) {
if (bindings[i].el === el) {
bindings.splice(i, 1);
return true;
}
for (let i = 0; i < bindings.length; ++i) {
if (bindings[i].el === el) {
bindings.splice(i, 1)
return true
}
return false;
}
return false
}

function findBinding(el) {
for (let i = 0; i < bindings.length; ++i) {
if (bindings[i].el === el) {
return bindings[i];
}
for (let i = 0; i < bindings.length; ++i) {
if (bindings[i].el === el) {
return bindings[i]
}
}
}

function getBinding(el) {
let binding = findBinding(el);
let binding = findBinding(el)

if (binding) {
return binding;
}
if (binding) {
return binding
}

bindings.push(
binding = {
el: el,
binding: {}
}
);
bindings.push(
(binding = {
el: el,
binding: {},
})
)

return binding;
return binding
}

function handleClick(e) {
e.preventDefault();
let ctx = getBinding(this).binding;
e.preventDefault()
let ctx = getBinding(this).binding

if (typeof ctx.value === "string") {
return scrollTo(ctx.value);
}
scrollTo(ctx.value.el || ctx.value.element, ctx.value);
if (typeof ctx.value === 'string') {
return scrollTo(ctx.value)
}
scrollTo(ctx.value.el || ctx.value.element, ctx.value)
}

export default {
bind(el, binding) {
getBinding(el).binding = binding;
_.on(el, "click", handleClick);
},
unbind(el) {
deleteBinding(el);
_.off(el, "click", handleClick);
},
update(el, binding) {
getBinding(el).binding = binding;
},
scrollTo,
bindings
};
bind(el, binding) {
getBinding(el).binding = binding
_.on(el, 'click', handleClick)
},
unbind(el) {
deleteBinding(el)
_.off(el, 'click', handleClick)
},
update(el, binding) {
getBinding(el).binding = binding
},
scrollTo,
bindings,
}
12 changes: 6 additions & 6 deletions src/easings.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default {
ease: [0.25, 0.1, 0.25, 1.0],
linear: [0.00, 0.0, 1.00, 1.0],
"ease-in": [0.42, 0.0, 1.00, 1.0],
"ease-out": [0.00, 0.0, 0.58, 1.0],
"ease-in-out": [0.42, 0.0, 0.58, 1.0]
};
ease: [0.25, 0.1, 0.25, 1.0],
linear: [0.0, 0.0, 1.0, 1.0],
'ease-in': [0.42, 0.0, 1.0, 1.0],
'ease-out': [0.0, 0.0, 0.58, 1.0],
'ease-in-out': [0.42, 0.0, 0.58, 1.0],
}
24 changes: 12 additions & 12 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import VueScrollTo from "./directive";
import { setDefaults } from "./scrollTo";
import VueScrollTo from './directive'
import { setDefaults } from './scrollTo'

const install = function(Vue, options) {
if (options) setDefaults(options);
Vue.directive("scroll-to", VueScrollTo);
Vue.prototype.$scrollTo = VueScrollTo.scrollTo;
};
if (options) setDefaults(options)
Vue.directive('scroll-to', VueScrollTo)
Vue.prototype.$scrollTo = VueScrollTo.scrollTo
}

if (typeof window !== "undefined" && window.Vue) {
window.VueScrollTo = VueScrollTo;
window.VueScrollTo.setDefaults = setDefaults;
window.Vue.use(install);
if (typeof window !== 'undefined' && window.Vue) {
window.VueScrollTo = VueScrollTo
window.VueScrollTo.setDefaults = setDefaults
window.Vue.use(install)
}

VueScrollTo.install = install;
export default VueScrollTo;
VueScrollTo.install = install
export default VueScrollTo
Loading

0 comments on commit 87631d0

Please sign in to comment.