Skip to content

Commit

Permalink
Upgrade ESLint, vuejs/eslint-config-typescript
Browse files Browse the repository at this point in the history
Closes #355
  • Loading branch information
bkis committed Oct 18, 2024
1 parent e989d4c commit 02be4b1
Show file tree
Hide file tree
Showing 61 changed files with 1,078 additions and 752 deletions.
9 changes: 1 addition & 8 deletions Tekst-API/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -12863,14 +12863,7 @@
"$ref": "#/components/schemas/TranslationLocaleKey"
},
"translation": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"type": "string",
"title": "Translation"
}
},
Expand Down
4 changes: 2 additions & 2 deletions Tekst-API/tekst/models/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ class TextLevelTranslation(TranslationBase):

class ResourceCategoryTranslation(TranslationBase):
translation: Annotated[
str | None,
str,
StringConstraints(
strip_whitespace=True,
),
] = None
]


class ResourceCategory(TypedDict):
Expand Down
6 changes: 4 additions & 2 deletions Tekst-Web/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ indent_size = 4
[*.md]
trim_trailing_whitespace = false

[*.{js,ts,json,yml,vue,css}]
indent_style = space
[*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue,json,yml,css}]
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
37 changes: 0 additions & 37 deletions Tekst-Web/.eslintrc.cjs

This file was deleted.

2 changes: 0 additions & 2 deletions Tekst-Web/Taskfile.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# https://taskfile.dev

version: '3'

tasks:
Expand Down
52 changes: 52 additions & 0 deletions Tekst-Web/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import pluginVue from 'eslint-plugin-vue';
import vueTsEslintConfig from '@vue/eslint-config-typescript';
import skipFormatting from '@vue/eslint-config-prettier/skip-formatting';
import vueI18n from '@intlify/eslint-plugin-vue-i18n';

export default [
{
name: 'app/files-to-lint',
files: ['**/*.{ts,mts,tsx,vue,js,jsx,cjs,mjs,cts}'],
},

{
name: 'app/files-to-ignore',
ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**', 'translations/**', 'Taskfile.yml'],
},

...vueI18n.configs['flat/recommended'],
{
rules: {
'@intlify/vue-i18n/no-raw-text': 'off',
'@intlify/vue-i18n/no-unused-keys': [
'error',
{
extensions: ['.ts', '.js', '.vue'],
},
],
},
settings: {
'vue-i18n': {
localeDir: {
pattern: './translations/ui/*.yml', // extension is glob formatting!
localeKey: 'file', // or 'path' or 'key'
},
// Specify the version of `vue-i18n` you are using.
// If not specified, the message will be parsed twice.
messageSyntaxVersion: '^10.0.1',
},
},
},

...pluginVue.configs['flat/essential'],
...vueTsEslintConfig(),
skipFormatting,

{
files: ['**/*.json'],
rules: {
// Turn off rules
'@typescript-eslint/no-unused-expressions': 'off',
},
},
];
Loading

0 comments on commit 02be4b1

Please sign in to comment.