Skip to content

Commit 94d5cce

Browse files
committed
Lint with eslint vue/recommended settings
Signed-off-by: Olga Bulat <obulat@gmail.com>
1 parent 55f1876 commit 94d5cce

20 files changed

+631
-382
lines changed

.eslintrc.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@ module.exports = {
44
node: true
55
},
66
extends: [
7-
'plugin:vue/essential',
7+
'plugin:vue/recommended',
88
'@vue/standard'
99
],
1010
rules: {
1111
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
1212
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
1313
indent: ['error', 4],
14-
'space-before-function-paren': ['warn', 'never']
14+
'space-before-function-paren': ['warn', 'never'],
15+
'vue/require-default-prop': 'off',
16+
'vue/no-v-html': 'off',
17+
'vue/html-indent': ['error', 4]
1518
},
1619
parserOptions: {
1720
parser: 'babel-eslint'

src/App.vue

+19-12
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,32 @@
11
<template>
22
<div id="app">
3-
<Header :title="$t('app.title')"/>
4-
<div class="container" id="site-container">
3+
<Header :title="$t('app.title')" />
4+
<div
5+
id="site-container"
6+
class="container"
7+
>
58
<div class="page-head">
69
<div class="select-license-column">
7-
<h2 class="vocab h2a ha">{{$t('select-license.heading')}}</h2>
8-
<p class="stepper-instructions vocab-body body-bigger">{{$t('select-license.instructions')}}</p>
10+
<h2 class="vocab h2a ha">
11+
{{ $t('select-license.heading') }}
12+
</h2>
13+
<p class="stepper-instructions vocab-body body-bigger">
14+
{{ $t('select-license.instructions') }}
15+
</p>
916
</div>
1017
<LocaleChooser />
1118
</div>
1219
<div class="columns">
1320
<Stepper v-model="currentStepId" />
14-
<div class="column" >
21+
<div class="column">
1522
<div class="fixed-right-column">
16-
<SelectedLicenseCard
17-
v-if="showLicense"
18-
/>
19-
<LicenseUseCard
20-
v-if="showLicenseUse"
21-
/>
22-
<HelpSection />
23+
<SelectedLicenseCard
24+
v-if="showLicense"
25+
/>
26+
<LicenseUseCard
27+
v-if="showLicenseUse"
28+
/>
29+
<HelpSection />
2330
</div>
2431
</div>
2532
</div>

src/components/AttributionDetailsStep.vue

+18-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
<template>
2-
<div class="step-actions" v-if="this.status==='current'">
3-
<p class="attribution-details-instructions">{{$t('stepper.AD.instructions')}}</p>
2+
<div
3+
v-if="status==='current'"
4+
class="step-actions"
5+
>
6+
<p class="attribution-details-instructions">
7+
{{ $t('stepper.AD.instructions') }}
8+
</p>
49
<form class="attribution-details-form">
510
<b-field :label="this.$t('stepper.AD.form.creator-name.label')">
611
<b-input
@@ -27,17 +32,21 @@
2732
/>
2833
</b-field>
2934
</form>
30-
</div>
35+
</div>
3136
</template>
3237

3338
<script>
3439
import { mapMutations, mapState } from 'vuex'
3540
3641
export default {
3742
name: 'AttributionDetails',
38-
props: ['status'],
39-
methods: {
40-
...mapMutations(['setCreatorName', 'setCreatorProfileUrl', 'setWorkTitle', 'setWorkUrl'])
43+
props: {
44+
status: {
45+
type: String,
46+
validator(value) {
47+
return ['current', 'previous', 'inactive'].includes(value)
48+
}
49+
}
4150
},
4251
computed: {
4352
...mapState(['attributionDetails']),
@@ -65,6 +74,9 @@ export default {
6574
this.setWorkUrl(newVal)
6675
}
6776
}
77+
},
78+
methods: {
79+
...mapMutations(['setCreatorName', 'setCreatorProfileUrl', 'setWorkTitle', 'setWorkUrl'])
6880
}
6981
7082
}

src/components/CopyrightWaiverStep.vue

+23-8
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
<template>
22
<div>
3-
<div class="step-description vocab-body body-normal"
4-
v-if="this.status==='previous'">
5-
<p class="vocab-body body-normal">{{$t('stepper.CW.selected')}}</p>
3+
<div
4+
v-if="status==='previous'"
5+
class="step-description vocab-body body-normal"
6+
>
7+
<p class="vocab-body body-normal">
8+
{{ $t('stepper.CW.selected') }}
9+
</p>
610
</div>
7-
<div class="step-actions" v-else-if="this.status==='current'">
11+
<div
12+
v-else-if="status==='current'"
13+
class="step-actions"
14+
>
815
<b-checkbox v-model="copyrightWaiverAgreed">
9-
{{$t('stepper.CW.copyright-waive-agreement')}}
16+
{{ $t('stepper.CW.copyright-waive-agreement') }}
1017
</b-checkbox>
11-
<textarea :value="this.$t('cc0-waiver.text')" :class="'waiver-textarea'" />
18+
<textarea
19+
:value="this.$t('cc0-waiver.text')"
20+
:class="'waiver-textarea'"
21+
/>
1222
<b-checkbox v-model="copyrightWaiverConfirmed">
13-
{{$t("stepper.CW.copyright-waive-confirmation")}}
23+
{{ $t("stepper.CW.copyright-waive-confirmation") }}
1424
</b-checkbox>
1525
</div>
1626
</div>
@@ -23,7 +33,12 @@ export default {
2333
stepId: Number,
2434
stepName: String,
2535
selected: Boolean,
26-
status: String
36+
status: {
37+
type: String,
38+
validator(value) {
39+
return ['current', 'previous', 'inactive'].includes(value)
40+
}
41+
}
2742
},
2843
data() {
2944
return {

src/components/DropdownStep.vue

+20-10
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
<template>
22
<div>
3-
<div class="step-description" v-if="this.status==='previous'">
4-
{{cardText}}
3+
<div
4+
v-if="status==='previous'"
5+
class="step-description"
6+
>
7+
{{ cardText }}
58
</div>
6-
<div class="step-actions" v-else-if="this.status==='current'">
9+
<div
10+
v-else-if="status==='current'"
11+
class="step-actions"
12+
>
713
<LicenseDropdown @input="updateSelected" />
814
</div>
915
</div>
10-
1116
</template>
1217

1318
<script>
@@ -17,19 +22,24 @@ export default {
1722
name: 'DropdownStep',
1823
components: { LicenseDropdown },
1924
props: {
20-
status: String,
25+
status: {
26+
type: String,
27+
validator(value) {
28+
return ['current', 'previous', 'inactive'].includes(value)
29+
}
30+
},
2131
stepId: Number
2232
},
23-
methods: {
24-
updateSelected() {
25-
this.$emit('input', 'DD', this.$props.stepId, true)
26-
}
27-
},
2833
computed: {
2934
...mapGetters(['fullName']),
3035
cardText() {
3136
return this.fullName
3237
}
38+
},
39+
methods: {
40+
updateSelected() {
41+
this.$emit('input', 'DD', this.$props.stepId, true)
42+
}
3343
}
3444
}
3545
</script>

src/components/Feedback.vue

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
<template>
22
<div id="feedback">
3-
<p>
4-
The new Creative Commons License Chooser is still in active development, and we would like to know what you think!
5-
</p>
6-
<b>Please give us your feedback by <a href="https://docs.google.com/forms/d/e/1FAIpQLSfF7MCKxlPsPuMn17v_sLYWMkxBkudQSPXCXoJKjh5GCtx63g/viewform" class="anim_link-underline">filling out this short Google Form</a>!</b>
3+
<p>
4+
The new Creative Commons License Chooser is still in active development, and we would like to know what you think!
5+
</p>
6+
<b>Please give us your feedback by <a
7+
href="https://docs.google.com/forms/d/e/1FAIpQLSfF7MCKxlPsPuMn17v_sLYWMkxBkudQSPXCXoJKjh5GCtx63g/viewform"
8+
class="anim_link-underline"
9+
>filling out this short Google Form</a>!</b>
710
</div>
811
</template>
912
<script>

src/components/FirstStep.vue

+33-11
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,41 @@
11
<template>
22
<div>
3-
<p class="step-description vocab-body body-normal" v-if="this.status==='previous'">
4-
{{$t(cardText)}}
3+
<p
4+
v-if="status==='previous'"
5+
class="step-description vocab-body body-normal"
6+
>
7+
{{ $t(cardText) }}
58
</p>
6-
<div class="step-actions" v-else-if="this.status==='current'">
7-
<div class="field" :class="yesSelected">
8-
<b-radio v-model="radio"
9-
native-value="yes">
10-
<span class="vocab-body body-normal" v-html="$t(yesText)" />
9+
<div
10+
v-else-if="status==='current'"
11+
class="step-actions"
12+
>
13+
<div
14+
class="field"
15+
:class="yesSelected"
16+
>
17+
<b-radio
18+
v-model="radio"
19+
native-value="yes"
20+
>
21+
<span
22+
class="vocab-body body-normal"
23+
v-html="$t(yesText)"
24+
/>
1125
</b-radio>
1226
</div>
13-
<div class="field" :class="noSelected">
14-
<b-radio v-model="radio"
15-
native-value="no">
16-
<span class="vocab-body body-normal" v-html="$t(noText)" />
27+
<div
28+
class="field"
29+
:class="noSelected"
30+
>
31+
<b-radio
32+
v-model="radio"
33+
native-value="no"
34+
>
35+
<span
36+
class="vocab-body body-normal"
37+
v-html="$t(noText)"
38+
/>
1739
</b-radio>
1840
</div>
1941
</div>

src/components/Footer.vue

+31-9
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,45 @@
22
<footer class="footer chooser-footer">
33
<div class="container chooser-footer-container">
44
<section class="cc-info-column">
5-
<img src="../assets/cc-logo_white.png" :alt="$t('alt.cc-logo')" class="footer-cc-logo">
6-
<p class="vocab-body-normal no-bottom-margin">Creative Commons</p>
7-
<p class="vocab-body-normal">PO Box 1866, Mountain View, CA 94042</p>
8-
<p class="vocab-body-normal"><a href="mailto:info@creativecommons.org">info@creativecommons.org</a></p>
9-
<p class="vocab-body-normal"><a href="tel:+1-415-429-6753">+1-415-429-6753</a></p>
5+
<img
6+
src="../assets/cc-logo_white.png"
7+
:alt="$t('alt.cc-logo')"
8+
class="footer-cc-logo"
9+
>
10+
<p class="vocab-body-normal no-bottom-margin">
11+
Creative Commons
12+
</p>
13+
<p class="vocab-body-normal">
14+
PO Box 1866, Mountain View, CA 94042
15+
</p>
16+
<p class="vocab-body-normal">
17+
<a href="mailto:info@creativecommons.org">info@creativecommons.org</a>
18+
</p>
19+
<p class="vocab-body-normal">
20+
<a href="tel:+1-415-429-6753">+1-415-429-6753</a>
21+
</p>
1022
</section>
1123
<section class="middle-column">
12-
<p class="footer-licensing-text" v-html="$t('footer.licensing.text')" />
24+
<p
25+
class="footer-licensing-text"
26+
v-html="$t('footer.licensing.text')"
27+
/>
1328
<p class="footer-license-icons">
1429
<img src="../assets/license-icons/icon-cc_white.png">
1530
<img src="../assets/license-icons/icon-by-white.png">
1631
</p>
17-
<p class="footer-contribute-link" v-html="$t('footer.contribute')" />
32+
<p
33+
class="footer-contribute-link"
34+
v-html="$t('footer.contribute')"
35+
/>
1836
</section>
1937
<section class="donation-column">
20-
<h4 class="vocab ha h4a">{{$t('footer.donation.header')}}</h4>
21-
<p class="vocab-body-normal">{{$t('footer.donation.call')}}</p>
38+
<h4 class="vocab ha h4a">
39+
{{ $t('footer.donation.header') }}
40+
</h4>
41+
<p class="vocab-body-normal">
42+
{{ $t('footer.donation.call') }}
43+
</p>
2244
</section>
2345
</div>
2446
</footer>

src/components/Header.vue

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
<template>
2-
<b-navbar wrapperClass="container">
2+
<b-navbar wrapper-class="container">
33
<template slot="brand">
44
<b-navbar-item>
55
<img
66
src="https://creativecommons.org/wp-content/uploads/2016/05/cc-site-icon-300x300.png"
77
alt="Creative Commons License chooser"
88
>
9-
<h1 class="app-heading">{{$t('app.title')}}</h1>
9+
<h1 class="app-heading">
10+
{{ $t('app.title') }}
11+
</h1>
1012
</b-navbar-item>
1113
</template>
1214
<template slot="end">
1315
<b-navbar-item
1416
href="https://docs.google.com/forms/d/e/1FAIpQLSfF7MCKxlPsPuMn17v_sLYWMkxBkudQSPXCXoJKjh5GCtx63g/viewform"
1517
title="Feedback"
16-
:class="'navbar-item-feedback'">
17-
{{$t('header.nav-feedback')}}
18+
:class="'navbar-item-feedback'"
19+
>
20+
{{ $t('header.nav-feedback') }}
1821
</b-navbar-item>
1922
</template>
2023
</b-navbar>

0 commit comments

Comments
 (0)