Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
Refine configurations for the vue-i18n eslint plugin (#1252)
Browse files Browse the repository at this point in the history
  • Loading branch information
krysal authored Apr 11, 2022
1 parent 2fe5c4d commit 3fab476
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 78 deletions.
20 changes: 20 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,20 @@ module.exports = {
},
],
'import/extensions': ['error', 'always', { js: 'never', ts: 'never' }],
'@intlify/vue-i18n/no-raw-text': [
'error',
{
ignoreText: [
// Brand names that should not be translated
'Common Crawl',
'Creative Commons',
'Europeana',
'Flickr',
'Openverse',
'WordPress',
],
},
],
},
overrides: [
{
Expand All @@ -169,6 +183,12 @@ module.exports = {
'tsdoc/syntax': 'warn',
},
},
{
files: ['*.spec.js'],
rules: {
'@intlify/vue-i18n/no-raw-text': ['off'],
},
},
],
settings: {
'vue-i18n': {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"test:storybook:debug": "PWDEBUG=1 pnpm test:storybook:local",
"test:storybook:gen": "playwright codegen localhost:54000/",
"types": "vue-tsc --noEmit",
"lint": "prettier --check .; eslint --ext .js,.vue,.ts --ignore-path .gitignore --ignore-path .eslintignore .",
"lint": "prettier --check .; eslint --ext .js,.vue,.ts --ignore-path .gitignore --ignore-path .eslintignore --max-warnings=0 .",
"lint:fix": "prettier --write --loglevel=warn .; pnpm lint -- --fix",
"i18n": "pnpm i18n:create-locales-list && pnpm i18n:get-translations && pnpm i18n:update-locales",
"i18n:no-get": "pnpm i18n:create-locales-list && pnpm i18n:update-locales",
Expand Down
3 changes: 0 additions & 3 deletions src/components/VFourOhFour.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<template>
<main class="bg-yellow h-screen relative page-404 overflow-x-hidden">
<VLink href="/" class="relative z-10 text-dark-charcoal">
<!-- eslint-disable-next-line @intlify/vue-i18n/no-raw-text -->
<span class="sr-only">Openverse</span>
<span
class="flex flex-row pt-6 lg:pt-8 ms-6 lg:ms-10 h-auto w-30 text-dark-charcoal"
Expand All @@ -24,13 +23,11 @@
<p class="font-semibold">
<i18n path="404.main">
<template #link>
<!-- eslint-disable @intlify/vue-i18n/no-raw-text -->
<VLink
class="underline text-current hover:text-current active:text-current"
href="/"
>Openverse</VLink
>
<!-- eslint-enable @intlify/vue-i18n/no-raw-text -->
</template>
</i18n>
</p>
Expand Down
1 change: 0 additions & 1 deletion src/components/VMetaSearch/VMetaSearchForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
tag="h4"
class="b-header mb-2"
>
<!-- eslint-disable-next-line @intlify/vue-i18n/no-raw-text -->
<template #openverse>Openverse</template>
<template #type>
{{ type }}
Expand Down
Loading

0 comments on commit 3fab476

Please sign in to comment.