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

Improve astro check #3906

Merged
merged 8 commits into from
Jul 18, 2022
Merged

Improve astro check #3906

merged 8 commits into from
Jul 18, 2022

Conversation

Princesseuh
Copy link
Member

@Princesseuh Princesseuh commented Jul 12, 2022

Changes

This improves and fixes astro check in many ways:

  • Added more pretty colors
  • Fixed it not working at all on Windows
  • Warnings and hints are now printed alongside errors
  • Surrounding lines are now shown when relevant (aka not empty)
  • Fixed red squiggles not showing in the proper place in certain contexts, notably with strings using non-latin characters
  • Fixed IDE links pointing to the wrong offset (both the line number and the character were off by one)
  • Fixed line numbers being off by one
  • Fixed IDE links not working when the project wasn't at the root of the folder

Result:

Before
image

After
image

Testing

Added some simple tests that astro check works

Docs

N/A

@changeset-bot
Copy link

changeset-bot bot commented Jul 12, 2022

🦋 Changeset detected

Latest commit: 4c0494a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
astro Patch
@e2e/astro-component Patch
@e2e/lit-component Patch
@e2e/preact-component Patch
@e2e/react-component Patch
@e2e/solid-component Patch
@e2e/svelte-component Patch
@e2e/e2e-tailwindcss Patch
@e2e/ts-resolution Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Jul 12, 2022
@Princesseuh Princesseuh changed the title [WIP] Improve astro check Improve astro check Jul 13, 2022
@Princesseuh Princesseuh marked this pull request as ready for review July 13, 2022 18:02
@Princesseuh
Copy link
Member Author

Princesseuh commented Jul 13, 2022

Ugh, tests are failing on Windows.. will investigate

EDIT: It turns out that astro check just has never worked on Windows, fixed now though!

bold(red(`${result.errors} ${result.errors === 1 ? 'error' : 'errors'}`)),
bold(yellow(`${result.warnings} ${result.warnings === 1 ? 'warning' : 'warnings'}`)),
dim(`${result.hints} ${result.hints === 1 ? 'hint' : 'hints'}\n`),
].join(`\n${dim('-')} `)
Copy link
Contributor

Choose a reason for hiding this comment

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

Love the summary section

@matthewp
Copy link
Contributor

lgtm overall.

Needs a changeset.

Also you mentioned getting the examples to run astro check, are you intending to do that in another PR?

@Princesseuh
Copy link
Member Author

Also you mentioned getting the examples to run astro check, are you intending to do that in another PR?

Yep, part of #3940 I'm thinking.

Thank you for the review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants