Skip to content

Commit 4ba4a36

Browse files
authored
Merge pull request #5 from edumudu/develop
lint
2 parents 77c0439 + 44712b9 commit 4ba4a36

File tree

7 files changed

+98
-33
lines changed

7 files changed

+98
-33
lines changed

.eslintrc.js

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,36 @@
11
module.exports = {
22
root: true,
3-
env: {
4-
node: true,
5-
},
3+
env: { node: true },
64
extends: [
75
'plugin:vue/essential',
86
'@vue/airbnb',
97
'@vue/typescript/recommended',
108
],
11-
parserOptions: {
12-
ecmaVersion: 2020,
13-
},
9+
parserOptions: { ecmaVersion: 2020 },
1410
rules: {
1511
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
1612
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
1713
'max-len': ['error', 120],
1814
'import/prefer-default-export': 'off',
1915
'object-curly-newline': ['error', {
20-
'ObjectExpression': { 'multiline': true },
21-
'ObjectPattern': { 'multiline': true },
22-
'ImportDeclaration': 'never',
23-
'ExportDeclaration': { 'multiline': true, 'minProperties': 5 }
24-
}]
16+
ObjectExpression: {
17+
multiline: true, minProperties: 2,
18+
},
19+
ObjectPattern: { multiline: true },
20+
ImportDeclaration: 'never',
21+
ExportDeclaration: {
22+
multiline: true,
23+
minProperties: 5,
24+
},
25+
}],
2526
},
2627
overrides: [
2728
{
2829
files: [
2930
'**/__tests__/*.{j,t}s?(x)',
3031
'**/tests/unit/**/*.spec.{j,t}s?(x)',
3132
],
32-
env: {
33-
mocha: true,
34-
},
33+
env: { mocha: true },
3534
},
3635
],
3736
};

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,15 @@
3131
"eslint": "^6.7.2",
3232
"eslint-plugin-import": "^2.20.2",
3333
"eslint-plugin-vue": "^6.2.2",
34+
"husky": "^4.3.0",
3435
"node-sass": "^4.12.0",
3536
"sass-loader": "^8.0.2",
3637
"typescript": "~3.9.3",
3738
"vue-template-compiler": "^2.6.11"
39+
},
40+
"husky": {
41+
"hooks": {
42+
"pre-commit": "yarn lint"
43+
}
3844
}
3945
}

src/components/editor/VEditorBody.vue

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,7 @@
99
</template>
1010

1111
<script lang="ts">
12-
import {
13-
defineComponent,
14-
onBeforeUnmount,
15-
ref,
16-
SetupContext,
17-
} from '@vue/composition-api';
12+
import { defineComponent, onBeforeUnmount, ref, SetupContext } from '@vue/composition-api';
1813
import { useSelection } from '@/shared/selection';
1914
import { rgbToHex } from '@/shared/color';
2015

src/components/editor/VEditorHead.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@
2121
</template>
2222

2323
<script lang="ts">
24-
import {
25-
defineComponent, reactive, ref, SetupContext,
26-
} from '@vue/composition-api';
24+
import { defineComponent, reactive, SetupContext } from '@vue/composition-api';
2725
import VEditorGroup from '@/components/editor/group/VEditorGroup.vue';
2826
import { CommandsItem } from '@/@types/index';
2927

src/main.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@ Vue.use(VueCompositionAPI);
66

77
Vue.config.productionTip = false;
88

9-
new Vue({
10-
render: (h) => h(App),
11-
}).$mount('#app');
9+
new Vue({ render: (h) => h(App) }).$mount('#app');

vue.config.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
module.exports = {
2-
publicPath: process.env.NODE_ENV === 'production' ? '/vue-text-editor/' : '/',
3-
};
1+
module.exports = { publicPath: process.env.NODE_ENV === 'production' ? '/vue-text-editor/' : '/' };

yarn.lock

Lines changed: 75 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2583,7 +2583,7 @@ chalk@^3.0.0:
25832583
ansi-styles "^4.1.0"
25842584
supports-color "^7.1.0"
25852585

2586-
chalk@^4.1.0:
2586+
chalk@^4.0.0, chalk@^4.1.0:
25872587
version "4.1.0"
25882588
resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a"
25892589
integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==
@@ -2657,6 +2657,11 @@ ci-info@^1.5.0:
26572657
resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.6.0.tgz#2ca20dbb9ceb32d4524a683303313f0304b1e497"
26582658
integrity sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A==
26592659

2660+
ci-info@^2.0.0:
2661+
version "2.0.0"
2662+
resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46"
2663+
integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==
2664+
26602665
cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3:
26612666
version "1.0.4"
26622667
resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de"
@@ -2858,6 +2863,11 @@ commondir@^1.0.1:
28582863
resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b"
28592864
integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=
28602865

2866+
compare-versions@^3.6.0:
2867+
version "3.6.0"
2868+
resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-3.6.0.tgz#1a5689913685e5a87637b8d3ffca75514ec41d62"
2869+
integrity sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==
2870+
28612871
component-emitter@^1.2.1:
28622872
version "1.3.0"
28632873
resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0"
@@ -3060,6 +3070,17 @@ cosmiconfig@^6.0.0:
30603070
path-type "^4.0.0"
30613071
yaml "^1.7.2"
30623072

3073+
cosmiconfig@^7.0.0:
3074+
version "7.0.0"
3075+
resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.0.0.tgz#ef9b44d773959cae63ddecd122de23853b60f8d3"
3076+
integrity sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA==
3077+
dependencies:
3078+
"@types/parse-json" "^4.0.0"
3079+
import-fresh "^3.2.1"
3080+
parse-json "^5.0.0"
3081+
path-type "^4.0.0"
3082+
yaml "^1.10.0"
3083+
30633084
create-ecdh@^4.0.0:
30643085
version "4.0.4"
30653086
resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.4.tgz#d6e7f4bffa66736085a0762fd3a632684dabcc4e"
@@ -4457,6 +4478,13 @@ find-up@^4.0.0, find-up@^4.1.0:
44574478
locate-path "^5.0.0"
44584479
path-exists "^4.0.0"
44594480

4481+
find-versions@^3.2.0:
4482+
version "3.2.0"
4483+
resolved "https://registry.yarnpkg.com/find-versions/-/find-versions-3.2.0.tgz#10297f98030a786829681690545ef659ed1d254e"
4484+
integrity sha512-P8WRou2S+oe222TOCHitLy8zj+SIsVJh52VP4lvXkaFVnOFFdoWv1H1Jjvel1aI6NCFOAaeAVm8qrI0odiLcww==
4485+
dependencies:
4486+
semver-regex "^2.0.0"
4487+
44604488
flat-cache@^2.0.1:
44614489
version "2.0.1"
44624490
resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0"
@@ -5167,6 +5195,22 @@ human-signals@^1.1.1:
51675195
resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3"
51685196
integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==
51695197

5198+
husky@^4.3.0:
5199+
version "4.3.0"
5200+
resolved "https://registry.yarnpkg.com/husky/-/husky-4.3.0.tgz#0b2ec1d66424e9219d359e26a51c58ec5278f0de"
5201+
integrity sha512-tTMeLCLqSBqnflBZnlVDhpaIMucSGaYyX6855jM4AguGeWCeSzNdb1mfyWduTZ3pe3SJVvVWGL0jO1iKZVPfTA==
5202+
dependencies:
5203+
chalk "^4.0.0"
5204+
ci-info "^2.0.0"
5205+
compare-versions "^3.6.0"
5206+
cosmiconfig "^7.0.0"
5207+
find-versions "^3.2.0"
5208+
opencollective-postinstall "^2.0.2"
5209+
pkg-dir "^4.2.0"
5210+
please-upgrade-node "^3.2.0"
5211+
slash "^3.0.0"
5212+
which-pm-runs "^1.0.0"
5213+
51705214
[email protected], iconv-lite@^0.4.24:
51715215
version "0.4.24"
51725216
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
@@ -5221,7 +5265,7 @@ import-fresh@^2.0.0:
52215265
caller-path "^2.0.0"
52225266
resolve-from "^3.0.0"
52235267

5224-
import-fresh@^3.0.0, import-fresh@^3.1.0:
5268+
import-fresh@^3.0.0, import-fresh@^3.1.0, import-fresh@^3.2.1:
52255269
version "3.2.1"
52265270
resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.2.1.tgz#633ff618506e793af5ac91bf48b72677e15cbe66"
52275271
integrity sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==
@@ -6957,6 +7001,11 @@ open@^6.3.0:
69577001
dependencies:
69587002
is-wsl "^1.1.0"
69597003

7004+
opencollective-postinstall@^2.0.2:
7005+
version "2.0.3"
7006+
resolved "https://registry.yarnpkg.com/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz#7a0fff978f6dbfa4d006238fbac98ed4198c3259"
7007+
integrity sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==
7008+
69607009
opener@^1.5.1:
69617010
version "1.5.2"
69627011
resolved "https://registry.yarnpkg.com/opener/-/opener-1.5.2.tgz#5d37e1f35077b9dcac4301372271afdeb2a13598"
@@ -7347,13 +7396,20 @@ pkg-dir@^3.0.0:
73477396
dependencies:
73487397
find-up "^3.0.0"
73497398

7350-
pkg-dir@^4.1.0:
7399+
pkg-dir@^4.1.0, pkg-dir@^4.2.0:
73517400
version "4.2.0"
73527401
resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3"
73537402
integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==
73547403
dependencies:
73557404
find-up "^4.0.0"
73567405

7406+
please-upgrade-node@^3.2.0:
7407+
version "3.2.0"
7408+
resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz#aeddd3f994c933e4ad98b99d9a556efa0e2fe942"
7409+
integrity sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==
7410+
dependencies:
7411+
semver-compare "^1.0.0"
7412+
73577413
pn@^1.1.0:
73587414
version "1.1.0"
73597415
resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb"
@@ -8393,6 +8449,16 @@ selfsigned@^1.10.7:
83938449
dependencies:
83948450
node-forge "^0.10.0"
83958451

8452+
semver-compare@^1.0.0:
8453+
version "1.0.0"
8454+
resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc"
8455+
integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w=
8456+
8457+
semver-regex@^2.0.0:
8458+
version "2.0.0"
8459+
resolved "https://registry.yarnpkg.com/semver-regex/-/semver-regex-2.0.0.tgz#a93c2c5844539a770233379107b38c7b4ac9d338"
8460+
integrity sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw==
8461+
83968462
"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0, semver@^5.7.0, semver@^5.7.1:
83978463
version "5.7.1"
83988464
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
@@ -9955,6 +10021,11 @@ which-module@^2.0.0:
995510021
resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a"
995610022
integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=
995710023

10024+
which-pm-runs@^1.0.0:
10025+
version "1.0.0"
10026+
resolved "https://registry.yarnpkg.com/which-pm-runs/-/which-pm-runs-1.0.0.tgz#670b3afbc552e0b55df6b7780ca74615f23ad1cb"
10027+
integrity sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=
10028+
995810029
which@1, [email protected], which@^1.2.9:
995910030
version "1.3.1"
996010031
resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a"
@@ -10072,7 +10143,7 @@ yallist@^4.0.0:
1007210143
resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"
1007310144
integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==
1007410145

10075-
yaml@^1.7.2:
10146+
yaml@^1.10.0, yaml@^1.7.2:
1007610147
version "1.10.0"
1007710148
resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.0.tgz#3b593add944876077d4d683fee01081bd9fff31e"
1007810149
integrity sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg==

0 commit comments

Comments
 (0)