pugjs / pug-lint

An unopinionated and configurable linter and style checker for Pug
ISC License
228 stars 51 forks source link

Incorrect `Unnecessary 'div' tag` error #185

Open shadowgate15 opened 2 years ago

shadowgate15 commented 2 years ago

Currently the following line will fail with an Unnecessary 'div' tag error.

div(data-type="text").class

If it were written as (data-type="text").class, pug will fail to render and throw an error.

Test

it('should not report necessary div tags with classes after attributes', function () {
  assert.equal(linter.checkString('div(data-type="text").class').length, 0);
});
lazarljubenovic commented 1 year ago

Isn't this equivalent to .class(data-type="text")?