will-sh commented on code in PR #10094:
URL: https://github.com/apache/ozone/pull/10094#discussion_r3131174095
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/.eslintrc.json:
##########
@@ -36,13 +37,7 @@
"allowTemplateLiterals": true
}
],
- "no-unused-vars": [
- "warn",
- {
- "argsIgnorePattern": "^_\\w*",
- "varsIgnorePattern": "^_\\w*"
- }
- ],
+ "no-unused-vars": "off",
Review Comment:
@spacemonkd Thanks for pointing this out!
Since this is a TypeScript project, we should disable the base ESLint rule
("no-unused-vars": "off") on line 40 to avoid false positives with TS
types/interfaces, which is the standard practice recommended by the
[typescript-eslint](https://typescript-eslint.io/rules/no-unused-vars/) docs.
However, at lines 76-81, we have already enabled the TypeScript-aware
version of this rule (@typescript-eslint/no-unused-vars) and configured it as
you suggested.
```json
"@typescript-eslint/no-unused-vars": [
"warn", {
"argsIgnorePattern": "^_\\w*",
"varsIgnorePattern": "^_\\w*"
}
]
```
This explicitly allow underscore-prefixed variables (like _item) while
warning about other unused ones.
So this is already taking care of the scenario you mentioned, what do you
think?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]