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

feat: support glob in project key #304

Merged
merged 4 commits into from
Apr 6, 2024
Merged

feat: support glob in project key #304

merged 4 commits into from
Apr 6, 2024

Conversation

Copy link

changeset-bot bot commented Apr 3, 2024

🦋 Changeset detected

Latest commit: 61c369e

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

This PR includes changesets to release 1 package
Name Type
astro-eslint-parser Minor

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

Copy link
Owner

@ota-meshi ota-meshi left a comment

Choose a reason for hiding this comment

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

Thank you for this PR! I have one thing to worry about.

src/parser/ts-for-v5/resolve-project-list.ts Outdated Show resolved Hide resolved
@nix6839 nix6839 requested a review from ota-meshi April 6, 2024 01:12
// typescript doesn't provide a ts.sys implementation for browser environments
const useCaseSensitiveFileNames =
ts.sys !== undefined ? ts.sys.useCaseSensitiveFileNames : true;
const correctPathCasing = useCaseSensitiveFileNames
Copy link
Owner

Choose a reason for hiding this comment

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

I think we probably need to rewrite it like this:

let correctPathCasing = (filePath: string): string => {
  const ts: TS = createRequire(path.join(process.cwd(), "__placeholder__.js"))(
    "typescript",
  );
  const useCaseSensitiveFileNames = ts.sys !== undefined ? ts.sys.useCaseSensitiveFileNames : true;
  correctPathCasing = useCaseSensitiveFileNames
    ? (filePath: string): string => filePath
    : (filePath: string): string => filePath.toLowerCase();
  return correctPathCasing(filePath);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made the unbelievable mistake of producing the same error in a different way. Thank you 😄

@nix6839 nix6839 requested a review from ota-meshi April 6, 2024 02:09
Copy link
Owner

@ota-meshi ota-meshi left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks so much!

@ota-meshi ota-meshi merged commit 529a588 into ota-meshi:main Apr 6, 2024
8 checks passed
@nix6839 nix6839 deleted the support-glob-project branch April 6, 2024 02:14
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.

Using glob patterns in project key does not work.
2 participants