-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Deno lint ignores the ignore
and exclude
options
#26308
Comments
Could you please paste an output from your terminal? |
@bartlomieju Yeah sure, here it is ➜ project git:(6ef580b) deno lint .
error: The module's source code could not be parsed: Expected ';', '}' or <eof> at file:///Users/viktor/repos/project/packages/ui/globals.css:5:13
@layer base {
~ |
Maybe that's happening because the |
Can you please paste the contents of |
Something that could maybe be causing problems here is that, this package includes both a deno.jsonc file and a package.json file. I included the deno.jsonc just because without it deno could not find the types of the package being imported. (I have another issue related to that tho, #26306 ) {
"name": "@project/ui",
"exports": {
"./lib/utils.ts": "./src/lib/utils.ts",
"./hooks/use-toast.ts": "./src/hooks/use-toast.ts",
"./components/alert-dialog.tsx": "./src/components/alert-dialog.tsx",
"./components/avatar.tsx": "./src/components/avatar.tsx",
"./components/badge.tsx": "./src/components/badge.tsx",
"./components/button.tsx": "./src/components/button.tsx",
"./components/command.tsx": "./src/components/command.tsx",
"./components/dialog.tsx": "./src/components/dialog.tsx",
"./components/drawer.tsx": "./src/components/drawer.tsx",
"./components/form.tsx": "./src/components/form.tsx",
"./components/input.tsx": "./src/components/input.tsx",
"./components/label.tsx": "./src/components/label.tsx",
"./components/separator.tsx": "./src/components/separator.tsx",
"./components/spinner.tsx": "./src/components/spinner.tsx",
"./components/switch.tsx": "./src/components/switch.tsx",
"./components/table.tsx": "./src/components/table.tsx",
"./components/tabs.tsx": "./src/components/tabs.tsx",
"./components/toast.tsx": "./src/components/toast.tsx",
"./components/toaster.tsx": "./src/components/toaster.tsx",
"./components/tooltip.tsx": "./src/components/tooltip.tsx",
"./postcss.config.mjs": "./postcss.config.mjs",
"./tailwind.config.ts": "./tailwind.config.ts",
"./globals.css": "./globals.css"
}
} |
As a workaround, disabling the // deno.jsonc
{
"lint": {
"rules": {
"exclude": ["no-slow-types"]
}
},
// ...
} Probably what's happening here is that lint rule is analyzing all the exports of the package. |
Still happens with |
This is also a bug with "fmt": {
"include": ["*.ts", "*.tsx"],
"exclude": ["*.d.ts", "./server/*"],
"lineWidth": 120
}, This still tries to process JS, CSS and even JSON files. However, when I also exclude the directory which contains those files (my Next JS build directory), it works fine. The include statement just shouldn't work with those files to begin with. |
I was able to reproduce it with these three files: // deno.json
{
"name": "@project/ui",
"exports": {
"./main.ts": "./main.ts",
"./globals.css": "./globals.css"
}
} // main.ts // globals.css
body {
color: "red";
} Run
Indeed adding I'll dig into this |
Found one more problem that might be a separate issue. Running |
Version: Deno 2.0.0
I'm using deno in a workspace that includes a npm package
project/packages/ui
which is a collection of React components, that use tailwind. In this package, i have aglobals.css
file that is not valid for the default Deno CSS linter, since i have a setup that uses postcss to process it (for tailwind) etc.Problem is, i cannot seem to ignore this file in any way. I've tried using --ignore, putting it inside lint: { exclude: [*.css] } inside a deno.json file at the root of the project and at the package, and using a comment at the top of the css file with deno-lint-ignore-file.
Besides all that, deno lint keeps breaking on this file, trying to check it.
The text was updated successfully, but these errors were encountered: