Open g-plane opened 2 years ago
Is it possible for swc to emit warning reports now?
It's stored at the handler
but it's dropped without emitting to stderr, because it's a function designed for general usecases. Maybe we can add an option to emit them to stderr or return the printed diagnostic even in case of success
Describe the bug
The ecma linter has a rule
no-use-before-define
, but its report level is decided by the rule itself, which will override users' config:https://github.com/swc-project/swc/blob/main/crates/swc_ecma_lints/src/rules/no_use_before_define.rs#L115-L119
As a configurable linter rule or even a linter tool, reporting a problem as an error or a warning should be decided and controlled by users, not the rule itself. If we want this rule to report errors only, we should make this rule unconfigurable.
Input code
No response
Config
Playground link
No response
Expected behavior
If we use the config above, that rule should report problems as warnings.
Actual behavior
If we use the config above, that rule will report problems as errors, which is unexpected for users. Because users are confused: Why it report me errors although I set
"warning"
in configuration? Is my configuration wrong?Version
1.2.149
Additional context
No response