Skip to content

Commit 5c5f873

Browse files
committed
add TS
1 parent 28162dd commit 5c5f873

File tree

10 files changed

+418
-33
lines changed

10 files changed

+418
-33
lines changed

.eslintrc.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,26 @@
11
module.exports = {
22
root: true,
3+
34
env: {
45
node: true,
56
},
6-
extends: [
7-
"plugin:vue/essential",
8-
"eslint:recommended",
9-
"@vue/prettier",
10-
"@vue/prettier/@typescript-eslint",
11-
],
7+
128
parserOptions: {
139
ecmaVersion: 2020,
10+
parser: '@typescript-eslint/parser',
1411
},
12+
1513
rules: {
1614
"no-console": process.env.NODE_ENV === "production" ? "error" : "off",
1715
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
1816
},
17+
18+
'extends': [
19+
"plugin:vue/essential",
20+
"eslint:recommended",
21+
"@vue/prettier",
22+
"@vue/prettier/@typescript-eslint",
23+
'@vue/typescript',
24+
],
25+
1926
}

package.json

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,32 @@
11
{
22
"name": "vue-tag-selector",
3-
"main": "./dist/lib.common.js",
43
"version": "0.2.5",
54
"scripts": {
65
"serve": "vue-cli-service serve",
76
"build": "vue-cli-service build",
7+
"lint": "vue-cli-service lint",
88
"build-site": "vue-cli-service build --dest site; cp site/index.html index.html; sed -i 's/\\/js/site\\/js/g' index.html",
9-
"bundle": "vue-cli-service build --target lib --name lib ./src/components/VueTagSelector.vue",
10-
"lint": "vue-cli-service lint"
9+
"bundle": "vue-cli-service build --target lib --name lib ./src/components/VueTagSelector.vue"
1110
},
11+
"main": "./dist/lib.common.js",
12+
"files": [
13+
"dist/*",
14+
"src/*",
15+
"*.json"
16+
],
1217
"dependencies": {
1318
"vue": "^2.6.12"
1419
},
1520
"devDependencies": {
1621
"@babel/core": "^7.13.0",
22+
"@typescript-eslint/eslint-plugin": "^2.33.0",
23+
"@typescript-eslint/parser": "^2.33.0",
1724
"@vue/cli-plugin-babel": "~4.5.0",
1825
"@vue/cli-plugin-eslint": "~4.5.0",
26+
"@vue/cli-plugin-typescript": "~4.5.0",
1927
"@vue/cli-service": "~4.5.0",
2028
"@vue/eslint-config-prettier": "^6.0.0",
29+
"@vue/eslint-config-typescript": "^5.0.2",
2130
"eslint": "^6.7.2",
2231
"eslint-plugin-prettier": "^3.1.3",
2332
"eslint-plugin-vue": "^6.2.2",
@@ -26,11 +35,7 @@
2635
"prettier-eslint": "^12.0.0",
2736
"sass": "^1.26.5",
2837
"sass-loader": "^8.0.2",
38+
"typescript": "~3.9.3",
2939
"vue-template-compiler": "^2.6.11"
30-
},
31-
"files": [
32-
"dist/*",
33-
"src/*",
34-
"*.json"
35-
]
40+
}
3641
}
File renamed without changes.
File renamed without changes.

src/assets/theme_looking-good.css

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
.theme-looking-good label {
2+
color: #df2323;
3+
font-weight: bold;
4+
}
5+
.theme-looking-good .tag-selector--input {
6+
border: none;
7+
}
8+
.theme-looking-good .tag-selector--item {
9+
background: #faf730;
10+
color: #df2323;
11+
margin-right: 8px;
12+
padding-left: 12px;
13+
font-weight: bold;
14+
box-shadow: 5px 5px;
15+
transition: 150ms all ease-in;
16+
transform-origin: 50% 50%;
17+
}
18+
.theme-looking-good .tag-selector--item:hover {
19+
-webkit-animation: rotate_logo 400ms infinite;
20+
animation: rotate_logo 400ms infinite;
21+
}
22+
.theme-looking-good .tag-selector--remove {
23+
width: 24px;
24+
height: 24px;
25+
color: #df2323;
26+
line-height: 24px;
27+
}
28+
.theme-looking-good .tag-selector--remove svg {
29+
width: 14px;
30+
height: 14px;
31+
transition: 150ms all ease-in;
32+
}
33+
.theme-looking-good .tag-selector--remove:hover svg {
34+
transform: scale(1.2);
35+
transform-origin: center center;
36+
}
37+
.theme-looking-good .tag-selector--item,
38+
.theme-looking-good .tag-selector-input {
39+
height: 32px;
40+
line-height: 32px;
41+
margin-bottom: 8px;
42+
font-size: 14px;
43+
color: #df2323;
44+
font-weight: bold;
45+
}
46+
.theme-looking-good .validation-message {
47+
color: #df2323;
48+
font-weight: bold;
49+
margin-top: 0;
50+
margin-bottom: 15px;
51+
}
File renamed without changes.

src/shims-tsx.d.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import Vue, { VNode } from 'vue'
2+
3+
declare global {
4+
namespace JSX {
5+
// tslint:disable no-empty-interface
6+
interface Element extends VNode {}
7+
// tslint:disable no-empty-interface
8+
interface ElementClass extends Vue {}
9+
interface IntrinsicElements {
10+
[elem: string]: any
11+
}
12+
}
13+
}

src/shims-vue.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
declare module '*.vue' {
2+
import Vue from 'vue'
3+
export default Vue
4+
}

tsconfig.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"compilerOptions": {
3+
"target": "esnext",
4+
"module": "esnext",
5+
"strict": true,
6+
"jsx": "preserve",
7+
"importHelpers": true,
8+
"moduleResolution": "node",
9+
"skipLibCheck": true,
10+
"esModuleInterop": true,
11+
"allowSyntheticDefaultImports": true,
12+
"sourceMap": true,
13+
"baseUrl": ".",
14+
"types": [
15+
"webpack-env"
16+
],
17+
"paths": {
18+
"@/*": [
19+
"src/*"
20+
]
21+
},
22+
"lib": [
23+
"esnext",
24+
"dom",
25+
"dom.iterable",
26+
"scripthost"
27+
]
28+
},
29+
"include": [
30+
"src/**/*.ts",
31+
"src/**/*.tsx",
32+
"src/**/*.vue",
33+
"tests/**/*.ts",
34+
"tests/**/*.tsx"
35+
],
36+
"exclude": [
37+
"node_modules"
38+
]
39+
}

0 commit comments

Comments
 (0)