ui/src/i18n: en.json (20 flat dotted keys) and t(key, params?) with
{name} interpolation; a missing key warns in dev and returns the key.
All template text, title/aria-label attributes, notices and frontend
error texts go through t. ESLint vue/no-bare-strings-in-template is an
error. Catalog tests: interpolation, missing key, every t() key exists,
no unused keys. Engine messages stay English (G14). Docs updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
56 lines
1.8 KiB
JavaScript
56 lines
1.8 KiB
JavaScript
/**
|
||
* ESLint flat configuration of the Lutra frontend.
|
||
*
|
||
* Type-aware TypeScript rules apply to `.ts` and `.vue` files. Floating and
|
||
* misused promises are errors so that no rejection goes unhandled, `any`
|
||
* is an error, and inline comments are banned in favour of TSDoc blocks.
|
||
*
|
||
* Templates may not contain bare text: every interface string comes from the
|
||
* message catalog (`src/i18n`). The rule's default punctuation allowlist is
|
||
* extended by `;`, `…` and `×`.
|
||
*/
|
||
import js from "@eslint/js";
|
||
import { defineConfig } from "eslint/config";
|
||
import pluginVue from "eslint-plugin-vue";
|
||
import globals from "globals";
|
||
import tseslint from "typescript-eslint";
|
||
import vueParser from "vue-eslint-parser";
|
||
|
||
export default defineConfig(
|
||
{ ignores: ["dist/**", "node_modules/**", "coverage/**"] },
|
||
js.configs.recommended,
|
||
tseslint.configs.strictTypeChecked,
|
||
pluginVue.configs["flat/recommended"],
|
||
{
|
||
languageOptions: {
|
||
parser: vueParser,
|
||
parserOptions: {
|
||
parser: tseslint.parser,
|
||
projectService: true,
|
||
tsconfigRootDir: import.meta.dirname,
|
||
extraFileExtensions: [".vue"],
|
||
},
|
||
globals: { ...globals.browser },
|
||
},
|
||
rules: {
|
||
"@typescript-eslint/no-floating-promises": "error",
|
||
"@typescript-eslint/no-misused-promises": "error",
|
||
"@typescript-eslint/no-explicit-any": "error",
|
||
"no-inline-comments": "error",
|
||
"vue/no-bare-strings-in-template": [
|
||
"error",
|
||
{
|
||
allowlist: [
|
||
"(", ")", ",", ".", "&", "+", "-", "=", "*", "/", "#", "%", "!", "?", ":", "[", "]",
|
||
"{", "}", "<", ">", "|", ";", "·", "•", "‐", "–", "—", "−", "…", "×",
|
||
],
|
||
},
|
||
],
|
||
},
|
||
},
|
||
{
|
||
files: ["**/*.js"],
|
||
extends: [tseslint.configs.disableTypeChecked],
|
||
languageOptions: { globals: { ...globals.node } },
|
||
},
|
||
);
|