Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ const urlConstantsOverride = {
},
};

// Disallow stray `console.log`/`console.debug`/etc. so debugging leftovers do
// not ship to production. Intentional diagnostics remain available via
// `console.warn` / `console.error`.
const noConsoleOverride = {
rules: {
"no-console": ["error", { allow: ["warn", "error"] }],
},
};

// Forbid non-null assertions (`value!`). The `!` operator silently tells the
// type checker a value can't be null/undefined without any runtime guarantee,
// so a wrong assumption surfaces as a runtime crash instead of a compile error.
Expand All @@ -19,4 +28,4 @@ const noNonNullAssertion = {
},
};

export default [...config, urlConstantsOverride, noNonNullAssertion];
export default [...config, urlConstantsOverride, noConsoleOverride, noNonNullAssertion];
Loading