Skip to content
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

fix(lint): linting package with .css file should raise no errors #26695

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

bartlomieju
Copy link
Member

Closes #26308

@bartlomieju
Copy link
Member Author

This is currently failing with

error: Expected a JavaScript or TypeScript module, but identified a Css module. Importing these types of modules is currently not supported.
  Specifier: file:///Users/ib/dev/deno/tests/specs/lint/package_with_css_export/globals.css

There are two issues here that I want to fix:

  1. CSS files should just be skipped
  2. deno lint main.ts should not run no-slow-types across all files.

Comment on lines +296 to +299
eprintln!("paths {:#?}", paths);
let mut futures = Vec::with_capacity(2);
if linter.has_package_rules() {
// Package rules are only in effect if user didn't explicitly specify paths on the command line
if paths.is_empty() && linter.has_package_rules() {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bit seems broken - whether we invoke deno lint or deno lint main.ts in a directory that has deno.json, the paths contains main.ts. We were unconditionally running the "package rules" lints as long as the deno.json contains "publish config". Changing this conditional effectively breaks package lints. I think this whole bit should be rewritten to account for the fact that we're running lint for a whole dir or a certain file.

@@ -276,7 +280,9 @@ impl ModuleGraphCreator {
loader: None,
})
.await?;
self.graph_valid(&graph)?;
let r = self.graph_valid(&graph);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This call should filter out "unsupported media type" errors when graph is used for linting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deno lint ignores the ignore and exclude options
1 participant