Skip to content

Commit 9923f7e

Browse files
committed
lint and prettier config
1 parent 3836783 commit 9923f7e

File tree

8 files changed

+516
-107
lines changed

8 files changed

+516
-107
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ module.exports = {
1616
"no-console": process.env.NODE_ENV === "production" ? "error" : "off",
1717
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
1818
},
19-
};
19+
}

babel.config.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
module.exports = {
2-
presets: [
3-
'@vue/app'
4-
]
2+
presets: ["@vue/app"],
53
}

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,17 @@
1313
"vue": "^2.6.12"
1414
},
1515
"devDependencies": {
16-
"eslint": "^6.7.2",
17-
"eslint-plugin-prettier": "^3.1.3",
18-
"eslint-plugin-vue": "^6.2.2",
16+
"@babel/core": "^7.13.0",
1917
"@vue/cli-plugin-babel": "~4.5.0",
2018
"@vue/cli-plugin-eslint": "~4.5.0",
21-
"@vue/eslint-config-prettier": "^6.0.0",
2219
"@vue/cli-service": "~4.5.0",
23-
"@babel/core": "^7.13.0",
20+
"@vue/eslint-config-prettier": "^6.0.0",
21+
"eslint": "^6.7.2",
22+
"eslint-plugin-prettier": "^3.1.3",
23+
"eslint-plugin-vue": "^6.2.2",
2424
"knacss": "^7.0.7",
25+
"prettier": "^2.2.1",
26+
"prettier-eslint": "^12.0.0",
2527
"sass": "^1.26.5",
2628
"sass-loader": "^8.0.2",
2729
"vue-template-compiler": "^2.6.11"

postcss.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
22
plugins: {
3-
autoprefixer: {}
4-
}
3+
autoprefixer: {},
4+
},
55
}

src/App.vue

Lines changed: 103 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -3,80 +3,101 @@
33
<div class="header">
44
<h1>Vue-tag-selector demo</h1>
55
</div>
6-
<p class="hero">Here's the demo for <a href="https://github.com/tomquinonero/vue-tag-selector">vue-tag-selector</a>,
7-
an amazing and light vuejs component.<br><br>
8-
<a href="https://github.com/tomquinonero/vue-tag-selector">vue-tag-selector on github</a> |
9-
<a href="https://www.npmjs.com/package/vue-tag-selector">vue-tag-selector on npm</a>
6+
<p class="hero">
7+
Here's the demo for
8+
<a href="https://github.com/tomquinonero/vue-tag-selector"
9+
>vue-tag-selector</a
10+
>, an amazing and light vuejs component.<br /><br />
11+
<a href="https://github.com/tomquinonero/vue-tag-selector"
12+
>vue-tag-selector on github</a
13+
>
14+
|
15+
<a href="https://www.npmjs.com/package/vue-tag-selector"
16+
>vue-tag-selector on npm</a
17+
>
1018
</p>
1119

12-
<hr>
20+
<hr />
1321

1422
<h2 id="styles">Using styles</h2>
15-
<p>The component philosophy is pretty straightforward here: only the mandatory style is bundled.<br/>
16-
I personally never liked js library that needs too much CSS. <br/>
17-
Only 26 lines of CSS here 😉.<br/>
18-
But you can easily stylize the component and there's examples of it:</p>
23+
<p>
24+
The component philosophy is pretty straightforward here: only the
25+
mandatory style is bundled.<br />
26+
I personally never liked js library that needs too much CSS. <br />
27+
Only 26 lines of CSS here 😉.<br />
28+
But you can easily stylize the component and there's examples of it:
29+
</p>
1930
<div class="grid-7">
2031
<div class="col-2 returned-values">
2132
<code>
22-
{{tags1}}
33+
{{ tags1 }}
2334
</code>
2435
</div>
2536
<div class="col-5">
2637
<ol start="1">
2738
<li>
2839
<h4>No style example</h4>
2940
<p>The component will look like this without any style added.</p>
30-
<vue-tag-selector
31-
label="Post tags"
32-
v-model="tags1"
33-
name="tags" />
41+
<vue-tag-selector label="Post tags" v-model="tags1" name="tags" />
3442
</li>
3543
</ol>
3644
</div>
3745
<div class="col-2 returned-values">
3846
<code>
39-
{{tags1}}
47+
{{ tags1 }}
4048
</code>
4149
</div>
4250
<div class="col-5">
4351
<ol start="2">
4452
<li class="theme-material">
4553
<h4>Material theme example</h4>
46-
<p>A basic material design theme. You can download the css for it <a href="https://raw.githubusercontent.com/tomquinonero/vue-tag-selector/master/src/assets/theme_material.css" target="_blank" rel="noopener noreferrer">here</a>.</p>
47-
<vue-tag-selector
48-
label="Post tags"
49-
v-model="tags1"
50-
name="tags" />
54+
<p>
55+
A basic material design theme. You can download the css for it
56+
<a
57+
href="https://raw.githubusercontent.com/tomquinonero/vue-tag-selector/master/src/assets/theme_material.css"
58+
target="_blank"
59+
rel="noopener noreferrer"
60+
>here</a
61+
>.
62+
</p>
63+
<vue-tag-selector label="Post tags" v-model="tags1" name="tags" />
5164
</li>
5265
</ol>
5366
</div>
5467
<div class="col-2 returned-values">
5568
<code>
56-
{{tags1}}
69+
{{ tags1 }}
5770
</code>
5871
</div>
5972
<div class="col-5">
6073
<ol start="3">
6174
<li class="theme-example">
6275
<h4>Look goods theme example</h4>
63-
<p>A home cooked colored theme. We are gonna use it for the next examples. You can download the css for it <a href="https://raw.githubusercontent.com/tomquinonero/vue-tag-selector/master/src/assets/theme_looking-good.css" target="_blank" rel="noopener noreferrer">here</a>.</p>
64-
<vue-tag-selector
65-
label="Post tags:"
66-
v-model="tags1"
67-
name="tags" />
76+
<p>
77+
A home cooked colored theme. We are gonna use it for the next
78+
examples. You can download the css for it
79+
<a
80+
href="https://raw.githubusercontent.com/tomquinonero/vue-tag-selector/master/src/assets/theme_looking-good.css"
81+
target="_blank"
82+
rel="noopener noreferrer"
83+
>here</a
84+
>.
85+
</p>
86+
<vue-tag-selector label="Post tags:" v-model="tags1" name="tags" />
6887
</li>
6988
</ol>
7089
</div>
7190
</div>
72-
<hr>
91+
<hr />
7392
<h2 id="styles">Regex validations</h2>
74-
<p>Vue-tag-selector is providing a regex props for validating tags.<br/>
75-
You can also specify a message for the case it fails.</p>
76-
<div class="grid-7">
93+
<p>
94+
Vue-tag-selector is providing a regex props for validating tags.<br />
95+
You can also specify a message for the case it fails.
96+
</p>
97+
<div class="grid-7">
7798
<div class="col-2 returned-values">
7899
<code>
79-
{{tags3}}
100+
{{ tags3 }}
80101
</code>
81102
</div>
82103
<div class="col-5">
@@ -86,18 +107,19 @@
86107
<vue-tag-selector
87108
label="Add friends with their username:"
88109
v-model="tags3"
89-
name="tags"
90-
:regex="/^[a-z_\-]*$/g"
91-
regex-message="The username must only contains lowercase letter and underscores."/>
110+
name="tags"
111+
:regex="/^[a-z_\-]*$/g"
112+
regex-message="The username must only contains lowercase letter and underscores."
113+
/>
92114
</li>
93115
</ol>
94116
</div>
95-
<div class="col-2">
96-
<code>
97-
{{tags2}}
98-
</code>
99-
</div>
100-
<div class="col-5">
117+
<div class="col-2">
118+
<code>
119+
{{ tags2 }}
120+
</code>
121+
</div>
122+
<div class="col-5">
101123
<ol start="5">
102124
<li class="theme-example">
103125
<h4>Only email addresses</h4>
@@ -106,52 +128,53 @@
106128
v-model="tags2"
107129
name="tags"
108130
:regex="/^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/g"
109-
regex-message="The email fromat is invalid."/>
131+
regex-message="The email fromat is invalid."
132+
/>
110133
</li>
111134
</ol>
135+
</div>
112136
</div>
113-
</div>
114-
115-
<br/>
116-
<br/>
137+
138+
<br />
139+
<br />
117140
</div>
118141
</template>
119142

120143
<script>
121-
import VueTagSelector from './components/VueTagSelector'
122-
import './assets/theme_material.css'
123-
import './../node_modules/knacss/css/grillade-grid.css'
144+
import VueTagSelector from "./components/VueTagSelector"
145+
import "./assets/theme_material.css"
146+
import "./../node_modules/knacss/css/grillade-grid.css"
124147
125148
export default {
126-
name: 'app',
127-
data(){
128-
return{
149+
name: "app",
150+
data() {
151+
return {
129152
tags1: ["Blog", "High-Tech", "Vuejs", "#twitter"],
130153
tags2: ["tom@gmail.com", "support@example.com", "notify@service.net"],
131154
tags3: ["blog", "high_tech"],
132155
}
133156
},
134157
components: {
135-
VueTagSelector
136-
}
158+
VueTagSelector,
159+
},
137160
}
138161
</script>
139162

140163
<style lang="scss">
141164
#app {
142-
font-family: 'Avenir', Helvetica, Arial, sans-serif;
165+
font-family: "Avenir", Helvetica, Arial, sans-serif;
143166
-webkit-font-smoothing: antialiased;
144167
-moz-osx-font-smoothing: grayscale;
145168
color: #2c3e50;
146169
margin: 0 auto;
147170
margin-top: 40px;
148171
padding: 20px;
149172
max-width: 800px;
150-
.header{
173+
.header {
151174
text-align: center;
152175
margin-bottom: 40px;
153176
}
154-
h1{
177+
h1 {
155178
font-size: 32px;
156179
background: #faf730;
157180
color: #df2323;
@@ -164,7 +187,7 @@ export default {
164187
display: inline-block;
165188
}
166189
167-
h2{
190+
h2 {
168191
font-size: 28px;
169192
background: #faf730;
170193
color: #df2323;
@@ -175,7 +198,7 @@ export default {
175198
display: inline-block;
176199
}
177200
178-
h4{
201+
h4 {
179202
margin-top: 0;
180203
font-style: 28px;
181204
text-transform: uppercase;
@@ -188,36 +211,36 @@ export default {
188211
// box-shadow: 5px 5px;
189212
border-bottom: 4px solid #df2323;
190213
}
191-
ul{
214+
ul {
192215
// color: #df2323;
193216
}
194-
li{
217+
li {
195218
margin: 20px;
196219
}
197220
198-
code{
221+
code {
199222
font-size: 18px;
200223
background: #e9e9e9;
201224
display: inline-block;
202225
padding: 5px;
203226
}
204-
.hero{
227+
.hero {
205228
font-size: 1.2em;
206229
font-weight: bold;
207230
text-align: center;
208231
margin-bottom: 50px;
209232
}
210-
a{
211-
color:#df2323;
233+
a {
234+
color: #df2323;
212235
}
213-
hr{
236+
hr {
214237
border: none;
215238
border-bottom: 3px solid #df2323;
216239
}
217240
}
218241
219-
.theme-example{
220-
label{
242+
.theme-example {
243+
label {
221244
color: #df2323;
222245
font-weight: bold;
223246
}
@@ -233,7 +256,7 @@ export default {
233256
box-shadow: 5px 5px;
234257
transition: 150ms all ease-in;
235258
transform-origin: 50% 50%;
236-
&:hover{
259+
&:hover {
237260
animation: rotate_logo 400ms infinite;
238261
}
239262
}
@@ -243,13 +266,13 @@ export default {
243266
height: 24px;
244267
color: #df2323;
245268
line-height: 24px;
246-
svg{
269+
svg {
247270
width: 14px;
248271
height: 14px;
249272
transition: 150ms all ease-in;
250273
}
251-
&:hover{
252-
svg{
274+
&:hover {
275+
svg {
253276
transform: scale(1.2);
254277
transform-origin: center center;
255278
}
@@ -274,21 +297,23 @@ export default {
274297
275298
@keyframes rotate_logo {
276299
20% {
277-
transform: rotate(1deg) translate3d(-3px,2px,0) perspective( 600px ) rotateY( 5deg );
300+
transform: rotate(1deg) translate3d(-3px, 2px, 0) perspective(600px)
301+
rotateY(5deg);
278302
}
279-
303+
280304
40% {
281-
transform: rotate(-2deg) translate3d(1px,1px,0) perspective( 600px ) rotateY( -15deg );
305+
transform: rotate(-2deg) translate3d(1px, 1px, 0) perspective(600px)
306+
rotateY(-15deg);
282307
}
283308
284309
60% {
285-
transform: rotate(2deg) translate3d(3px,-1px,0) perspective( 600px ) rotateY( 15deg );
286-
310+
transform: rotate(2deg) translate3d(3px, -1px, 0) perspective(600px)
311+
rotateY(15deg);
287312
}
288313
289314
80% {
290-
transform: rotate(-2deg) translate3d(-2px,-1px,0) perspective( 600px ) rotateY( -5deg );
315+
transform: rotate(-2deg) translate3d(-2px, -1px, 0) perspective(600px)
316+
rotateY(-5deg);
291317
}
292318
}
293-
294319
</style>

0 commit comments

Comments
 (0)