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: introduce new deprecated types for rules #19238

Merged
merged 51 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
bb8a2b2
feat: introduce new deprecated types
DMartens Dec 11, 2024
0a8be53
feat: rules use new deprecated format
DMartens Dec 11, 2024
c4d9c9b
feat: support new deprecated format in usedDeprecatedRules
DMartens Dec 11, 2024
60bc4f9
docs: document new deprecated format
DMartens Dec 11, 2024
09a07cd
fix: Use formatting rules instead of stylistic rules are being removed
DMartens Dec 20, 2024
cb8202e
fix: Clarify the replacement is from ESLint Stylistic
DMartens Dec 20, 2024
2d28ec3
docs: automatically add deprecated rules notice
DMartens Jan 18, 2025
3eb611d
docs: handle missing replacement rule for rule deprecations
DMartens Jan 18, 2025
816166e
Merge branch 'main' into deprecated-rule-metadata
DMartens Jan 18, 2025
9bcb965
docs: stop checking for manually added rule deprecation notices
DMartens Jan 18, 2025
a887786
docs: apply suggestions
DMartens Jan 18, 2025
0a0e7f5
docs: fix lint errors
DMartens Jan 18, 2025
f9726e3
docs: Clarify null for availableUntil is not the same as frozen
DMartens Jan 20, 2025
27dd0f3
fix: rule deprecation messages for node and various suggestions
DMartens Jan 24, 2025
a4ef007
fix: internal links
DMartens Jan 24, 2025
47e7445
fix: sync deprecated node rules messages and descriptions
DMartens Jan 25, 2025
a2df4e7
fix: add rule deprecation type tests
DMartens Jan 27, 2025
86158e8
fix: re-add .md file extension for rules from eslint-plugin-n
DMartens Jan 27, 2025
ad2e3e6
fix: add periods to sentence ends
DMartens Jan 28, 2025
3789bc1
fix: showing rule replacements for deprecated and removed rules in ru…
DMartens Jan 28, 2025
00418a2
fix: add urls for replacement of deprecated rules in favor of padding…
DMartens Jan 29, 2025
2119a57
fix: always provide a rule meta.deprecated.url
DMartens Jan 29, 2025
9da6e1d
fix: alias func-call-spacing as the replacement rule is renamed to ke…
DMartens Jan 29, 2025
8baace5
fix: convert callback-return and indent-legacy to new deprecated format
DMartens Jan 30, 2025
79d3579
fix: normalize deprecated rule messages
DMartens Jan 30, 2025
ac457e4
chore: fix single quotes in eslint tests
DMartens Jan 30, 2025
72e07e8
fix: use external links to rule replacements in the rule reference
DMartens Jan 31, 2025
72cdd02
fix: remove shadowing of rule in makefile
DMartens Jan 31, 2025
70439e3
fix: add external plugin reference for deprecated rules in the rule r…
DMartens Feb 11, 2025
fd5557e
fix: remove manual deprecation notice of no-new-object
DMartens Feb 11, 2025
2ae6aab
fix: cleanup rule-list macro
DMartens Feb 12, 2025
a1b4c82
fix: update rule-list documentation
DMartens Feb 13, 2025
a1ec4a6
fix: use DeprecatedInfo type from @eslint/core
DMartens Feb 13, 2025
398ccf1
Merge branch 'main' into deprecated-rule-metadata
DMartens Feb 16, 2025
aadbd4e
fix: use shorthand plugin names for usedDeprecatedRules
DMartens Feb 19, 2025
78f512e
fix: restore check for deprecated JSDoc tags for rule files
DMartens Feb 19, 2025
ad91560
fix: adjust JSDoc description and error message as README no longer c…
DMartens Feb 19, 2025
f2546ae
fix: use correct name in deprecation info for arrow-spacing
DMartens Feb 19, 2025
c2e14d3
fix: use correct name in deprecation info for multiline-comment-style
DMartens Feb 19, 2025
dd4c6b5
fix: correct package source of eslint-plugin-n in replacement infos
DMartens Feb 20, 2025
1a9732a
fix: rule docs site uses relative pages for internal rule replacements
DMartens Feb 20, 2025
c1eb5c0
fix: deprecation rule for no-buffer-constructor
DMartens Feb 21, 2025
264be63
fix: deprecation rule for no-restricted-modules
DMartens Feb 21, 2025
f1937a9
docs: Add dot at the end of a core rule replacement.
DMartens Feb 21, 2025
52e151f
fix: use relative links for replacement rules in the rule reference
DMartens Feb 21, 2025
b4a966d
fix: rule-type-list data for removed rules use new replacement format
DMartens Feb 21, 2025
fecc7f9
fix: no rendering of replacement rule lists if there are no replacements
DMartens Feb 21, 2025
3183761
fix: run pretteir on rule-type-list.json
DMartens Feb 21, 2025
3b626ae
docs: change description of `url` for deprecation meta
DMartens Feb 21, 2025
35d36d5
fix: deprecation version of no-spaced-fnc
DMartens Feb 21, 2025
ff3666f
fix: replacement rule of no-new-symbol
DMartens Feb 21, 2025
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
Prev Previous commit
Next Next commit
fix: use DeprecatedInfo type from @eslint/core
  • Loading branch information
DMartens committed Feb 13, 2025
commit a1ec4a6b95dc5a9e4e65aea635d1cb7802598405
42 changes: 1 addition & 41 deletions lib/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/

import * as ESTree from "estree";
import { Language } from "@eslint/core";
import { Language, DeprecatedInfo } from "@eslint/core";
import { JSONSchema4 } from "json-schema";
import { LegacyESLint } from "./use-at-your-own-risk.js";

Expand Down Expand Up @@ -768,46 +768,6 @@ export namespace Rule {
hasSuggestions?: boolean | undefined;
}

/** Provides additional metadata about a deprecation. */
interface DeprecatedInfo {
/** General message presented to the user, e.g. for the key rule why the rule is deprecated or for info how to replace the rule. */
message?: string
/** URL to more information about this deprecation in general. */
url?: string
/** An empty array explicitly states that there is no replacement. */
replacedBy?: ReplacedByInfo[]
/** The package version since when the rule is deprecated (should use full semver without a leading "v"). */
deprecatedSince?: string
/** The estimated version when the rule is removed (probably the next major version). null means the rule is "frozen" (will be available but will not be changed). */
availableUntil?: string | null
}

/** Provides metadat about a replacement */
interface ReplacedByInfo {
/** General message presented to the user, e.g. how to replace the rule */
message?: string
/** URL to more information about this replacement in general */
url?: string
/**
* Name should be "eslint" if the replacemenet is an ESLint core rule.
* Omit the property if the replacement is in the same plugin.
*/
plugin?: ExternalSpecifier
/** Name and documentation of the replacement rule */
rule?: ExternalSpecifier
}

/**
* Specifies the name and url of an external resource.
* At least one property should be set.
*/
interface ExternalSpecifier {
/** Name of the referenced plugin / rule. */
name?: string
/** URL pointing to documentation for the plugin / rule. */
url?: string
}

interface RuleContext {
id: string;
options: any[];
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"@eslint-community/eslint-utils": "^4.2.0",
"@eslint-community/regexpp": "^4.12.1",
"@eslint/config-array": "^0.19.0",
"@eslint/core": "^0.10.0",
"@eslint/core": "^0.11.0",
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "9.18.0",
"@eslint/plugin-kit": "^0.2.5",
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy