LiquidDoc linters should report unused parameters
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 234
- Forks
- 92
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 6
Description
Is your feature request related to a problem? Please describe.
I would like to add a linter rule that detects parameters documented in Liquid files with {% doc %} that are never actually passed in any of the calls to the snippet across the codebase.
For example, consider this snippets/example.liquid:
{%- doc -%}
Renders a card for displaying various resource types (products, collections, articles, pages).
@param {object} resource - The resource to render
@param {string} [style] - The style of the card. Can be 'default' or 'overlay'
{%- enddoc -%}
...
This example has an optional style parameter, and there might be code related to it. However, if no one ever renders snippets/example.liquid with the style parameter, we should lint for it. This could be an opportunity to refactor and simplify snippets/example.liquid.
Describe the solution you'd like
I'd like a new linter check to cover the case described above.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Use snippets/example.liquid as the behavioral example, then locate the existing LiquidDoc linter checks and the entry point that can inspect snippet calls across the codebase. Done means the new check reports documented parameters that are never passed, including the optional style parameter in the example.
Written by the indexing model from the issue text.
Assessment
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100