Skip to content

Commit a5fcd5a

Browse files
authored
chore(lint): enable linting on docs files (nuxt#1638)
1 parent aba2d22 commit a5fcd5a

File tree

7 files changed

+32
-23
lines changed

7 files changed

+32
-23
lines changed

.eslintignore

-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ node_modules
33
schema
44
**/*.tmpl.*
55
sw.js
6-
docs

docs/.eslintrc

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"settings": {
3+
"import/ignore": [
4+
"vue"
5+
]
6+
}
7+
}

docs/components/app/AlgoliaSearchBox.vue

+17-15
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</template>
1717

1818
<script>
19-
function isSpecialClick(event) {
19+
function isSpecialClick (event) {
2020
return event.button === 1 || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey
2121
}
2222
@@ -32,26 +32,26 @@ export default {
3232
}
3333
},
3434
watch: {
35-
'$i18n.locale'(newValue) {
35+
'$i18n.locale' (newValue) {
3636
this.update(this.options, newValue)
3737
},
38-
options(newValue) {
38+
options (newValue) {
3939
this.update(newValue, this.$i18n.locale)
4040
}
4141
},
42-
mounted() {
42+
mounted () {
4343
this.initialize(this.options, this.$i18n.locale)
4444
},
4545
methods: {
46-
stripTrailingSlash(url) {
46+
stripTrailingSlash (url) {
4747
return url.replace(/\/$|\/(?=\?)|\/(?=#)/g, '')
4848
},
49-
getRelativePath(absoluteUrl) {
49+
getRelativePath (absoluteUrl) {
5050
const { pathname, hash } = new URL(absoluteUrl)
5151
const url = pathname.replace(this.settings.url, '/') + hash
5252
return this.stripTrailingSlash(url)
5353
},
54-
async initialize(userOptions, code) {
54+
async initialize (userOptions, code) {
5555
const lang = this.$i18n.locales.find(locale => locale.code === code)
5656
5757
const docsearch = await Promise.all([
@@ -63,11 +63,13 @@ export default {
6363
...userOptions,
6464
container: '#docsearch',
6565
searchParameters: {
66-
...((!lang) ? {} : {
67-
facetFilters: [`${userOptions.langAttribute || 'language'}:${lang.iso}`].concat(
68-
userOptions.facetFilters || []
69-
)
70-
}),
66+
...((!lang)
67+
? {}
68+
: {
69+
facetFilters: [`${userOptions.langAttribute || 'language'}:${lang.iso}`].concat(
70+
userOptions.facetFilters || []
71+
)
72+
})
7173
},
7274
navigator: {
7375
navigate: ({ itemUrl }) => {
@@ -97,7 +99,7 @@ export default {
9799
__v: 1,
98100
props: {
99101
href: hit.url,
100-
children: children,
102+
children,
101103
onClick: (event) => {
102104
if (isSpecialClick(event)) {
103105
return
@@ -119,13 +121,13 @@ export default {
119121
}
120122
121123
this.$router.push(hit.url)
122-
},
124+
}
123125
}
124126
}
125127
}
126128
})
127129
},
128-
update(options, lang) {
130+
update (options, lang) {
129131
return this.initialize(options, lang)
130132
}
131133
}

docs/components/app/AsideNavigation.vue

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
:key="link.to"
3030
:title="link.title"
3131
:docs="link.children"
32-
:collapse.sync="link.collapse"
32+
:collapse="link.collapse"
33+
@update:collapse="link.collapse = $event"
3334
/>
3435
<AsideNavigationItem v-else :key="link.to" :docs="[link]" />
3536
</template>

docs/components/atoms/logo/LogoVercel.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
>
1010
<path d="M80.0761 12L159.152 148.965H1L80.0761 12Z" fill="currentColor" />
1111
</svg>
12-
</template?
12+
</template>

docs/components/molecules/HomeHero.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export default {
7777
}
7878
</script>
7979

80-
<style>
80+
<style lang="postcss">
8181
.highlight-box {
8282
@apply transition-shadow duration-300;
8383

docs/docus.config.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ export default {
66
template: 'docs',
77
twitter: 'nuxt_js',
88
algolia: {
9-
appId: "BH4D9OD16A",
10-
container: "#docsearch",
11-
apiKey: "ff80fbf046ce827f64f06e16f82f1401",
12-
indexName: "nuxtjs",
9+
appId: 'BH4D9OD16A',
10+
container: '#docsearch',
11+
apiKey: 'ff80fbf046ce827f64f06e16f82f1401',
12+
indexName: 'nuxtjs',
1313
facetFilters: ['tags:v3']
1414
},
1515
github: {

0 commit comments

Comments
 (0)