Integrate the ts-standard for cornucopia.owasp.org
Implement TypeScript Style Guide, with linter and automatic code fixer: https://github.com/standard/ts-standard
@sydseter can i work on this?
Hi, @sydseter! It seems there are several issues today. I would like to take this if unassigned!
@Adarshkumar0509 I have assigned you. Thank you for your time.
@sydseter ts-standard 12.x only supports TypeScript <5.2.0 but the project uses 5.9.3, causing a crash. Should I use eslint-config-love (the recommended replacement) or downgrade TypeScript?
We can do eslint-config-love
The next step would be to integrate the linter into the build pipeline like this: eslint@^9 @eslint/js@^9 pnpm install --save-dev eslint-config-love eslint-plugin-svelte svelte-eslint-parser eslint@^9 @eslint/js@^9 typescript-eslint eslint-plugin-svelte globals @typescript-eslint/parser
"scripts": { "lint": "eslint .", "build": "svelte-kit sync && npm run lint && vite build && node ./script/headers.js && npx svelte-sitemap --domain https://cornucopia.owasp.org --ignore 404 --ignore cards/COM* --ignore cards/DVE* --ignore cards/AC* --ignore cards/CO*" }
You need to run
npx eslint . --fix
After installing to ensure everything gets cleaned up. It's a lot. Sorry for this, but it's very needed.
After that, there is a lot of manual work as well.
ChatGPT would probably be able to clean it up for you if you have the possibility to use it. Remember to disclose how you use it in the pull-request.
@sydseter sir definitely i will do.
I see 73 svelte/no-navigation-without-resolve errors split into two types: 1st ione is 13 are goto() calls without await/resolve, I can fix these in code and 2nd one is 60 are plain href links flagged by the rule — should these be fixed in code or should this rule be configured differently for static links?
What rule flags the links?
@sydseter The rule svelte/no-navigation-without-resolve from eslint-plugin-svelte is flagging both goto() calls.