mozilla / eslint-plugin-no-unsanitized

Custom ESLint rule to disallows unsafe innerHTML, outerHTML, insertAdjacentHTML and alike
Mozilla Public License 2.0
223 stars 34 forks source link

Husky throws a TypeError: context.reportUnsupported is not a function #70

Closed biancadanforth closed 6 years ago

biancadanforth commented 6 years ago

I am using a husky pre-commit and prepush hook for Lightbeam WE, and this plug-in is throwing an error. Here are the git details:

bdanforth ~/projects/lightbeam-we (make-vars-dynamic) $ git commit -m "Partial fix per PR feedback"

> husky - npm run -s precommit
> husky - node v6.10.3

context.reportUnsupported is not a function
TypeError: context.reportUnsupported is not a function
    at EventEmitter.CallExpression (/Users/bdanforth/Projects/lightbeam-we/node_modules/eslint-plugin-no-unsanitized/lib/rules/method.js:77:29)
    at emitOne (events.js:101:20)
    at EventEmitter.emit (events.js:188:7)
    at NodeEventGenerator.applySelector (/Users/bdanforth/Projects/lightbeam-we/node_modules/eslint/lib/util/node-event-generator.js:265:26)
    at NodeEventGenerator.applySelectors (/Users/bdanforth/Projects/lightbeam-we/node_modules/eslint/lib/util/node-event-generator.js:294:22)
    at NodeEventGenerator.enterNode (/Users/bdanforth/Projects/lightbeam-we/node_modules/eslint/lib/util/node-event-generator.js:308:14)
    at CodePathAnalyzer.enterNode (/Users/bdanforth/Projects/lightbeam-we/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:602:23)
    at CommentEventGenerator.enterNode (/Users/bdanforth/Projects/lightbeam-we/node_modules/eslint/lib/util/comment-event-generator.js:98:23)
    at Traverser.enter (/Users/bdanforth/Projects/lightbeam-we/node_modules/eslint/lib/eslint.js:929:36)
    at Traverser.__execute (/Users/bdanforth/Projects/lightbeam-we/node_modules/estraverse/estraverse.js:397:31)

> husky - pre-commit hook failed (add --no-verify to bypass)
> husky - to debug, use 'npm run precommit'
mozfreddyb commented 6 years ago

Please apologize the long delay, I have been on leave for a few weeks.

mozfreddyb commented 6 years ago

ping @biancadanforth happy to help if you can give me more info :)

biancadanforth commented 6 years ago

Hi @mozfreddyb ; sorry for my delayed response. As you can see from the timestamp, this was quite a while ago now, and running eslint no longer produces an error from the plugin.

Searching for the context.reportUnsupported string from the original error log in the eslint-plugin-no-unsanitized repo also returns no results presently -- so I guess it resolved itself over time. I will close this issue; thanks for following up. :)