-
Notifications
You must be signed in to change notification settings - Fork 151
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
support deno lint #162
support deno lint #162
Conversation
@axetroy denoland/deno#7303 has landed in Deno, so all required features should now be available on master. The 1.3.3 release on Friday will contain these features. |
Just a note - line numbers are still 1-based. |
@axetroy 1.3.3 has been released with all required features. |
/cc @lucacasonato @bartlomieju @ry it's ready for review Since my mother tongue is not English, So if some English descriptions are not accurate, please correct me. Two quick fixes have been added currently
|
We don't support this directive
But we support these two |
Is there something wrong? |
Then it seems to be a bug in implementation... 😢 currently fn create_linter(syntax: Syntax, rules: Vec<Box<dyn LintRule>>) -> Linter {
LinterBuilder::default()
.ignore_file_directives(vec!["deno-lint-ignore-file"]) <--- ignore whole file
.ignore_diagnostic_directives(vec![
"deno-lint-ignore", <---- ignore certain diagnostic
"eslint-disable-next-line", <---- ignore certain diagnostic (compatibility with ESLint)
])
.lint_unused_ignore_directives(true)
// TODO(bartlomieju): switch to true
.lint_unknown_rules(false)
.syntax(syntax)
.rules(rules)
.build()
} I'll try to fix this problem soon, but @axetroy please don't add |
@bartlomieju updated. BTW. I think
|
That's what |
So, what if I want to ignore a type of error in the file? To ignore all of them, I have to add |
@axetroy we can add rule codes to |
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.
This is looking very promising. There are a few issues I found while testing:
- the
ignore next line rule
quickfix does not work. It gives the errorcommand 'deno._ignore_text_line_hint' not found
. - As the source of the error,
Deno Language Server
is shown in the popover. It would be nice if this saiddeno_lint
instead. So the error shown would beEmpty switch statement deno_lint(no-empty)
. If this is not possibleEmpty switch statement Deno(lint/no-empty)
would be good too.
This is a typo and have been fixed. 0de60e6 |
@lucacasonato |
@lucacasonato rename |
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.
Thanks @axetroy! This is a great feature to have - I will create a 2.2 release for this feature today.
close #116
Please wait for these two issues to be resolved before merging
deno lint
command support read file from stdin likedeno fmt
deno#7218start
andend
for location and zero base deno_lint#290