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

Add Strict locals missing linter #175

Merged
merged 4 commits into from
Apr 1, 2024
Merged

Add Strict locals missing linter #175

merged 4 commits into from
Apr 1, 2024

Conversation

borama
Copy link
Contributor

@borama borama commented Mar 25, 2024

And here I propose another linter that we would love to use in our project. It checks for Strict locals magic line and reports when the magic line is missing from the template. Strict locals are encouraged by some in Rails partials as they allow to define an explicit "API" for the templates showing clearly which variables should be passed into the template when rendering it vs. which ones are purely local for the template. They also allow to define default values. I wrote a little post about them recently. Thanks for your considering this!

image

image

@sds sds added the enhancement label Apr 1, 2024
@sds sds merged commit d165c9b into sds:main Apr 1, 2024
4 checks passed
@sds
Copy link
Owner

sds commented Apr 1, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants