Skip to content

Add support for linting EJS templates (ESLint integration) #32851

@mshima

Description

@mshima
Overview of the feature request

EJS templates are widely used in the generator to produce every type of files in JHipster. However, there is currently no linting or validation applied to these templates, which can lead to inconsistencies, hard-to-detect bugs, and potential security issues in the generated output.
Since EJS mixes JavaScript logic with template syntax, errors inside templates are often only discovered after code generation, during runtime.

  • Errors inside <% %> blocks are not validated
  • Difficult to maintain large or complex templates
  • Regressions in templates may impact multiple generated applications

Expected Benefits

  • Early detection of syntax and logic errors in templates
  • Improved developer experience when editing templates
  • Reduced risk of regressions in generators

This work is already ongoing. It initially started as a Prettier plugin to improve overall reliability and formatting consistency, and has since evolved into a more complete linting approach with auto-fix support for both JavaScript flow control structures and EJS tags.

Related issues or PR
  • Checking this box is mandatory (this is just to show you read everything)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions