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

Cannot use /* exported */ to prevent no-unused-vars warnings #614

Closed
davidystephenson opened this issue Sep 7, 2016 · 1 comment

Comments

@davidystephenson
Copy link

commented Sep 7, 2016

I am writing javascript for use in a browser environment, without using node/webpack/browserify. I want to be able to use eslint's exported keyword to mark variables that will be used in other imported files. This keyword does not seem to be functioning currently.

@feross

This comment has been minimized.

Copy link
Member

commented Sep 10, 2016

Interesting. I wasn't aware eslint had an exported keyword. Context here: eslint/eslint#1200

This keyword won't work with standard because we enable the "node" eslint environment which makes eslint assume that all code is in a function scope.

I suggest using the recommendation from RULES.md, which is to explicitly use window.*. For example:

window.MyExportedVar = function () { /* ... */ }

@feross feross closed this Sep 10, 2016

@feross feross added the question label Sep 10, 2016

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
2 participants
You can’t perform that action at this time.