videlais / snowman

An advanced Twine 2 story format designed for people who already know JavaScript and CSS
MIT License
128 stars 35 forks source link

Jshint? #40

Open Gpeschke opened 4 years ago

Gpeschke commented 4 years ago

I know it's probably a lot to ask, but it'd be SUPER cool if we could integrate jshint- running it on the javascript code before eval, then if the code errors, spitting out what jshint found.

videlais commented 4 years ago

That would probably mean including jshint in the build itself, which would be a major addition for what seems like a smaller number of use cases.

Gpeschke commented 4 years ago

To clarify- I was meaning before eval, not before eval(). Linting is similar to syntax highlighting in the dev cycle. Jshint is javascript's linting tool.

videlais commented 4 years ago

@Gpeschke Strict enforcement of ESLint "Standard" is now part of the GitHub action workflow.

Gpeschke commented 4 years ago

Hmmm... still seems like we are talking bout separate things.

I'm talking about within twine, when you are developing a story, it'd be nice to be able to lint.

videlais commented 4 years ago

@Gpeschke: We were originally talking about the same thing, I think. For you to be able to lint in the editor, either Twine 2 would have to add it (which it probably won't) or Snowman would have to carry and maintain the functionality (which is a huge hassle for little gain).

I'd like to eventually be able to add #20 at some point, but linting seems a long way off unless Twine 2 adds it for editing Story JavaScript.

If you want linting in your code, I'd recommend using something like TweeGo or my own Extwee and working on JavaScript outside of the browser or application. Linting could easily be part of the compiling process through ESLint or other tools.