Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add no-console rule to deno lint #20187

Closed
marvinhagemeister opened this issue Aug 17, 2023 · 4 comments · Fixed by #21718
Closed

feat: Add no-console rule to deno lint #20187

marvinhagemeister opened this issue Aug 17, 2023 · 4 comments · Fixed by #21718
Labels
feat new feature (which has been agreed to/accepted)

Comments

@marvinhagemeister
Copy link
Contributor

I'm guilty of accidentally committing console.log statements from time to time. We should have a no-console rule, similar to eslint: https://eslint.org/docs/latest/rules/no-console

@marvinhagemeister marvinhagemeister added the feat new feature (which has been agreed to/accepted) label Aug 17, 2023
@dsherret
Copy link
Member

Me too dsherret/dax#163

@0xIchigo
Copy link
Contributor

@marvinhagemeister @dsherret @bartlomieju I've opened up a PR in deno_lint which would allow for the implementation of a "no console log" rule. Once that is approved, I'd be more than happy to add this rule to .dlint.json to implement the rule in the main Deno repository 🔥

@scarf005
Copy link
Contributor

scarf005 commented Nov 24, 2023

despite denoland/deno_lint#1189 being merged and released in v0.51.0, and deno CLI using deno_lint v0.52.0, I was unable to use this rule. Could there be a step I've been missing?

 ~/r/e/no-console  deno --version
deno 1.38.2+585cf2d (canary, x86_64-unknown-linux-gnu)
v8 12.0.267.1
typescript 5.2.2
 ~/r/e/no-console  deno lint --rules | grep no-console
 !  ~/r/e/no-console  echo $status
{
    "lint": {
        "rules": { "include": ["no-console"] }
    }
}

@dsherret
Copy link
Member

Looks like it wasn't properly hooked up. I just opened denoland/deno_lint#1214

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat new feature (which has been agreed to/accepted)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants