Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Use the local XO when available #41

Closed
sindresorhus opened this issue Oct 17, 2016 · 3 comments · Fixed by #49
Closed

Use the local XO when available #41

sindresorhus opened this issue Oct 17, 2016 · 3 comments · Fixed by #49

Comments

@sindresorhus
Copy link
Owner

Like the CLI does. Should have done this from the start. Can't remember why I didn't.

@novemberborn
Copy link

Can't remember why I didn't.

I suspect you may have to run the linting in a child process to prevent arbitrary packages from running within the Atom security context? (Don't know much about how that all works though.)

@sindresorhus
Copy link
Owner Author

@novemberborn There's a dirty workaround:

atom-linter-xo/index.js

Lines 11 to 13 in f3d443b

allowUnsafeNewFunction(() => {
lintText = require('xo').lintText;
});

@novemberborn
Copy link

That avoids giving the dependency access to the Atom process?

marionebl added a commit to marionebl/atom-linter-xo that referenced this issue Nov 13, 2016
This PR turned out way bigger than planned.
Hope the noise/gain ratio is good enough.

- tries to load xo, eslint an parser from cwd
- introduces fallback to __dirname if resolving fails
- uses proxyquire to load shareable config, plugins from cwd, too
- moves linting call to forked process
- removes loophole due to forked process making it obsolete

- targets sindresorhus#19
- targets sindresorhus#42
- targets sindresorhus#41
marionebl added a commit to marionebl/atom-linter-xo that referenced this issue Nov 21, 2016
marionebl added a commit to marionebl/atom-linter-xo that referenced this issue Nov 24, 2016
marionebl added a commit to marionebl/atom-linter-xo that referenced this issue Nov 24, 2016
sindresorhus pushed a commit that referenced this issue Nov 24, 2016
* follow-up for #46
* builds on #47
* closes #19
* closes #41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants