Skip to content

Linter: Implement ujs- rules for deprecated @rails/ujs attributes - #2057

Open
marcoroth wants to merge 1 commit into
mainfrom
ujs-rules
Open

Linter: Implement ujs- rules for deprecated @rails/ujs attributes#2057
marcoroth wants to merge 1 commit into
mainfrom
ujs-rules

Conversation

@marcoroth

Copy link
Copy Markdown
Owner

This pull request implements four linter rules under a new ujs- scope, covering the data-* attributes that @rails/ujs used to power.

Before Rails 7, Rails shipped @rails/ujs by default, which added JavaScript behavior to elements through helper options and data-* attributes.

Rails 7 stopped including it, and Turbo covers the same behavior with its own attributes. A template that still has the old attributes only does what it says while the legacy library is loaded, and once that goes away it fails quietly.

These rules are meant to help with the migration to Turbo.

  • ujs-prefer-turbo-method: data-method, → data-turbo-method
  • ujs-prefer-turbo-confirm: data-confirm, → data-turbo-confirm
  • ujs-prefer-turbo-submits-with: data-disable-with, → data-turbo-submits-with
  • ujs-no-remote-attribute: data-remote → none

Resolves #1346

@github-actions github-actions Bot added documentation Improvements or additions to documentation linter @herb-tools/linter for HTML+ERB templates typescript TypeScript source across the javascript/ packages linter-rule Individual linter rules and their documentation labels Aug 7, 2026
@marcoroth
marcoroth force-pushed the ujs-rules branch 3 times, most recently from f245769 to 978f814 Compare August 7, 2026 01:56
@github-actions github-actions Bot added wasm WebAssembly build and bindings c C source for the core parser, lexer, and AST labels Aug 7, 2026
@marcoroth
marcoroth force-pushed the ujs-rules branch 3 times, most recently from 98902d3 to 5542d9f Compare August 7, 2026 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c C source for the core parser, lexer, and AST documentation Improvements or additions to documentation linter @herb-tools/linter for HTML+ERB templates linter-rule Individual linter rules and their documentation typescript TypeScript source across the javascript/ packages wasm WebAssembly build and bindings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Linter Rule: Disallow deprecated Rails UJS attributes

1 participant