mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 19:08:15 +00:00
chore: upgrade crates based on deno ast 0.3 (#12403)
This commit is contained in:
parent
b1e7452cd3
commit
9b1f0c8ba3
16 changed files with 315 additions and 248 deletions
|
@ -199,15 +199,10 @@ pub fn get_lint_references(
|
|||
parsed_source: &deno_ast::ParsedSource,
|
||||
maybe_lint_config: Option<&LintConfig>,
|
||||
) -> Result<Vec<Reference>, AnyError> {
|
||||
let syntax = deno_ast::get_syntax(parsed_source.media_type());
|
||||
let lint_rules =
|
||||
get_configured_rules(maybe_lint_config, vec![], vec![], vec![])?;
|
||||
let linter = create_linter(syntax, lint_rules);
|
||||
// TODO(dsherret): do not re-parse here again
|
||||
let (_, lint_diagnostics) = linter.lint(
|
||||
parsed_source.specifier().to_string(),
|
||||
parsed_source.source().text_str().to_string(),
|
||||
)?;
|
||||
let linter = create_linter(parsed_source.media_type(), lint_rules);
|
||||
let lint_diagnostics = linter.lint_with_ast(parsed_source);
|
||||
|
||||
Ok(
|
||||
lint_diagnostics
|
||||
|
@ -357,6 +352,7 @@ pub fn parse_module(
|
|||
// capture the tokens for linting and formatting
|
||||
capture_tokens: true,
|
||||
maybe_syntax: None,
|
||||
scope_analysis: true, // for deno_lint
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue