Skip to content

Commit 1deb997

Browse files
authored
Introduce Prettier (#96)
1 parent ed6d66b commit 1deb997

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1955
-1283
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
!docs/.vuepress
12
docs/.vuepress/dist

.eslintrc.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ module.exports = {
77
mocha: true
88
},
99
extends: [
10-
'plugin:vue-libs/recommended'
11-
],
12-
plugins: [
10+
'plugin:vue-libs/recommended',
11+
'plugin:prettier/recommended',
12+
'prettier',
13+
'prettier/vue'
1314
],
15+
plugins: [],
1416
parserOptions: {
1517
ecmaVersion: 2015
1618
},

.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
semi: false
2+
singleQuote: true
3+
printWidth: 80
4+
trailingComma: none
5+
arrowParens: "avoid"

docs/.eslintrc.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,5 @@
22

33
module.exports = {
44
extends: '../.eslintrc.js',
5-
plugins: [
6-
'markdown'
7-
]
5+
plugins: ['markdown']
86
}

docs/.vuepress/components/sponsor-button.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
<template>
22
<p class="sponsor-button">
3-
<github-button href="https://github.com/sponsors/kazupon" data-icon="octicon-heart" data-size="large" aria-label="Sponsor @kazupon on GitHub">
3+
<github-button
4+
href="https://github.com/sponsors/kazupon"
5+
data-icon="octicon-heart"
6+
data-size="large"
7+
aria-label="Sponsor @kazupon on GitHub"
8+
>
49
Sponsor on GitHub
510
</github-button>
611
</p>

docs/.vuepress/config.js

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ module.exports = {
1414
description: 'ESLint plugin for Vue I18n',
1515
serviceWorker: true,
1616
evergreen: true,
17-
head: [
18-
['meta', { name: 'theme-color', content: '#3eaf7c' }]
19-
],
17+
head: [['meta', { name: 'theme-color', content: '#3eaf7c' }]],
2018
themeConfig: {
2119
repo: 'intlify/eslint-plugin-vue-i18n',
2220
docsRepo: 'intlify/eslint-plugin-vue-i18n',
@@ -28,19 +26,25 @@ module.exports = {
2826
serviceWorker: {
2927
updatePopup: true
3028
},
31-
nav: [{
32-
text: 'Support Intlify',
33-
items: [{
34-
text: 'GitHub Sponsors',
35-
link: 'https://github.com/sponsors/kazupon'
36-
}, {
37-
text: 'Patreon',
38-
link: 'https://www.patreon.com/kazupon'
39-
}]
40-
}, {
41-
text: 'Release Notes',
42-
link: 'https://github.com/intlify/eslint-plugin-vue-i18n/releases'
43-
}],
29+
nav: [
30+
{
31+
text: 'Support Intlify',
32+
items: [
33+
{
34+
text: 'GitHub Sponsors',
35+
link: 'https://github.com/sponsors/kazupon'
36+
},
37+
{
38+
text: 'Patreon',
39+
link: 'https://www.patreon.com/kazupon'
40+
}
41+
]
42+
},
43+
{
44+
text: 'Release Notes',
45+
link: 'https://github.com/intlify/eslint-plugin-vue-i18n/releases'
46+
}
47+
],
4448
sidebar: {
4549
'/': [
4650
'/',

docs/rules/no-dynamic-keys.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ You can be detected with this rule the following:
1515
- `$tc`
1616
- `tc`
1717
- `v-t`
18-
- `<i18n>`
18+
- `<i18n>`
1919

2020
:-1: Examples of **incorrect** code for this rule:
2121

@@ -54,7 +54,7 @@ const i18n = new VueI18n({
5454

5555
const app = new Vue({
5656
i18n,
57-
data () {
57+
data() {
5858
return { msg: 'hello' }
5959
}
6060
})
@@ -100,7 +100,7 @@ const i18n = new VueI18n({
100100

101101
new Vue({
102102
i18n,
103-
data () {
103+
data() {
104104
return { msg: 'hello' }
105105
}
106106
})

docs/rules/no-html-messages.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ const i18n = new VueI18n({
108108

109109
new Vue({
110110
i18n,
111-
data () {
111+
data() {
112112
return {
113113
bannerURL: 'https://banner.domain.com',
114114
modalDataURL: 'https://fetch.domain.com'
@@ -125,4 +125,4 @@ If you are certain the localization message is trusted, you can disable this rul
125125
## :books: Further reading
126126

127127
- [XSS in Vue.js](https://blog.sqreen.io/xss-in-vue-js/)
128-
- [Analysis of a Supply Chain Attack](https://medium.com/@hkparker/analysis-of-a-supply-chain-attack-2bd8fa8286ac)
128+
- [Analysis of a Supply Chain Attack](https://medium.com/@hkparker/analysis-of-a-supply-chain-attack-2bd8fa8286ac)

docs/rules/no-raw-text.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default {
3333
```js
3434
export default {
3535
// ✗ BAD
36-
render: h => (<p>hello</p>)
36+
render: h => <p>hello</p>
3737
// ...
3838
}
3939
```
@@ -61,7 +61,7 @@ export default {
6161
```js
6262
export default {
6363
// ✓ GOOD
64-
render: h => (<p>{this.$t('hello')}</p>)
64+
render: h => <p>{this.$t('hello')}</p>
6565
// ...
6666
}
6767
```

docs/started.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,18 @@ For example:
2323
module.export = {
2424
extends: [
2525
'eslint:recommended',
26+
// Recommended
2627
'plugin:@intlify/vue-i18n/recommended'
2728
],
2829
rules: {
2930
// Optional.
3031
'@intlify/vue-i18n/no-dynamic-keys': 'error',
31-
'@intlify/vue-i18n/no-unused-keys': ['error', {
32-
extensions: ['.js', '.vue']
33-
}]
32+
'@intlify/vue-i18n/no-unused-keys': [
33+
'error',
34+
{
35+
extensions: ['.js', '.vue']
36+
}
37+
]
3438
},
3539
settings: {
3640
'vue-i18n': {

0 commit comments

Comments
 (0)