no-slow-types should not trigger on 'as const' objects
I get an on-slow-types error for an
as const
object, but shouldn't this be inferred?
https://github.com/denodrivers/sqlite3/actions/runs/8774511607/job/24075784522?pr=124
https://github.com/halvardssm/deno-sqlite/blob/feat/sqlx/src/ffi.ts#L5881 Reply
I wasn't able to find the answer to your question in the official Deno documentation. However, based on the information you've provided, it seems like you're encountering an issue with a linting rule (
no-slow-types
) when using an as const
assertion.
Without the specific context of the error message or the ability to analyze the codebase, I can't provide a definitive solution. However, it's worth noting that the as const
assertion in TypeScript is used to create a literal type which should not be a slow operation. If the linter is flagging this as a slow type, it could be a false positive or an issue with the linter's rule configuration.
Please note that this advice is not based on the Deno documentation, and I would advise you to double-check the accuracy of this advice. It might be helpful to look into the linter configuration or consider filing an issue with the linter if you believe this is a bug.