MiguelCastillo / Brackets-InteractiveLinter

Interactive linting for Brackets
Other
119 stars 26 forks source link

How to update eslint #166

Open onemen opened 9 years ago

onemen commented 9 years ago

How can i update eslint to its latest version?

MiguelCastillo commented 9 years ago

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 commented 8 years ago

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 commented 8 years ago

@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 commented 8 years ago

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 commented 8 years ago

@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 commented 8 years ago

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...