google / eslint-config-google

ESLint shareable config for the Google JavaScript style guide
Apache License 2.0
1.75k stars 139 forks source link

Throwing Cannot read property 'range' of null #43

Closed erayhanoglu closed 7 years ago

erayhanoglu commented 7 years ago

Node: 8.0.0 npm: 5.0.1 babel-eslint: 7.2.3 eslint: 3.19.0 eslint-config-google: 0.8.0

Just create a new js file and paste contents below

async function run() {
}
run();

It throws this error

TypeError: Cannot read property 'range' of null
    at TokenStore.getTokenBefore (/Users/erayh/Yazilim/js/uniqorm/node_modules/eslint/lib/token-store/index.js:318:17)
    at EventEmitter.checkFunction (/Users/erayh/Yazilim/js/uniqorm/node_modules/eslint/lib/rules/generator-star-spacing.js:131:42)
    at emitOne (events.js:120:20)
    at EventEmitter.emit (events.js:210:7)
    at NodeEventGenerator.applySelector (/Users/erayh/Yazilim/js/uniqorm/node_modules/eslint/lib/util/node-event-generator.js:265:26)
    at NodeEventGenerator.applySelectors (/Users/erayh/Yazilim/js/uniqorm/node_modules/eslint/lib/util/node-event-generator.js:294:22)
    at NodeEventGenerator.enterNode (/Users/erayh/Yazilim/js/uniqorm/node_modules/eslint/lib/util/node-event-generator.js:308:14)
    at CodePathAnalyzer.enterNode (/Users/erayh/Yazilim/js/uniqorm/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:602:23)
    at CommentEventGenerator.enterNode (/Users/erayh/Yazilim/js/uniqorm/node_modules/eslint/lib/util/comment-event-generator.js:98:23)
    at Traverser.enter (/Users/erayh/Yazilim/js/uniqorm/node_modules/eslint/lib/eslint.js:929:36)
philipwalton commented 7 years ago

I can't reproduce this error with a fresh install of all of these packages. Can you try reinstalling your node modules and see if you get the same problem?

erayhanoglu commented 7 years ago

Yes you are right. I delete node_modules directory and make a clean install with npm update -D. By the way, today i ve update the npm to 5.0.2, There was many corruption problems with 5.0.0 and 5.0.1.