What does this error mean? And how do I resolve it?:
/home/jmunsch/PycharmProjects/testing/node_modules/gulp-eslint/node_modules/eslint/lib/eslint.js:706
throw ex;
^
TypeError: Error while loading rule 'react/jsx-key': ruleCreator is not a function
at /home/jmunsch/PycharmProjects/testing/node_modules/gulp-eslint/node_modules/eslint/lib/eslint.js:692:28
at Array.forEach (<anonymous>)
at EventEmitter.module.exports.api.verify (/home/jmunsch/PycharmProjects/testing/node_modules/gulp-eslint/node_modules/eslint/lib/eslint.js:671:16)
at processText (/home/jmunsch/PycharmProjects/testing/node_modules/gulp-eslint/node_modules/eslint/lib/cli-engine.js:230:27)
at CLIEngine.executeOnText (/home/jmunsch/PycharmProjects/testing/node_modules/gulp-eslint/node_modules/eslint/lib/cli-engine.js:686:26)
at verify (/home/jmunsch/PycharmProjects/testing/node_modules/gulp-eslint/index.js:20:23)
at Transform._transform (/home/jmunsch/PycharmProjects/testing/node_modules/gulp-eslint/index.js:68:18)
at Transform._read (_stream_transform.js:186:10)
at Transform._write (_stream_transform.js:174:12)
at doWrite (_stream_writable.js:396:12)
at writeOrBuffer (_stream_writable.js:382:5)
at Transform.Writable.write (_stream_writable.js:290:11)
at write (/home/jmunsch/PycharmProjects/testing/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:623:24)
at flow (/home/jmunsch/PycharmProjects/testing/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:632:7)
at DestroyableTransform.pipeOnReadable (/home/jmunsch/PycharmProjects/testing/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:664:5)
at emitNone (events.js:106:13)
at DestroyableTransform.emit (events.js:208:7)
at emitReadable_ (/home/jmunsch/PycharmProjects/testing/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:448:10)
at emitReadable (/home/jmunsch/PycharmProjects/testing/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:444:5)
at readableAddChunk (/home/jmunsch/PycharmProjects/testing/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:187:9)
at DestroyableTransform.Readable.push (/home/jmunsch/PycharmProjects/testing/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:149:10)
at DestroyableTransform.Transform.push (/home/jmunsch/PycharmProjects/testing/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_transform.js:145:32)
I'm posting a question and answer because there weren't too many places to find information about eslint
ruleCreator
, and what this particular error meant.However, see:
For example looking at the types of rules I had defined, I added a console.log in eslint.js:
What this suggests is that there is a rule "react/jsx-key" that is defined in the configuration, but eslint doesn't know how to look the rule up.
I came to the realization that I was missing a dependency with the rule definition / schema.
I resolved my issue by:
For more details see: