Skip to content

Commit

Permalink
chore(lint): enable linting on docs files (nuxt#1638)
Browse files Browse the repository at this point in the history
  • Loading branch information
clarkdo authored Nov 2, 2021
1 parent aba2d22 commit a5fcd5a
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 23 deletions.
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ node_modules
schema
**/*.tmpl.*
sw.js
docs
7 changes: 7 additions & 0 deletions docs/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"settings": {
"import/ignore": [
"vue"
]
}
}
32 changes: 17 additions & 15 deletions docs/components/app/AlgoliaSearchBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</template>

<script>
function isSpecialClick(event) {
function isSpecialClick (event) {
return event.button === 1 || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey
}
Expand All @@ -32,26 +32,26 @@ export default {
}
},
watch: {
'$i18n.locale'(newValue) {
'$i18n.locale' (newValue) {
this.update(this.options, newValue)
},
options(newValue) {
options (newValue) {
this.update(newValue, this.$i18n.locale)
}
},
mounted() {
mounted () {
this.initialize(this.options, this.$i18n.locale)
},
methods: {
stripTrailingSlash(url) {
stripTrailingSlash (url) {
return url.replace(/\/$|\/(?=\?)|\/(?=#)/g, '')
},
getRelativePath(absoluteUrl) {
getRelativePath (absoluteUrl) {
const { pathname, hash } = new URL(absoluteUrl)
const url = pathname.replace(this.settings.url, '/') + hash
return this.stripTrailingSlash(url)
},
async initialize(userOptions, code) {
async initialize (userOptions, code) {
const lang = this.$i18n.locales.find(locale => locale.code === code)
const docsearch = await Promise.all([
Expand All @@ -63,11 +63,13 @@ export default {
...userOptions,
container: '#docsearch',
searchParameters: {
...((!lang) ? {} : {
facetFilters: [`${userOptions.langAttribute || 'language'}:${lang.iso}`].concat(
userOptions.facetFilters || []
)
}),
...((!lang)
? {}
: {
facetFilters: [`${userOptions.langAttribute || 'language'}:${lang.iso}`].concat(
userOptions.facetFilters || []
)
})
},
navigator: {
navigate: ({ itemUrl }) => {
Expand Down Expand Up @@ -97,7 +99,7 @@ export default {
__v: 1,
props: {
href: hit.url,
children: children,
children,
onClick: (event) => {
if (isSpecialClick(event)) {
return
Expand All @@ -119,13 +121,13 @@ export default {
}
this.$router.push(hit.url)
},
}
}
}
}
})
},
update(options, lang) {
update (options, lang) {
return this.initialize(options, lang)
}
}
Expand Down
3 changes: 2 additions & 1 deletion docs/components/app/AsideNavigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
:key="link.to"
:title="link.title"
:docs="link.children"
:collapse.sync="link.collapse"
:collapse="link.collapse"
@update:collapse="link.collapse = $event"
/>
<AsideNavigationItem v-else :key="link.to" :docs="[link]" />
</template>
Expand Down
2 changes: 1 addition & 1 deletion docs/components/atoms/logo/LogoVercel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
>
<path d="M80.0761 12L159.152 148.965H1L80.0761 12Z" fill="currentColor" />
</svg>
</template?
</template>
2 changes: 1 addition & 1 deletion docs/components/molecules/HomeHero.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default {
}
</script>

<style>
<style lang="postcss">
.highlight-box {
@apply transition-shadow duration-300;
Expand Down
8 changes: 4 additions & 4 deletions docs/docus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ export default {
template: 'docs',
twitter: 'nuxt_js',
algolia: {
appId: "BH4D9OD16A",
container: "#docsearch",
apiKey: "ff80fbf046ce827f64f06e16f82f1401",
indexName: "nuxtjs",
appId: 'BH4D9OD16A',
container: '#docsearch',
apiKey: 'ff80fbf046ce827f64f06e16f82f1401',
indexName: 'nuxtjs',
facetFilters: ['tags:v3']
},
github: {
Expand Down

0 comments on commit a5fcd5a

Please sign in to comment.