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 the lint script #204

Merged
merged 1 commit into from Sep 15, 2021
Merged

Fix the lint script #204

merged 1 commit into from Sep 15, 2021

Conversation

Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented Sep 15, 2021

The lint npm script was not running the "miscellaneous" lints correctly because the --check flag was missing. So instead of checking for lint errors and returning non-zero if any problems were found, it was printing all matched files to the console.

When the --check flag was restored, it became clear that the lint:fix script could no longer pass because the config-validation lint step was generating invalid snapshots. The config-validation script was run last, and didn't run prettier on the rules before writing them to disk.

prettier is now run on the snapshots before writing them to disk, which ensures lint:fix and lint won't get into any more disagreements.

@Gudahtt Gudahtt requested a review from a team as a code owner September 15, 2021 13:01
@rekmarks
Copy link
Member

You hate to see it.

The `lint` npm script was not running the "miscellaneous" lints
correctly because the `--check` flag was missing. So instead of
checking for lint errors and returning non-zero if any problems were
found, it was printing all matched files to the console.

When the `--check` flag was restored, it became clear that the
`lint:fix` script could no longer pass because the `config-validation`
lint step was generating invalid snapshots. The `config-validation`
script was run last, and didn't run `prettier` on the rules before
writing them to disk.

`prettier` is now run on the snapshots before writing them to disk,
which ensures `lint:fix` and `lint` won't get into any more
disagreements.
@Gudahtt
Copy link
Member Author

Gudahtt commented Sep 15, 2021

@rekmarks Description updated! Found another related problem.

Copy link
Member

@rekmarks rekmarks left a comment

Choose a reason for hiding this comment

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

It would indeed be good if our lint config repo was linted properly!

@Gudahtt Gudahtt merged commit 37ba320 into main Sep 15, 2021
@Gudahtt Gudahtt deleted the fix-lint-script branch September 15, 2021 14:00
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.

None yet

2 participants