Coder Social home page Coder Social logo

Comments (11)

jinmehta13 avatar jinmehta13 commented on June 12, 2024

Hi, I'm looking to make my first open source contribution and this looks like a good opportunity. Could you provide some more specifics on how you would like to incorporate JShint as a CDN? Also, just doing some quick checks I only noticed the linter returning errors for "Map" and "Exponentiation Operator" not "Array Includes". Those errors persisted even after I substituted a JShint v2.9.4 file in place of the existing jshint.js under esfiddle/static/lib/jshint which was JShint v2.5.10. Looking forward to contributing. Thanks

from esfiddle.

joshghent avatar joshghent commented on June 12, 2024

@jinmehta13 Hi there, thanks for looking into this. I looked into it briefly myself and since JSHint gets uglified into es6-fiddle.js then we do not need to replace it with a CDN.

Hmm that is odd that it doesn't fix it. Perhaps take a look into the specific linting errors and see if you can step through the JSHint code to try and spot the issue. It's more than likely a bug our end rather than JSHint.

from esfiddle.

jinmehta13 avatar jinmehta13 commented on June 12, 2024

I think some of these ES7 features just aren't available in JSHint yet. I tried putting the code under the examples section of the Mozilla documentation for the exponentiation operator directly into JSHint and the errors/warnings still show. The Mozilla documentation example code for Array includes passes just fine though.

from esfiddle.

joshghent avatar joshghent commented on June 12, 2024

@jinmehta13 Hmm ok, thank you for your research. Perhaps we can switch to something like Babel or Traceur to lint the code instead? Would you be able to do a PR for this?

from esfiddle.

jinmehta13 avatar jinmehta13 commented on June 12, 2024

Sure thing, I'll give it a go. I checked out Traceur and it has the same errors/warnings as JSHint but Babel has support for things like the exponentiation operator so I'll switch to that. If I run into any trouble or have questions, I'll let you know!

from esfiddle.

jinmehta13 avatar jinmehta13 commented on June 12, 2024

@joshghent I'm at a bit of a roadblock. So it looks like there's some Babel already in the project. Is that sufficient to make the switch? I tried using grunt-babel and added a .babelrc file with presets but I'm not sure how to replace JSHint with Babel in es6-fiddle.js. Can you point me in the right direction?

from esfiddle.

joshghent avatar joshghent commented on June 12, 2024

@jinmehta13 yes Babel is used currently for the actual transpiling of the code and running it. JSHint is used for the linting.

This change would involve you looking for the Babel API methods to lint code. I can clear up JSHint but we need to make sure that babel is the one doing the transpiling and linting. Thanks 👍

from esfiddle.

tarang9211 avatar tarang9211 commented on June 12, 2024

from esfiddle.

joshghent avatar joshghent commented on June 12, 2024

@tarang9211 That is the linting of the source code. We are talking about the linting on the actual site. When you click the lint code button 😁 Lots of linting 😆

from esfiddle.

jinmehta13 avatar jinmehta13 commented on June 12, 2024

@joshghent, really hitting a brick wall here. I get that I need to replace the linting button code in es6-fiddle.js lines 233-269 with babel linting methods but I'm finding very little documentation for inline linting with babel or babel-eslint. Everything seems to be directed at linting a file or directory.

from esfiddle.

SaraVieira avatar SaraVieira commented on June 12, 2024

I think this is a matter of updating jsHint from what I have tested, maybe include it as a node module and get it from there instead of from the libs

from esfiddle.

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.