Skip to content

Commit

Permalink
frontend: add eslint rule restrict-template-expressions
Browse files Browse the repository at this point in the history
So that we do not accidentally pass undefined, null, booleans or
just any type in tempalte literals, see:

    `all these should error ${false} ${undefined} ${[]} ${null}`

This is a eslint rule, so only make weblint will check.
  • Loading branch information
thisconnect committed Oct 31, 2023
1 parent 99c13e2 commit cd023a2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion frontends/web/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,16 @@
"overrides": [
{
"files": ["**/*.ts?(x)"],
"rules": { }
"rules": {
"@typescript-eslint/restrict-template-expressions": ["error", {
"allowAny": false,
"allowBoolean": false,
"allowNullish": false
}]
},
"parserOptions": {
"project": ["./tsconfig.json"]
}
},
{
"files": ["**/*.test.ts?(x)"],
Expand Down

0 comments on commit cd023a2

Please sign in to comment.