Skip to content

Commit b977f8f

Browse files
committed
stack upgrade
1 parent b341545 commit b977f8f

File tree

5 files changed

+102
-23
lines changed

5 files changed

+102
-23
lines changed

.eslintrc.json

Lines changed: 85 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,86 @@
11
{
2-
"extends": "./node_modules/shuunen-stack/.eslintrc.json"
3-
}
2+
"env": {
3+
"browser": true,
4+
"es6": true,
5+
"node": true
6+
},
7+
"extends": [
8+
"eslint:recommended",
9+
"plugin:unicorn/recommended",
10+
"plugin:vue/recommended"
11+
],
12+
"parserOptions": {
13+
"ecmaVersion": 2021
14+
},
15+
"plugins": [
16+
"unicorn",
17+
"vue",
18+
"html"
19+
],
20+
"root": true,
21+
"rules": {
22+
"capitalized-comments": "off",
23+
"comma-dangle": [
24+
"error",
25+
"always-multiline"
26+
],
27+
"curly": [
28+
"error",
29+
"multi"
30+
],
31+
"func-names": [
32+
"error",
33+
"always"
34+
],
35+
"import/no-unassigned-import": "off",
36+
"indent": [
37+
"error",
38+
2
39+
],
40+
"lines-between-class-members": "off",
41+
"max-statements-per-line": "off",
42+
"no-console": "off",
43+
"object-curly-spacing": [
44+
"error",
45+
"always"
46+
],
47+
"padding-line-between-statements": "off",
48+
"quote-props": [
49+
"error",
50+
"consistent-as-needed"
51+
],
52+
"quotes": [
53+
"error",
54+
"single"
55+
],
56+
"semi": [
57+
"error",
58+
"never"
59+
],
60+
"space-before-function-paren": [
61+
"error",
62+
"always"
63+
],
64+
"unicorn/no-array-for-each": "off",
65+
"unicorn/no-process-exit": "off",
66+
"unicorn/prefer-module": "off",
67+
"unicorn/prefer-node-protocol": "off",
68+
"unicorn/prefer-switch": "off",
69+
"unicorn/prevent-abbreviations": [
70+
"error",
71+
{
72+
"allowList": {
73+
"args": true,
74+
"pkg": true,
75+
"str": true
76+
}
77+
}
78+
],
79+
"vue/first-attribute-linebreak": "off",
80+
"vue/html-closing-bracket-newline": "off",
81+
"vue/html-self-closing": "off",
82+
"vue/max-attributes-per-line": "off",
83+
"vue/no-multiple-template-root": "off",
84+
"vue/singleline-html-element-content-newline": "off"
85+
}
86+
}

package.json

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@
88
],
99
"description": "Compare two images with a fancy slider",
1010
"devDependencies": {
11-
"npm-run-all": "*",
12-
"shuunen-stack": "^0.14.0",
13-
"vite": "^2.6.13",
14-
"vite-plugin-vue2": "^1.9.0",
15-
"vue": "^2.6.14",
16-
"vue-template-compiler": "^2.6.14"
11+
"eslint": "8.20",
12+
"eslint-plugin-unicorn": "43",
13+
"eslint-plugin-html": "7",
14+
"eslint-plugin-vue": "9",
15+
"vite": "2.9",
16+
"vite-plugin-vue2": "2.0",
17+
"vue": "2.7",
18+
"shuutils": "5.7",
19+
"vue-template-compiler": "2.7"
1720
},
1821
"displayName": "Vue Image Compare",
1922
"files": [
@@ -37,10 +40,10 @@
3740
"url": "https://github.com/Shuunen/vue-image-compare.git"
3841
},
3942
"scripts": {
40-
"build": "vite build",
41-
"ci": "run-s build lint",
43+
"build": "vite build && unique-mark dist/assets/index.*.js",
44+
"ci": "npm run build && npm run lint",
4245
"dev": "vite",
43-
"lint": "stack lint",
46+
"lint": "eslint --fix --ignore-path .gitignore --ext .js,.html,.vue .",
4447
"postversion": "git push && git push --tags && npm publish",
4548
"preversion": "npm run ci",
4649
"serve": "vite preview"

src/app.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<div class="columns">
2525
<div class="column has-text-centered">
2626
<h1 class="title">{{ pkg.displayName }}</h1>
27-
<h2 class="subtitle">version {{ pkg.version }}</h2>
27+
<h2 class="subtitle">__unique-mark__</h2>
2828
<a target="_blank" :href="pkg.homepage">
2929
Project, sources & documentation on GitHub
3030
<i class="fab fa-github" aria-hidden="true" />

src/vue-image-compare.vue

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,8 @@ export default {
231231
let posX = this.pageX - this.$el.getBoundingClientRect().left
232232
const pr = this.padding.right
233233
const pl = this.padding.left
234-
if (posX < pl) {
235-
posX = pl
236-
} else if (posX > this.width - pr) {
237-
posX = this.width - pr
238-
}
234+
if (posX < pl) posX = pl
235+
else if (posX > this.width - pr) posX = this.width - pr
239236
this.posX = posX
240237
}
241238
if (this.isDraggingImage) {
@@ -252,11 +249,8 @@ export default {
252249
if (!this.isZoomable) return
253250
this.mutableZoom += -event.deltaY / 1000
254251
this.$nextTick(() => {
255-
if (this.mutableZoom >= this.zoom.max) {
256-
this.mutableZoom = this.zoom.max
257-
} else if (this.mutableZoom <= this.zoom.min) {
258-
this.mutableZoom = this.zoom.min
259-
}
252+
if (this.mutableZoom >= this.zoom.max) this.mutableZoom = this.zoom.max
253+
else if (this.mutableZoom <= this.zoom.min) this.mutableZoom = this.zoom.min
260254
})
261255
},
262256
onWheelClick () {

vite.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable @typescript-eslint/no-var-requires */
21
const { createVuePlugin } = require('vite-plugin-vue2')
32

43
module.exports = {

0 commit comments

Comments
 (0)