From 226b291a2343da7b57e90bd34dd9c12576e43f27 Mon Sep 17 00:00:00 2001 From: Miguel Lehmann Date: Thu, 19 Dec 2024 10:27:09 +0100 Subject: [PATCH] add redme doku and clean up the naming convention rules --- frontend/README.md | 3 +++ frontend/eslint.config.mjs | 16 +++------------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/frontend/README.md b/frontend/README.md index 57be403a17..1a1a47396b 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -33,6 +33,9 @@ Build: We use the **prettier** code formatter for the frontend code: https://www.npmjs.com/package/prettier +If you get a does not match pattern error, it is likely because of the custom words for the OKR tool +here is a regex101 project that showcases how the regex works: +https://regex101.com/r/VUyAt6/1 ## Test Coverage For generating the coverage of our frontend specs (jest), you can use following command: diff --git a/frontend/eslint.config.mjs b/frontend/eslint.config.mjs index 339b054f73..3bd46bd0d9 100644 --- a/frontend/eslint.config.mjs +++ b/frontend/eslint.config.mjs @@ -1,7 +1,7 @@ import tsEslint from "typescript-eslint"; import html from "@html-eslint/eslint-plugin"; import { createRegexForWords } from "./eslintHelper.mjs" - +import * as constants from "node:constants"; export default tsEslint.config( { @@ -18,24 +18,14 @@ export default tsEslint.config( selector: ["class", "interface"], format: ["PascalCase"] }, { - // It has to many exceptions for me to check this usefully - // - // selector: "typeProperty", types: ["string"], modifiers: ["readonly"], format: ["UPPER_CASE"] - // },{ - // selector: "classProperty", modifiers: ["readonly"], format: ["UPPER_CASE"] - // }, { - // selector: "variable", modifiers: ["global"], types: ["string"], format: ["UPPER_CASE"] - // }, { - // selector: "variable", modifiers: [], format: ["camelCase"] - // }, { + selector: "variable", modifiers: [], format: ["camelCase", "UPPER_CASE"] + }, { selector: "enum", format: ["PascalCase"] }, { selector: "enumMember", format: ["UPPER_CASE"] }, { selector: ["method", "function"], format: ["camelCase"] }, { - // selector: "property", format: ["camelCase"] - // }, { selector: "typeParameter", format: ["PascalCase"] } ],