jscs-dev / babel-jscs

(deprecated) JSCS has merged with ESLint, so check out babel-eslint!
https://github.com/babel/babel-eslint
MIT License
27 stars 6 forks source link

Getting "Warning: Unknown node type Super" error after upgrading to 2.0.0 #11

Closed EvHaus closed 9 years ago

EvHaus commented 9 years ago

After upgrading to babel-jscs 2.0.0, I'm getting this error when running grunt-jscs:

Warning: Unknown node type Super

This is not an issue with babel-jscs 1.0.3.

Any ideas?

hzoo commented 9 years ago

Not exactly sure but you might need to update jscs to latest (master)

mrjoelkemp commented 9 years ago

Yeah, it's likely due to the missing estraverse visitor keys without the latest JSCS master.

hzoo commented 9 years ago

@globexdesigns still an issue?

EvHaus commented 9 years ago

Yes. I'm running the latest version of JSCS.

mrjoelkemp commented 9 years ago

Can you provide a snippet that reproduces the error please?

Thanks in advance. On Jul 10, 2015 12:43 AM, "Globex Designs, Inc." notifications@github.com wrote:

Yes. I'm running the latest version of JSCS.

— Reply to this email directly or view it on GitHub https://github.com/jscs-dev/babel-jscs/issues/11#issuecomment-120223108.

craigklem commented 9 years ago

I am seeing the same error. I believe I have setup according to instructions. Here is output: Error: Unknown node type Super. at Controller.traverse (C:\Program Files\nodejs\node_modules\jscs\node_modules\estraverse\estrave rse.js:517:31) at Object.traverse (C:\Program Files\nodejs\node_modules\jscs\node_modules\estraverse\estraverse. js:709:27) at Object.iterate (C:\Program Files\nodejs\node_modules\jscs\lib\tree-iterator.js:9:20) at Object.JsFile.iterate (C:\Program Files\nodejs\node_modules\jscs\lib\js-file.js:359:29) at Object.JsFile._buildNodeIndex (C:\Program Files\nodejs\node_modules\jscs\lib\js-file.js:752:14 ) at Object.JsFile (C:\Program Files\nodejs\node_modules\jscs\lib\js-file.js:39:28) at StringChecker._createJsFileInstance (C:\Program Files\nodejs\node_modules\jscs\lib\string-chec ker.js:202:16) at StringChecker.checkString (C:\Program Files\nodejs\node_modules\jscs\lib\string-checker.js:104 :25) at null. (C:\Program Files\nodejs\node_modules\jscs\lib\checker.js:43:21) at Array. (C:\Program Files\nodejs\node_modules\jscs\node_modules\vow\lib\vow.js:711:3 9)

hzoo commented 9 years ago

Can you provide a short snippet of code that results in the error so we can look into this/reproduce it? Probably involves classes and extends I assume?

On Jul 10, 2015 9:11 AM, "Craig Klementowski" notifications@github.com wrote:

I am seeing the same error. I believe I have setup according to instructions. Here is output: Error: Unknown node type Super. at Controller.traverse (C:\Program Files\nodejs\node_modules\jscs\node_modules\estraverse\estrave rse.js:517:31) at Object.traverse (C:\Program Files\nodejs\node_modules\jscs\node_modules\estraverse\estraverse. js:709:27) at Object.iterate (C:\Program Files\nodejs\node_modules\jscs\lib\tree-iterator.js:9:20) at Object.JsFile.iterate (C:\Program Files\nodejs\node_modules\jscs\lib\js-file.js:359:29) at Object.JsFile._buildNodeIndex (C:\Program Files\nodejs\node_modules\jscs\lib\js-file.js:752:14 ) at Object.JsFile (C:\Program Files\nodejs\node_modules\jscs\lib\js-file.js:39:28) at StringChecker._createJsFileInstance (C:\Program Files\nodejs\node_modules\jscs\lib\string-chec ker.js:202:16) at StringChecker.checkString (C:\Program Files\nodejs\node_modules\jscs\lib\string-checker.js:104 :25) at null. (C:\Program Files\nodejs\node_modules\jscs\lib\checker.js:43:21) at Array. (C:\Program Files\nodejs\node_modules\jscs\node_modules\vow\lib\vow.js:711:3 9)

— Reply to this email directly or view it on GitHub https://github.com/jscs-dev/babel-jscs/issues/11#issuecomment-120407279.

hzoo commented 9 years ago

To clarify - running the latest (master) is not the same as the latest on npm (1.13.1).

You can do npm i jscs-dev/node-jscs --save-dev or change package.json

// package.json
{
  "jscs": "jscs-dev/node-jscs#master", // master branch
  "jscs": "jscs-dev/node-jscs#4d7043" // or the specific commit
}

I tried with no issues: class A extends B {}

craigklem commented 9 years ago

We are using React. All our React classes extend from React.Component and look similar to this: import React from 'react'; class Navbar extends React.Component { constructor(props) { super(props); this.state = { toggled: false }; render() {} } module.exports = Navbar;

hzoo commented 9 years ago

Yeah I tried that (similar to the example I posted) and have no issues. You are probably using an old jscs commit (the latest version on npm but not the latest code on github) . Can you try what I posted before?

Yep I just tried installing with jscs 1.13.1 and I get the same error. You need to install the master branch because babel-jscs isn't officially released since we are waiting for jscs 2.0 (next week).

https://github.com/jscs-dev/babel-jscs/releases/tag/v2.0.0