-
Notifications
You must be signed in to change notification settings - Fork 364
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
Linter: Catch "no undef" rules #1429
Conversation
.eslintrc.json
Outdated
}, | ||
"parserOptions": { | ||
"ecmaVersion": 6 | ||
}, | ||
"rules": { | ||
"no-unused-vars": 0, | ||
"no-undef": 0, | ||
"no-undef": "error", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think this line can just get deleted since it's in the "recommended" rules https://eslint.org/docs/rules/no-undef
.eslintrc.json
Outdated
@@ -1,14 +1,16 @@ | |||
{ | |||
"extends": "eslint:recommended", | |||
"env": { | |||
"browser": true | |||
"browser": true, | |||
"node": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think node
should be on, since it might not flag things the examples. The scripts
folder already has it one since those are nodejs scripts
Whoops I forgot about this PR @nschonni just got to your comments! |
|
@@ -1,5 +1,8 @@ | |||
{ | |||
"extends": "../.eslintrc.json", | |||
"env": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternately, this file could be deleted, and the config hoisted to an overrides
section in the root config like https://eslint.org/docs/user-guide/configuring#specifying-processor
Hi @mcking65 you asked to understand the options a bit better here: If we want to merge this js lint error (catching any new undefined variables), we would have to edit 30 or so files to add a eslint comment specifically listing which globals they should not error on. A lot of those undefs come from the old way APG example code was structured, in multiple files, but Jon has been changing that example by example. It will take a while for all those rewrites to be completed, which is why I want to just go through and add the ignore comment to all these files for now! |
Closing this PR in favor of @nschonni's: https://github.com/w3c/aria-practices/pull/1610/files |
I'm just curious if there is support for this change! Now that we are using "no strict" it would be nice to catch undefs in the linter, rather than in edge cases in the application.
This PR will fail in the CI for two reasons (for now):