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
no-unused-vars argsIgnorePattern affecting "args": "after-used" since 3.6.0 #7250
Comments
(Note: this was detected because we have our argsIgnorePattern too liberally matching by mistake) |
This was probably caused by #7143. I think the issue is that we now check for the last non-ignored parameter (in your case, |
Confirmed in the online demo. I think this is something we should consider for a patch release, if possible. |
Thank you for this issue. Though I'd like to say this is intentional since By the way, I'm interested in the option which warns such access to ignored variables. Maybe |
Thanks! As mentioned above - in our case it was caused by a misconfiguration of argsIgnorePattern which matched a lot of args, so I am not sure how much you should be concerned about this being a problem in practice. |
1) Bump eslint verson in npm 2) Enable tabs rule introduced in 3.2.0 3) With rules deprecated in 3.3.0 to their replacements http://eslint.org/blog/2016/08/eslint-v3.3.0-released 4) Deprecate the use of M.str (fixes MDLSITE-3646) with new no-restricted-properties introduced in 3.5.0 5) Fixup no-unused-vars - remove argsIgnorePattern which shouldn't have allowed partial matches and turns out to be uncesssary (detected because of eslint/eslint#7250 in 3.6.0)
Tell us about your environment
What parser (default, Babel-ESLint, etc.) are you using? deafult
Please show your full configuration: https://github.com/moodle/moodle/blob/master/.eslintrc
What did you do? Please include the actual source code causing the issue.
When attempting to upgrade to eslint 3.6.0, we got some new errors reported by no-unused-vars which should have been ignored by
args: 'after-used'
. It turned out that argsIgnorePattern is now affecting the result of things which should be ignored by"args": "after-used"
I attempted to isolate the code down to the smallest test case:
Problem file:
Output:
$ eslint problem.js /Users/danp/www/eslintest/problem.js 3:16 error 'bar' is defined but never used no-unused-vars ✖ 1 problem (1 error, 0 warnings)
Ok file:
The text was updated successfully, but these errors were encountered: