Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to update eslint #166

Open
onemen opened this issue Oct 18, 2015 · 6 comments
Open

How to update eslint #166

onemen opened this issue Oct 18, 2015 · 6 comments

Comments

@onemen
Copy link

onemen commented Oct 18, 2015

How can i update eslint to its latest version?

@MiguelCastillo
Copy link
Owner

Unfortunately, this is a manual process right now. I have been collaborating with someone else to automate the process, but it has been rather difficult.

But if you are interested, I clone eslint and run their browserify npm script. I copy that build output directly into the eslint plugin.

@aravindet
Copy link

Is it possible to have InteractiveLinter use the globally installed eslint instead? I use the babel-eslint parser and the jsx plugin, and both are configured in .eslintrc, but neither are having an effect.

@MiguelCastillo
Copy link
Owner

@aravindet It is certainly possible, but not quite that simple. Primarily because linters are loaded by interactive linter in memory and they run in a worker thread. The one option that has chance from your suggestion is to basically run commands via node (since that's what Brackets provides), and that will require some changes. Adding this is limiting because we will also need to create a parser for the output that goes to stdout in order to generate the data necessary for interactive linter to report the errors. This approach might be attainable if we created an eslint reporter that generates output as JSONLines with the data interactive linter needs.

The alternative kind of implied with the suggestion is loading the module from global node_modules, which does not quite work because eslint loads files from disk and that's not possible from requirejs/browser environment.

Please, keep the ideas coming! I am also thinking about how we can answer this problem.

@aravindet
Copy link

I understand, running eslint in a node.js process seems to be the best way forward. Instead of writing a parser for stdout, it might be possible to write a tiny wrapper in node, which uses the eslint API and returns output as JSON back to the the browser.

I am new to Brackets extension development, but I found this doc about adding a node module to the extension and calling it from the client code. I could give it a try but I have a lot to learn before I get there (Brackets extension API, InteractiveLinter architecture, ESLint API).

@MiguelCastillo
Copy link
Owner

@aravindet yeah man, no problem! I appreciate you taking a look and initiative to come up with something. So you could probably use this old plugin I created to see how you can integrate a node plugin. So, perhaps we can create another eslint plugin that works over node. https://github.com/MiguelCastillo/Brackets-TomcatManager/blob/master/node/TomcatDomain.js

I am happy to help you through this.

@PhiLhoSoft
Copy link

I mentioned the issue in #153 but it is good to have a separate issue.
Being lazy, I didn't want to clone ESLint and run browserify... So I went to the demo page, saw with Firebug that it loads the file from http://eslint.org/js/app/eslint.js so I downloaded it and replaced the copy on C:\Users\AppData\Roaming\Brackets\extensions\user\interactive-linter\plugins\default\eslint\libs (yes, I use Windows...).
Then I restarted Brackets, and given I had some warnings I didn't have before, I suppose it worked...
Problem: I suppose I will have to redo this on new update of InteractiveLinter...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants