deno_lint icon indicating copy to clipboard operation
deno_lint copied to clipboard

Tag All Rules

Open Barzi-Ahmed opened this issue 1 year ago • 4 comments

Hello,

I want to tag and use all rules (excluding Fresh) for my project, not just the recommend rules. How do I do that? I don't want to write each rule's name in "include" configuration.

This is my current deno linter .json configuraiton:

	"lint": {
		"rules": {
			"tags": ["recommended"]
		}
	},
...

Can I do something like this? "tags": ["all"]?

Great linter and great project by the way.

Barzi-Ahmed avatar Feb 02 '24 19:02 Barzi-Ahmed

I can recognize the need here, but I'm not sure about the exact semantics. "all" would imply all rules, so how would we exclude just "fresh" rules by default?

Would something like this work for you?

{
  "lint": {
     "rules": {
       "tags": ["all", "-fresh"]
     }
}

bartlomieju avatar May 10 '24 00:05 bartlomieju

I have a specific need for this. I want all linting options enabled with tailored excludes to match one of five linting levels for our code: "all", "strict", "normal", "lax", "none" (none will have only minimal specific includes, and all will have minimal specific excludes; both are for very exceptional use cases). Our team has lots of code created over nearly three decades, and the goal is to keep EOL projects from getting worse, improve good projects, and be able to ensure new projects have the highest code quality.

I very much want to turn all rules on by default, so that I encounter new rules as they are added. Then I can decide at what level that new rule belongs.

Currently I am, periodically, manually copying the list from the Rust source file and dropping it in my linting configs. It's quite tedious.

l-cornelius-dol avatar Aug 31 '24 00:08 l-cornelius-dol

@l-cornelius-dol thanks for the comment - so would the solution from https://github.com/denoland/deno_lint/issues/1244#issuecomment-2103633950 work for you?

bartlomieju avatar Sep 03 '24 14:09 bartlomieju

@l-cornelius-dol thanks for the comment - so would the solution from #1244 (comment) work for you?

Yes, it would. In fact "all" was the intuitive thing I tried; when that failed I searched the code and concluded that it only supports "recommended".

NB: I can't stand Node and it's dependency/supply-chain hellscape, so I have gone all-in on Deno for our build-support system. Therefore, in our case at least, linting is not about what's right or even recommended for Deno code, but what's the right balance for our code-base, both current and decades' old. I sure do appreciate the work you-all do over there.

l-cornelius-dol avatar Sep 03 '24 19:09 l-cornelius-dol