-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Exported var was used before it was defined in 2.9.0 #2662
Labels
Comments
|
The regression has been introduced in 08eb4e2 |
@nicolo-ribaudo please comment if you are working on a fix and I won't start working on one.. |
Assuming not.. |
I've started trying to think of the best solution.. the easy thing is to
not warn latedef when no usages have tokens.. or have a flag for a non
export directive on the usage state.. alternatively don't use usages, but
then we have to resolve the export directive to the right scope...
Those are my thoughts so far. I am running out of time today though so go
ahead if you have started or have an idea..
|
I would probably try the flag route.. so non directive exports set
usages.codeUsage or something like that and latedef checks that. but you
might have a better idea...
|
I have a fix which is almost working... (It just has a bug when exporting variables defined using |
nicolo-ribaudo
added a commit
to nicolo-ribaudo/jshint
that referenced
this issue
Sep 4, 2015
… marked as exported Fixes jshint#2662
go ahead, I will look at the PR.
|
nicolo-ribaudo
added a commit
to nicolo-ribaudo/jshint
that referenced
this issue
Sep 4, 2015
nicolo-ribaudo
added a commit
to nicolo-ribaudo/jshint
that referenced
this issue
Sep 4, 2015
jugglinmike
pushed a commit
to jugglinmike/jshint
that referenced
this issue
Sep 20, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using JSHint 2.9.0, I get this error:
common-lib.js: line 2, col 5, 'commonLib' was used before it was defined.
and in previous versions of JSHint I did not. Moving the/* exported ... /*
line to the end of the file resolves the symptom. Here is a minimum sample repro project:.jshintrc:
common-lib.js:
command I run:
jshint .
The text was updated successfully, but these errors were encountered: