Closed nelsonic closed 7 years ago
@nelsonic see #247 and https://github.com/dwyl/abase/pull/46
This is our SHORT TERM HACK so we can use goodparts with atom. The file you're seeing is just a symlink. The ./rules
file it's requiring is relative to the goodparts
directory in node_modules, not the project root.
The proper long term solution is to create an atom plugin #243.
@eliascodes so it's ok to include this file in my .gitignore
?
@nelsonic yes I would recommend that you do.
@nelsonic @eliascodes symlinking isn't ideal. Just committed my .eslintrc.js
symlink into my new repo and not too pleased. Obviously my bad but if I'm going to the effort of adding it to my .gitignore i'd rather just create an my own .eslintrc.js
and extend the goodparts module saving having to use global eslint (in atom) which is again causing me problems working on other projects which have their own .eslintrc
@jrans @nelsonic what do you think about this:
package.json
.eslintrc
file which has extends: goodparts
goodparts
CLI to do the symlinking if that's still something we want to keep (e.g. you would run goodparts link
or something like that)@jrans @nelsonic there is a problem with the approach I outlined above: any shareable configs must have package names of the form "eslint-config-packageName"
. This is documented here, and you can see the code that I think corresponds to it here. I've tried it out locally and get an error thrown when eslint can't find the config. In my .eslintrc.json
:
{
"extends": "goodparts"
}
Then when I try to run the goodparts
CLI, I get:
Error: Cannot find module 'eslint-config-goodparts'
So a npm package by the name of goodparts
cannot be used as a shareable config.
I've pushed a branch where I've implemented steps 1 and 3 from my last comment. Let me know if you want me to PR it.
@eliascodes ideally we would not have an .eslintrc
or .eslintrc.json
in any of our projects and simply use the goodparts
.bin
script e.g: npm run goodparts
...
@nelsonic well happily that's already possible 😄
I can see why it is handy to have a real-time linter running in your editor though. If we do want to make that happen, it might just be better to bite the bullet and actually write an atom plugin at some point.
Anyway, please let me know if you would like me to submit a PR. If so, I need to write a couple more tests because I introduced a couple branches into the bin/cmd.js
that aren't covered by a simple require
.
Has this issue now been fully addressed (can it be closed)?
@eliascodes great question. we will know soon ... https://github.com/dwyl/hapi-auth-jwt2/issues/211 😉
#Succcess
✅
Thanks @eliascodes ❤️
Hi @eliascodes / @shouston3 / @SimonLab / @jrans Hope your evening is going well... I just tried to
Which attempts to
npm install goodparts
and it creates an.eslintrc.js
file in the root of my project:require('./rules')
... is this the desired behaviour...?