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

Flag to ignore a line in linter #1491

Open
altintx opened this issue Aug 9, 2023 · 2 comments
Open

Flag to ignore a line in linter #1491

altintx opened this issue Aug 9, 2023 · 2 comments
Labels
kind/feature A request for a new feature. topic: linting

Comments

@altintx
Copy link

altintx commented Aug 9, 2023

Problem

My application's schema is in the neighborhood of 200 enums + models. I have multiple files which get concatenated together to form schema.prisma:

a.prisma + b.prisma + c.prisma = schema.prisma

In reality they're named according to functional areas.

The concatted file is absolutely valid, but when working with any one file it may refer to models from other files and the linter complains it's unknown.

Suggested solution

I would like the ability to end lines with something like //// prisma-language-server ignore-next-line which I could easily filter out in my concat step but could disable linting for that line.

Alternatives

Even better to have first class multi file support. A subset of possibilities include

  • #include "a.schema" style directive
  • model ModelName @import "a.schema:ModelName"; decorator

But I think either of these would require work not just on the linter's part but within the prisma schema spec itself so quickly a much larger lift

Additional context

The lint errors don't block my use of the extension, they just raise false positives.

@janpio
Copy link
Member

janpio commented Aug 10, 2023

Aside: Native multi-file support is being tracked here: prisma/prisma#2377

@altintx
Copy link
Author

altintx commented Aug 10, 2023

PR to implement an ignore keyword: #1494

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature A request for a new feature. topic: linting
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants