Repository navigation
download eslint package from npm and place it into default extensions - #13108
Conversation
|
I think Atom added a new field in their package.json, packageDependencies, and use it to install their extensions. I think I prefer their approach. |
|
@ficristo Can you shine a bit more light how these |
|
I didn't look at Atom implementation, but I think the usage is similar to the node dependencies. "packageDependencies": {
"atom-dark-syntax": "0.28.0",
"atom-dark-ui": "0.53.0",
"...": "..."
}We could have something like: "dependencies": {
"chokidar": "1.6.0",
"...": "..."
},
"devDependencies": {
"grunt": "0.4.5",
"...": "..."
},
"packageDependencies": {
"brackets-eslint": "1.0.0",
"...": "..."
}and use npm to install them. |
bb72d91 to
3e45509
Compare
|
@ficristo check now |
|
I only skimmed the changes. From what I understood ESLint will installed in the default extensions so users will not able to remove this extension. Is it right? |
|
I don't think that's an issue (same way they can't remove JSLint now nobody really uses), but also a good point, I could make a PR to display default extensions in extension manager and delete them. |
|
@zaggino Do you mean that default extensions would be physically deleted? That might be problematic from install dir due to permissions, and how would user re-install them? Another option is to list default extensions in extension manager (possibly in a new tab) and allow them to be disabled/re-enabled. Note that Brackets has not been tested without the default extensions so different combinations should be tested. |
|
@redmunds Yeah I mean't disable/enable as a configuration preference, not sure why I wrote delete. If some extensions are critical for Brackets to run, we could hard-code that they can't be disabled, but I think most of them won't cause this sort of problems. |
|
Very Cool. I don't think any of the default extensions were intended to be critical -- they just haven't been tested to verify it. |
|
ref: #13136 |
|
default extensions can be now disabled in the UI, so this can take another look guys |
|
I was wondering if instead of downloading from npm wouldn't it be better to use brackets registry? |
|
@zaggino Great work here 👍 . I took the liberty to resolve the conflicts, as I wanted to test this branch. I looked at the code and it looks good to me. If everything works fine in real usage for a couple of days, I will merge this PR. Do you recall any pending item in this PR which I might have missed? |
|
@swmitra The only thing to consider is that after this, it's higly likely that people will have |
|
@zaggino Thanks a lot for quick response 👍 . I will test that scenario more extensively then. |
|
I have modified the registration and fetching logic of registered providers a bit based on the following idiom.
@zaggino @ficristo @petetnt Can you please have a look at this PR urgently? This needs to be in for next release to provide basic es6 support ... |
|
I can no longer review this PR, but definitely work on the PR 😄 |
|
I have written most of the code so not much to review. |
|
The priority field is for future use. As of now it will default to 0 in the priority check and collision resolution will happen on load order. |
|
@zaggino I should have been more precise. My mistake. I meant the last commit. As the existing code is already reviewed, I wanted to focus just on the open part to handle conflict between same providers. In the process, I thought of limiting the linting by only a single language specific linter. Looking at both EsLint and JSLint together made me skeptical about the overhead. |
|
Not sure about the single linter, on my projects I use both TypeScript (with TSLint) and ESLint to lint my files. I wouldn't want to have only one. |
…ost recently loaded one
|
@zaggino Thanks for sharing the multiple linter use case. Removed the priority based sorting now. Instead, we now look for providers of a given language having same provider name. If found, remove it and retain the most recently loaded one. Tested with same extension co-existence in Brackets core and user exetensions, and what I have noticed is, user extensions are the ones that used for linting if at all there are any name conflicts. |
|
@nethip Can you please review this PR? 🙏 |
| "version": "0.1.4", | ||
| "from": "xmldoc@>=0.1.2 <0.2.0", | ||
| "resolved": "https://registry.npmjs.org/xmldoc/-/xmldoc-0.1.4.tgz", | ||
| "version": "0.1.2", |
| "version": "0.6.1", | ||
| "from": "sax@>=0.6.1 <0.7.0", | ||
| "resolved": "https://registry.npmjs.org/sax/-/sax-0.6.1.tgz", | ||
| "version": "0.4.2", |
There was a problem hiding this comment.
is this an intended downgrade of the version?
|
@swmitra Code wise I am fine. I have taken the liberty in adding check boxes for pending items, so that it is easier to track the progress.
Update - Library versions are intact now. |
petetnt
left a comment
There was a problem hiding this comment.
FWIW LGTM, bit too late though. Nice work!
…adobe#13108) * download eslint package from npm and place it into default extensions * add defaultExtensions section to package.json * lock deps, add shrinkwrap again * do not lint brackets-eslint files * Handle multiple linters for a specific language using priority and load order * Handle provider name conflict for a given language by retaining the most recently loaded one * Remove invalid comment * Update npm-shrinkwrap.json
…adobe#13108) * download eslint package from npm and place it into default extensions * add defaultExtensions section to package.json * lock deps, add shrinkwrap again * do not lint brackets-eslint files * Handle multiple linters for a specific language using priority and load order * Handle provider name conflict for a given language by retaining the most recently loaded one * Remove invalid comment * Update npm-shrinkwrap.json
Related to #11984
As a part of this PR I'd like to make a change, that when
brackets-eslintis found inextensions/userdirectory, it won't be loaded fromextensions/defaultdirectory - I'd like your thoughts on that.