pugjs / pug-lint

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

codeOperator.filter cannot read property filter of undefined #123

Open FieryCod opened 7 years ago

FieryCod commented 7 years ago

Hello my problem is:

When I try to lint my pug files by using: pug-lint -c .pug-lintrc.json views/index.pug

I receive following error:

/usr/lib/node_modules/pug-lint/lib/pug-file.js:217 filter: codeOperator.filter, ^

TypeError: Cannot read property 'filter' of undefined at /usr/lib/node_modules/pug-lint/lib/pug-file.js:217:29 at Array.forEach (native) at PugFile.addErrorForCodeOperator (/usr/lib/node_modules/pug-lint/lib/pug-file.js:213:11) at module.exports.lint (/usr/lib/node_modules/pug-lint/lib/rules/disallow-space-after-code-op erator.js:41:10) at /usr/lib/node_modules/pug-lint/lib/linter.js:145:12 at Array.forEach (native) at Linter._checkFile (/usr/lib/node_modules/pug-lint/lib/linter.js:142:31) at Linter.checkString (/usr/lib/node_modules/pug-lint/lib/linter.js:72:17) at Linter.checkFile (/usr/lib/node_modules/pug-lint/lib/linter.js:48:17) at Linter.checkPath (/usr/lib/node_modules/pug-lint/lib/linter.js:64:17)

This is how my .pug-lintrc.json looks like:

{
    "disallowBlockExpansion": true,
    "disallowClassAttributeWithStaticValue": true,
    "disallowClassLiteralsBeforeAttributes": true,
    "disallowClassLiteralsBeforeIdLiterals": true,
    "disallowDuplicateAttributes": true,
    "disallowHtmlText": true,
    "disallowIdAttributeWithStaticValue": true,
    "disallowLegacyMixinCall": true,
    "disallowMultipleLineBreaks": true,
    "disallowSpaceAfterCodeOperator": [true, "-"],
    "disallowSpacesInsideAttributeBrackets": true,
    "disallowStringConcatenation": "aggressive",
    "requireClassLiteralsBeforeAttributes": true,
    "validateAttributeSeparator": ", ",
    "requireIdLiteralsBeforeAttributes": true,
    "requireLowerCaseAttributes": true,
    "requireLowerCaseTags": true,
    "validateDivTags": true,
    "validateExtensions": true,
    "validateIndentation": 2,
    "validateTemplateString": [true, false, true]

}

How can i get rid of this error? "pug-lint": "^2.3.0", "pug": "~2.0.0-beta6"