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

Check extensions for param matcher files #5085

Merged
merged 10 commits into from
Jun 29, 2022
Merged

Conversation

h8gi
Copy link
Contributor

@h8gi h8gi commented May 26, 2022

I get error messages ("Matcher names must match /^[a-zA-Z_][a-zA-Z0-9_]*$/ — "${file}" is invalid") when my emacs creates backup files (like #[id].js#) in /params directory.
I think only .js and .ts files should be included in matchers.

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. All changesets should be patch until SvelteKit 1.0

@changeset-bot
Copy link

changeset-bot bot commented May 26, 2022

🦋 Changeset detected

Latest commit: db5d543

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

This PR includes changesets to release 1 package
Name Type
@sveltejs/kit 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

@@ -267,6 +267,7 @@ export default function create_manifest_data({
if (fs.existsSync(config.kit.files.params)) {
for (const file of fs.readdirSync(config.kit.files.params)) {
const ext = path.extname(file);
if (!['.js', '.ts'].includes(ext)) break;
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe it should be continue here? maybe i'm wrong

Copy link
Contributor Author

@h8gi h8gi May 26, 2022

Choose a reason for hiding this comment

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

Oh, I'm wrong! It should be continue.
I fixed it, thank you.

@benmccann benmccann changed the title Check extensions for param mathcer files Check extensions for param matcher files May 26, 2022
@Rich-Harris
Copy link
Member

Thank you! I wonder if we should rename endpointExtensions to moduleExtensions and use it for this purpose as well?

@h8gi
Copy link
Contributor Author

h8gi commented Jun 1, 2022

That sounds good!
For now, I rewrote ['.js', '.ts'] to endpointExtensions.

@benmccann
Copy link
Member

For now, I rewrote ['.js', '.ts'] to endpointExtensions.

That's a bit confusing because you wouldn't expect endpointExtensions to affect matchers. I think you'd have to rename the option as well

@benmccann
Copy link
Member

@h8gi it looks like this PR needs a rebase

@Rich-Harris Rich-Harris merged commit 2829426 into sveltejs:master Jun 29, 2022
@Rich-Harris
Copy link
Member

thank you!

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

4 participants