Skip to content

Conversation

nzakas
Copy link
Member

@nzakas nzakas commented Jun 18, 2024

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[x] Add something to the core
[ ] Other, please explain:

What changes did you make? (Give an overview)

Updated linter.js to optionally call some of the methods on language objects and SourceCode.

In investigating writing the JSON plugin, I discovered that a lot of the methods were not necessary for linting JSON (at least, not as a first attempt). This PR checks for the existence of various methods before calling them, allowing language plugin authors to skip implementing a bunch of methods that do nothing.

refs #16999

Is there anything you'd like reviewers to focus on?

@nzakas nzakas requested a review from a team as a code owner June 18, 2024 17:53
@eslint-github-bot eslint-github-bot bot added the chore This change is not user-facing label Jun 18, 2024
@github-actions github-actions bot added the core Relates to ESLint's core APIs and features label Jun 18, 2024
Copy link

netlify bot commented Jun 18, 2024

Deploy Preview for docs-eslint canceled.

Name Link
🔨 Latest commit 18f7bdd
🔍 Latest deploy log https://app.netlify.com/sites/docs-eslint/deploys/6671c9838b59f00008022771

Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@mdjermanovic mdjermanovic merged commit 0a13539 into main Jun 19, 2024
@mdjermanovic mdjermanovic deleted the optional-lang-methods branch June 19, 2024 08:43
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Dec 17, 2024
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Dec 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

archived due to age This issue has been archived; please open a new issue for any further discussion chore This change is not user-facing core Relates to ESLint's core APIs and features

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants