You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Manually fixing linting errors has highlighted a few rules we're currently enforcing that are not suitable for MetacatUI currently:
The import/no-unresolved rule needs to be disabled because our project uses RequireJS for module loading, which very challenging to configure with the import resolution checks enforced by this rule. For example, we would need to write something custom to resolve paths configured in the RequireJS configuration.
There are cases where it's useful to include unused variables in functions, such as when a function is a callback that doesn't use all of the arguments passed to it. We want to allow unused variables in these cases but still check for unused variables in the rest of the codebase. We can achieve this by allowing unused variables prefixed with an underscore (_). This way, we can indicate that the variable is intentionally unused and avoid linting errors.
Manually fixing linting errors has highlighted a few rules we're currently enforcing that are not suitable for MetacatUI currently:
The
import/no-unresolved
rule needs to be disabled because our project uses RequireJS for module loading, which very challenging to configure with the import resolution checks enforced by this rule. For example, we would need to write something custom to resolve paths configured in the RequireJS configuration.There are cases where it's useful to include unused variables in functions, such as when a function is a callback that doesn't use all of the arguments passed to it. We want to allow unused variables in these cases but still check for unused variables in the rest of the codebase. We can achieve this by allowing unused variables prefixed with an underscore (
_
). This way, we can indicate that the variable is intentionally unused and avoid linting errors.Rule overrides to add:
"import/no-unresolved": "off"
"variables/no-unused-vars": ["error", { "vars": "all", "args": "after-used", "ignoreRestSiblings": true, "varsIgnorePattern": "^_" }]
The text was updated successfully, but these errors were encountered: