jscs-dev / node-jscs

:arrow_heading_up: JavaScript Code Style checker (unmaintained)
https://jscs-dev.github.io
MIT License
4.96k stars 513 forks source link

Internal Error: Cannot read property 'name' of undefined #2175

Closed xadh00m closed 8 years ago

xadh00m commented 8 years ago
[a, b, c, d] = foo

This code leads to an internal error with linter-jscs (3.4.8) at require-dollar-before-jquery-assignment.js:130:53

xadh00m commented 8 years ago

Thank you!

Stupidism commented 8 years ago

import { combineReducers } from 'redux';

internalError: Error running rule requireDollarBeforejQueryAssignment: This is an issue with JSCS and not your codebase.
Please file an issue (with the stack trace below) at: https://github.com/jscs-dev/node-jscs/issues/new
TypeError: Cannot read property 'name' of undefined
    at /home/stupid/.nvm/versions/node/v5.11.1/lib/node_modules/jscs/lib/rules/require-dollar-before-jquery-assignment.js:142:30
    at Array.forEach (native)
    at Object.<anonymous> (/home/stupid/.nvm/versions/node/v5.11.1/lib/node_modules/jscs/lib/rules/require-dollar-before-jquery-assignment.js:139:23)
    at Array.forEach (native)
    at Object.JsFile.iterateNodesByType (/home/stupid/.nvm/versions/node/v5.11.1/lib/node_modules/jscs/lib/js-file.js:331:42)
    at Object.module.exports.check (/home/stupid/.nvm/versions/node/v5.11.1/lib/node_modules/jscs/lib/rules/require-dollar-before-jquery-assignment.js:72:14)
    at [object Object].<anonymous> (/home/stupid/.nvm/versions/node/v5.11.1/lib/node_modules/jscs/lib/string-checker.js:189:22)
    at Array.forEach (native)
    at [object Object].StringChecker._checkJsFile (/home/stupid/.nvm/versions/node/v5.11.1/lib/node_modules/jscs/lib/string-checker.js:185:31)
    at [object Object].StringChecker.checkString (/home/stupid/.nvm/versions/node/v5.11.1/lib/node_modules/jscs/lib/string-checker.js:92:14) at src/store/reducers.js :
     1 |import { combineReducers } from 'redux';
--------^
     2 |import { routerReducer as router } from 'react-router-redux';
     3 |
markelog commented 8 years ago

@stupidisum you probably need to update jscs

Stupidism commented 8 years ago

@markelog My jscs was newly installed