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

docs: add metadata for parser/processor #17438

Merged
merged 4 commits into from Aug 1, 2023

Conversation

JLHwung
Copy link
Contributor

@JLHwung JLHwung commented Jul 31, 2023

Prerequisites checklist

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

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

What changes did you make? (Give an overview)

Added metadata descriptions to custom-parsers.md and custom-processors.md. I don't know if metadata object is also implemented for formatters, if so I am happy to add a section covering that, too.

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

The current meta sections are mostly copied from plugins.md. Frankly I don't know if meta object helps ESLint cache the parsers/processors. If not please correct me.

@JLHwung JLHwung requested a review from a team as a code owner July 31, 2023 14:51
@eslint-github-bot eslint-github-bot bot added the documentation Relates to ESLint's documentation label Jul 31, 2023
@netlify
Copy link

netlify bot commented Jul 31, 2023

Deploy Preview for docs-eslint ready!

Name Link
🔨 Latest commit 1d3abe8
🔍 Latest deploy log https://app.netlify.com/sites/docs-eslint/deploys/64c7ec0747d83f0008ebbb8c
😎 Deploy Preview https://deploy-preview-17438--docs-eslint.netlify.app/extend/custom-processors
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

docs/src/extend/custom-parsers.md Outdated Show resolved Hide resolved
The `meta.name` property should match the npm package name for your custom parser and the `meta.version` property should match the npm package version for your custom parser. The easiest way to accomplish this is by reading this information from your `package.json`.

### Methods in Custom Parsers

A custom parser is a JavaScript object with either a `parse` or `parseForESLint` method. The `parse` method only returns the AST, whereas `parseForESLint` also returns additional values that let the parser customize the behavior of ESLint even more.
Copy link
Member

Choose a reason for hiding this comment

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

Can you rearrange this so the meta data section comes after these other sections? We'd like people to focus on the methods first and then think about meta data.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Np. I copied the ordering from plugins.md. Also updated the ordering there.

Co-authored-by: Nicholas C. Zakas <nicholas@humanwhocodes.com>
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jul 31, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

Copy link
Member

@nzakas nzakas 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!

@harish-sethuraman harish-sethuraman added the accepted There is consensus among the team that this change meets the criteria for inclusion label Aug 1, 2023
Copy link
Member

@harish-sethuraman harish-sethuraman 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

@harish-sethuraman harish-sethuraman merged commit d743ed3 into eslint:main Aug 1, 2023
22 checks passed
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Jan 29, 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 Jan 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion documentation Relates to ESLint's documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants