pugjs / pug-lint

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

Fix a bug : Object true has no method 'charAt' #15

Closed eiichiro-takahashi closed 9 years ago

eiichiro-takahashi commented 9 years ago

Hello @benedfit

Thank you for your GREAT TOOL!!

I encontered this error (below) when I ran jade-lint in my project. I called jade-lint from gulp.

node_modules/jade-lint/lib/rules/validate-attribute-quote-marks.js:26
            , openingQuote = value.charAt(0)
                                   ^
TypeError: Object true has no method 'charAt'
    at /Users/me/myprj/node_modules/jade-lint/lib/rules/validate-attribute-quote-marks.js:26:36
    at Array.forEach (native)
    at /Users/me/myprj/node_modules/jade-lint/lib/rules/validate-attribute-quote-marks.js:23:21
    at /Users/me/myprj/node_modules/jade-lint/lib/jade-file.js:191:9
    at Array.forEach (native)
    at Object.JadeFile.iterateTokensByFilter (/Users/me/myprj/node_modules/jade-lint/lib/jade-file.js:190:38)
    at Object.JadeFile.iterateTokensByType (/Users/me/myprj/node_modules/jade-lint/lib/jade-file.js:200:12)
    at Object.module.exports.lint (/Users/me/myprj/node_modules/jade-lint/lib/rules/validate-attribute-quote-marks.js:22:12)
    at /Users/me/myprj/node_modules/jade-lint/lib/linter.js:106:14
    at Array.forEach (native)

This is my environment.

% sw_vers
ProductName:    Mac OS X
ProductVersion: 10.10.4
BuildVersion:   14E46
% node -v
v0.10.35
% npm -v
1.4.28
% gulp -v
[14:15:28] CLI version 3.8.10

Thanks

benedfit commented 9 years ago

Hey @eiichiro-takahashi, thanks for the PR, unfortunately the tests are currently failing as a result. I'm happy to fix, but need a little more details on the Jade in question that you we're getting this error for

Cheers

benedfit commented 9 years ago

@eiichiro-takahashi I worked out that boolean attributes were the issue here and have released a fix in v1.0.2. Hope it helps

Cheers

eiichiro-takahashi commented 9 years ago

Hello @benedfit

Thank you for your reply. And thank you for support boolean attributes. I'm looking forward to release v.1.0.2.

Thanks

p.s. I'm poor at English. So I'm sorry if my English sentences are incorrect.