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

eslint: weaken rules in dev mode #268

Merged
merged 1 commit into from
Dec 3, 2021

Conversation

JakobMiksch
Copy link
Collaborator

@JakobMiksch JakobMiksch commented Dec 3, 2021

  • weaken eslint rules in development mode
  • maybe use with different command than npm run dev

Copy link
Collaborator

@chrismayer chrismayer left a comment

Choose a reason for hiding this comment

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

LGTM, thnaks for this. I would not introduce another npm task. Having this in the npm run dev should enough.

@JakobMiksch JakobMiksch marked this pull request as ready for review December 3, 2021 10:56
@JakobMiksch JakobMiksch merged commit c18e5b6 into wegue-oss:master Dec 3, 2021
@fschmenger
Copy link
Collaborator

I like the idea of being a little more fault tolerant in dev mode, since currently this is a pain to get all the formatting right when we're just testing some code.
On the other hand, I don't like to see the production build failing when I haven't been warned about it dev mode. What do you think about turning all the disabled rules into warnings instead?

@chrismayer
Copy link
Collaborator

chrismayer commented Dec 6, 2021

What do you think about turning all the disabled rules into warnings instead?

I think that is exactly what @JakobMiksch did. Only https://github.com/meggsimum/wegue/pull/268/files#diff-e2954b558f2aa82baff0e30964490d12942e0e251c1aa56c3294de6ec67b7cf5R30 and https://github.com/meggsimum/wegue/pull/268/files#diff-e2954b558f2aa82baff0e30964490d12942e0e251c1aa56c3294de6ec67b7cf5R31 are real changes here. The others are just having more speaking values but no real changes.

@fschmenger
Copy link
Collaborator

fschmenger commented Dec 6, 2021

Ok, thanks for the info.

Here's a possible generic approach to do it with a plugin - maybe something along these lines is interesting to switch back and forth between warning levels without touching any eslint configs?
https://stackoverflow.com/questions/44303590/set-default-error-level-to-warn

EDIT: I think I got it now... still early in the morning and I probably misread the code :) I will give this a test run when time.

@JakobMiksch
Copy link
Collaborator Author

JakobMiksch commented Dec 9, 2021

@fschmenger This change only applies when running in dev mode. When eslint is unhappy it "only" shows warnings both in the terminal and the browser console, but does not break the application instantly. Hovever, when you run npm run build or npm run test the remarks will be errors and the commands will fail.

The idea was to improve the developer experience and make development a bit less laborious. Especially when you make a quick prototype of something ...

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.

3 participants