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

chore: overhaul ignore configs #11881

Closed
wants to merge 0 commits into from
Closed

Conversation

hyunbinseo
Copy link
Contributor

Update git, Prettier, and ESLint ignore files.

  1. Sort items alphabetically.
  2. Categorize items into OS, Vite, and Lockfiles.
  3. Remove the leading / - match the style with the node_modules entry.
  4. Follow the Vite's .env file rules - only the *.local files are ignored by git.
  5. Remove items from .eslintignore that are not handled by ESLint, such as .DS_STORE.
  6. Add items to .eslintignore, such as dist which is generated in the library template.
  7. Add Thumbs.db for Windows users.

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. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

Edits

  • Please ensure that 'Allow edits from maintainers' is checked. PRs without this option may be closed.

Copy link

changeset-bot bot commented Feb 22, 2024

⚠️ No Changeset found

Latest commit: 41bb2c0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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


build
node_modules
package
Copy link
Member

Choose a reason for hiding this comment

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

I think it could lead to trouble to remove the leading /. If the user has something like src/packages/package as we do in SvelteKit it would end up getting ignored, which isn't what we want

.output
.svelte-kit
.vercel

Copy link
Member

Choose a reason for hiding this comment

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

build and .svelte-kit are both output, so should be grouped together.

Suggested change


# Ignore files for PNPM, NPM and YARN
Copy link
Member

Choose a reason for hiding this comment

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

are we sure eslint ignores these files? how do we know that?

Copy link
Contributor Author

@hyunbinseo hyunbinseo Feb 24, 2024

Choose a reason for hiding this comment

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

JSON and YAML files are not formatted by default.

Plugins have to be installed:

And the extensions should be provided in the CLI and configuration.

/build
/.svelte-kit
/package
.env
Copy link
Member

Choose a reason for hiding this comment

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

If I recall, the reason this was ignored was that people were worried about accidentally checking in production secrets. It makes sense to me to ignore it because you're not going to check it in here, but will instead provide it as part of your production deploy

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ignoring the .env file goes agaist the Vite convention.

https://vitejs.dev/guide/env-and-mode#env-files

.env                # loaded in all cases
.env.local          # loaded in all cases, ignored by git
.env.[mode]         # only loaded in specified mode
.env.[mode].local   # only loaded in specified mode, ignored by git

Since SvelteKit is at it core a Vite project, following this seemed intuitive.

Especially since .env.test and .env.test.local files are utilized by Vitest.

@hyunbinseo
Copy link
Contributor Author

@benmccann I am really sorry, I badly messed up my git branching.

Should I create a new PR with the above mentioned suggestions?

@ghostdevv
Copy link
Member

Go for it @hyunbinseo

@hyunbinseo hyunbinseo mentioned this pull request Mar 6, 2024
6 tasks
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