SidneyNemzer / snippets

A Chrome extension that allows you to create and edit JavaScript code snippets, which are synced to all your computers
https://chrome.google.com/webstore/detail/snippets/fakjeijchchmicjllnabpdkclfkpbiag
63 stars 9 forks source link

linter is out-of-date #24

Closed zachvictor closed 4 years ago

zachvictor commented 4 years ago

Linter doesn't like standard ES6 stuff ... not sure I'm at the level to contribute. I love your extension. I could donate $ and/or pull request(s)

SidneyNemzer commented 4 years ago

You are absolutely correct, the linter is super out of date :(

First I want to try updating react-ace, which I hope will have a newer linter. If not, I think the new version will make it easier to include a custom linter (aka 'mode').

I can't promise exactly when this will happen since other stuff has taken priority lately but you can track progress in the project: https://github.com/SidneyNemzer/snippets/projects/1

SidneyNemzer commented 4 years ago

Progress:

I've updated react-ace (changes are on master but not published)

The linter is smarter, but maybe too smart for its own good 🤔 image

Adding /* jshint esversion: 8 */ gives me an error about conflicting config. I'll have to dig into it a bit more before releasing!

zachvictor commented 4 years ago

argh! i feel you on "too smart for its own good" — and probably one would rather not expose linter config options in the UI component of Snippets, which (to my eye) seems to want to be as simple and unobtrusive as possible (that's a nice thing as far as I'm concerned).

would allowing the user to run a console command to implement/include a linter (or other kind of module, for that matter) be possible — or rather, not just possible, but might it be easier as a solution (less work for you, simpler user experience, etc)? if the user is using Snippets, the user is presumably comfortable running a piece of code in the console and perhaps figuring that kind of thing out.

SidneyNemzer commented 4 years ago

would allowing the user to run a console command to implement/include a linter (or other kind of module, for that matter) be possible — or rather, not just possible, but might it be easier as a solution (less work for you, simpler user experience, etc)?

That's a interesting idea! Unfortunately I think the actual implementation would be pretty complicated 😅 .

My plan is to integrate ESLint into Ace. Doesn't seem like a revolutionary idea, but I can't find any other projects that have done it for some reason. It's tricky because of Ace's module system, but I've made some good progress the past few nights.

If that doesn't work out, I can switch to Codemirror + ESLint. ESLint has a web-based demo which uses Codemirror, that will be a good starting point.

SidneyNemzer commented 4 years ago

Update: I have completed the integration with ESLint! If you're curious you can see the changes in this diff:

https://github.com/SidneyNemzer/snippets/compare/aa4121efab7bef931ec60d35011d9331304ee2fd...4aa9193c19e01d6623b4f36ee9fbe4edd408d7c2

I have a few more minor changes I want to make, so I'll be releasing the next version sometime this week

zachvictor commented 4 years ago

I never replied to your penultimate comment. Thank you for your initiative and work. I don't take stuff like this for granted and am grateful. I'll check out the diff now!

zachvictor commented 4 years ago

This was a substantial chunk of work. Even if parts were extracted from another project, you know how it is — must review every line statically and test dynamically in every way possible. Non trivial! Thanks for doing all that.

SidneyNemzer commented 4 years ago

I really appreciate the kind words :)

I've submitted version 2.3.0 to the Chrome store, which includes the new linter. It will probably take about a day or two before it goes live (there is a review process).

zachvictor commented 3 years ago

Thank you, Sidney! I've been using the newer Snippets. The updated linter is great!