Skip to content

v2.1.0

Latest
Compare
Choose a tag to compare
@Splines Splines released this 15 Dec 18:46
9c26b35

With this release we add support for html-eslint, which is a really nice ESLint plugin enabling you to lint HTML files. You can now use our ERB preprocessor as plug-n-play such that HTML ESLint can also lint your .html.erb files 🎉

See the Readme for how to set things up, it's really easy to do.

eslint-html-erb

Note that ERB statements will be simply ignored, we just lint the pure HTML part of your .html.erb files. Look at erb_lint if you also want to lint ERB tags, e.g. get RuboCop warnings for ERB code inside .html.erb files. You can use both erb_lint and this preprocessor in conjunction with html-eslint together, e.g. as an idea for VSCode, you can use this Run on Save extension and specify in your settings.json

"emeraldwalk.runonsave": {
    "autoClearConsole": true,
    "commands": [
        {
            "match": "\\.(html|text|js).erb$",
            "cmd": "bundle exec erb_lint --config .config/.erb_lint.yml --show-linter-names --autocorrect ${file}",
            "isAsync": true
        }
    ]
},

such that after every save you also lint with erb_lint.

In addition to HTML support, we fix some wrong replacements made by autofixes.

⚠ Breaking Changes

If you're referencing the processor manually, i.e. you included processor: erb.processors.erbProcessor in your config file, you will have to replace it by processor: erb.processors["processorJs"] (or use the new processorHtml respectively). All the new ways are described in the Readme.

What's Changed

  • Init preprocessor for html-eslint by @Splines in #13
  • Fix autofix replacements & rework test pipeline by @Splines in #14

Full Changelog: v2.0.1...v2.1.0