Comments (11)
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.
@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.
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.
@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.
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.
@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.
@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.
from esfiddle.
@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.
@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.
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)
- Create About Page
- Dark/Light mode switch doesn't update theme dropdown element HOT 2
- Switching from Dark to Light mode and refreshing causes bug
- New Maintainer HOT 13
- Port to GitHub Actions HOT 1
- Fix Embedded View and Create test case HOT 1
- Fix tweet share button HOT 1
- Fix Github gist export HOT 1
- New Code Examples! - On going project! HOT 3
- Improve mobile view HOT 1
- Create github actions Docker pipeline HOT 6
- Create new homepage HOT 1
- Improve fiddle site speed - Multiple PR's welcome! HOT 1
- Change master branch to main HOT 2
- Resolve deprecated dependencies (multiple PR's welcome) HOT 4
- Minify Javascript source HOT 5
- Add Lighthouse CI HOT 2
- Remove unused Javascript HOT 2
- ES7 -2017 - Async-await best practice example HOT 4
- esfiddle.net website is not working HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esfiddle.