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

Is there a way to escape liniting on imported JS from external? #1273

Closed
klclee opened this issue Dec 14, 2016 · 1 comment
Closed

Is there a way to escape liniting on imported JS from external? #1273

klclee opened this issue Dec 14, 2016 · 1 comment

Comments

@klclee
Copy link

klclee commented Dec 14, 2016

Hi All, i am pretty stuck so not necessary an issue but I want to know if it is possible. Or is there a way round it?

I am using bower to add some dependancy that is not in npm. Then I just use standard import in index.js to get those scripts into scope. However eslint is ran against this and is not passing on them. Is there a way to escape eslint on these imports. Or is there another way to bring in external (bower) libs in?

Thanks
C

@gaearon
Copy link
Contributor

gaearon commented Dec 14, 2016

The easiest way would be to copy them to the public folder and add a script to index.html, for example:

  <script src="%PUBLIC_URL%/jquery.min.js"></script>

Then in the application code you could use it like:

const $ = window.$; // or whatever global it exports

See the User Guide section on public folder. Note that you should use the minified version because the public folder contents is not automatically minified or optimized.

Alternatively you could just re-publish that dependency to npm yourself.

I hope this helps!

@gaearon gaearon closed this as completed Dec 14, 2016
@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants