Skip to content

Linter: Make erb-no-javascript-tag-helper Action View helper aware#1442

Merged
marcoroth merged 1 commit intomarcoroth:mainfrom
markokajzer:marko/nojavascripttaghelper
Mar 21, 2026
Merged

Linter: Make erb-no-javascript-tag-helper Action View helper aware#1442
marcoroth merged 1 commit intomarcoroth:mainfrom
markokajzer:marko/nojavascripttaghelper

Conversation

@markokajzer
Copy link
Contributor

closes #553

the rule was already implemented via #1330, this just makes the rule Action View Helper aware to bring it in line with similar recent changes, such as #1438

import type { ParseResult, ParserOptions, HTMLElementNode } from "@herb-tools/core"

const JAVASCRIPT_TAG_PATTERN = /\bjavascript_tag\b/
const JAVASCRIPT_TAG_ELEMENT_SOURCE = "ActionView::Helpers::JavaScriptHelper#javascript_tag"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

should maybe be a constant somewhere? 🤔

Copy link
Owner

Choose a reason for hiding this comment

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

I started this here in the language server package: https://github.com/marcoroth/herb/blob/a85a10d9856dfa2ccc815b2b72b287e1033ece31/javascript/packages/language-server/src/action_view_helpers.ts

But maybe we should move it somewhere else so you can check against the registery which Action View helpers are supported etc.

@markokajzer markokajzer force-pushed the marko/nojavascripttaghelper branch from 3601dde to 13df177 Compare March 21, 2026 11:08
Copy link
Owner

@marcoroth marcoroth left a comment

Choose a reason for hiding this comment

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

This is great, thanks @markokajzer! 🙏🏼

@marcoroth marcoroth merged commit 8477bea into marcoroth:main Mar 21, 2026
12 checks passed
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.

erb-lint: NoJavascriptTagHelper

2 participants