Giter VIP home page Giter VIP logo

Comments (7)

hzoo avatar hzoo commented on June 1, 2024

Hmm I tried reproducing with your code snippet but don't get any errors? This is with babel-jscs 2.0.0, jscs#master and latest babel version as well (maybe update that).

from babel-jscs.

priyatham-aps avatar priyatham-aps commented on June 1, 2024

I am using latest babel: 5.6.23 (babel-core 5.7.4)

I have created a minimal repo for the issue at https://github.com/priyatham-aps/babel-jscs-ternaryop-issue.

Please check it out, run npm install and jscs. Hopefully, this will help in demonstrating the issue.

from babel-jscs.

priyatham-aps avatar priyatham-aps commented on June 1, 2024

I added a few more scenarios in the above repo. Looks like the issue is not with the nesting of ternary operators but usage of brackets in the expressions of ternary operator.

from babel-jscs.

priyatham-aps avatar priyatham-aps commented on June 1, 2024

@hzoo
Are you able to reproduce the issue? Or do you need any further help from me on this?

from babel-jscs.

hzoo avatar hzoo commented on June 1, 2024

Sorry been kinda busy so couldn't get to this. I just tried it again and cannot reproduce - what node version are you using? Also what you can do now is just do

  "devDependencies": {
    "jscs": "jscs-dev/node-jscs"
  }

because jscs will include babel and babel-jscs already.

In your .jscsrc you can do

{
    "esnext": true,
    "disallowMultipleSpaces": true
}

since it will exclude node_modules by default now and esnext will use babel-jscs

Or you can do ./node_modules/.bin/jscs index.js --esnext. I didn't get any errors after doing this either (with io.js 2.3.4)

I just updated the readme with this - hopefully it's more useful now.

from babel-jscs.

priyatham-aps avatar priyatham-aps commented on June 1, 2024

I just tried it the way you have recommended by uninstalling babel-jscs and babel from dev-dependencies and removing esprima option from .jscsrc. When I ran jscs, I got an error saying Cannot find module 'babel-jscs'.

I then did npm uninstall jscs --save-dev and installed it again. Now, I am not getting the issue anymore. At this point, it looks like I may have been using an earlier commit from master branch of jscs, though I am not entirely sure.

Appreciate the info and help though. Thanks.

from babel-jscs.

hzoo avatar hzoo commented on June 1, 2024

Ok great!

from babel-jscs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.