rfcs icon indicating copy to clipboard operation
rfcs copied to clipboard

feat: support additional metadata for rule deprecations

Open bmish opened this issue 1 year ago • 6 comments

Summary

This RFC suggests a format for storing additional information in rule metadata about rule deprecations and replacement rules, allowing automated documentation and website tooling to generate more informative deprecation notices.

Related Issues

  • https://github.com/eslint/eslint/issues/18061

bmish avatar Feb 21 '24 00:02 bmish

@bmish there are a few more comments here. :)

aladdin-add avatar May 10 '24 09:05 aladdin-add

@bmish just to check, are you still working on this?

mdjermanovic avatar May 21 '24 10:05 mdjermanovic

@bmish Just checking in. Are you still working on this?

nzakas avatar Jun 03 '24 14:06 nzakas

@bmish there are some outstanding comments to address. Are you still interested in finishing this RFC?

nzakas avatar Jun 24 '24 14:06 nzakas

I'd like to finish it up but it might be a while until I find some time.

bmish avatar Jul 03 '24 23:07 bmish

@bmish can you give us a rough timeframe so we can know when to follow up?

nzakas avatar Jul 04 '24 15:07 nzakas

@bmish it's been a month since the last ping. Do you have a timeframe for when you plan on finishing this up?

nzakas avatar Aug 07 '24 15:08 nzakas

Hi everyone - we're looking for someone who's interested in this RFC to pick it up and push it over the finish line. If you're interested, please leave a comment here.

nzakas avatar Aug 08 '24 20:08 nzakas

I'm interested in finishing this. I'm in favor of only using the deprecated key as there is a strict relationship between deprecated and replacedBy and checking whether the legacy form is used is simple: if (rule.meta.deprecated || "replacedBy" in rule.meta). With that and the notes from others it would like this:

type RuleMeta = {
	deprecated?: {
		replacedBy?: ...
		plugin?: string | { name?: string, url?: string } // Question: Should it be required that the name is its id on npm? or allow other registries such as jsr. Also worth documenting is if it should be set if it is from the same plugin
		rule?: string | { name?: string, url?: string }
		info?: string | { message?: string, url?: string } // Originally "meta"

		// Additions
		deprecatedSince?: string // Version string since when the rule is deprecated
		availableUntil?: null | string // Version or date when the rule will be removed or null if the rule is frozen
	}
}

Another thing worth mentioning is we could get rid of requiring one property (either url or name) in the object forms if the shorthand string should be interpreted smartly: if it starts with a protocol (e.g. https:// it is shorthand for the url and otherwise for message or name. Then the object forms would require both properties to be set.

DMartens avatar Aug 09 '24 15:08 DMartens

@DMartens I'd say put all of those thoughts into the RFC and we can go from there.

nzakas avatar Aug 09 '24 15:08 nzakas

@DMartens Thanks for picking up the work on this RFC. Feel free to open a new pull request as you probably don't have write access to the source repo here.

fasttime avatar Aug 12 '24 07:08 fasttime

@DMartens are you still interested in picking this up?

nzakas avatar Sep 11 '24 14:09 nzakas

Sorry, I wanted to proofread it the next day and forgot. Anyways the proposal is continued in #124.

DMartens avatar Sep 12 '24 21:09 DMartens

No worries. We'll close this and continue the discussion on #124.

nzakas avatar Sep 13 '24 14:09 nzakas