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

Only display user-defined JS lint errors #348

Open
vicnicius opened this issue Oct 27, 2021 · 7 comments
Open

Only display user-defined JS lint errors #348

vicnicius opened this issue Oct 27, 2021 · 7 comments
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest This issue is perfect for HacktoberFest contributors webdev

Comments

@vicnicius
Copy link
Contributor

vicnicius commented Oct 27, 2021

Describe the bug
Based on #345.

Wasp should only inform users of lint errors they can address. Currently, it also warns about errors in the generated files.

For example, this is the current output of running the Todo tutorial code:

image

Notice the warnings regarding the /src/auth/* JS (generated) files.

@Martinsos Martinsos added enhancement New feature or request good first issue Good for newcomers no-haskell Coding task that does not need Haskell knowledge labels Oct 29, 2021
@Martinsos
Copy link
Member

Awesome, thanks @vicnicius !

To solve this, we should ensure that linter lints only files present in ext-src/ in the generated project, since everything else is generated code.
I am guessing this can be done by modifying the linter configuration (although I am not sure where would that be) on both frontend and backend. We should investigate how that can be done in regards to how we are building projects right now.

@vicnicius
Copy link
Contributor Author

My pleasure, @Martinsos. Yes, you could probably update the web-app template to also output a .eslintignore configuration. Alternatively, maybe it would make sense for wasp to simply add a [/* eslint-disable */](https://eslint.org/docs/2.13.1/user-guide/configuring#disabling-rules-with-inline-comments) to the top of every generated file. Not sure what you would find best.

Also, on the topic of code styles, later on, wasp could provide a way for users to use a specific format for the generated code. Maybe something like:

client {
  format: 'prettier' // or eslint, or tslint, etc...
}

@Martinsos
Copy link
Member

@vicnicius that sounds good, any of those approaches sounds reasonable! Maybe central configuration like .eslintignore would be easier to maintain / work with, but let's see.

Interesting idea about providing a way to specify the formatter, we should look into that at some point for sure.

@maksim36ua maksim36ua added webdev and removed no-haskell Coding task that does not need Haskell knowledge labels Sep 27, 2022
@maksim36ua maksim36ua added the hacktoberfest This issue is perfect for HacktoberFest contributors label Oct 3, 2022
@makinox
Copy link

makinox commented Oct 6, 2022

Hello, any problem if I work on this?

My plan

  • Add the rule in the generated package.json to ignore ESLint messages in the .wasp/out folder

I would love to implement .eslintignore but that would require more planning with you and install an additional library to extend configurations

@sodic
Copy link
Contributor

sodic commented Oct 11, 2022

@makinox Hey, sorry for the late reply.

No problem at all, quite the opposite :)

I like the approach and I've reviewed your PR. Let me know what you think.

@programmersoham
Copy link

Is this still open ?

@Martinsos
Copy link
Member

Is this still open ?

Yes, it still is! Go for it if you want!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest This issue is perfect for HacktoberFest contributors webdev
Projects
None yet
Development

No branches or pull requests

6 participants