-
-
Notifications
You must be signed in to change notification settings - Fork 72
feat(addons): Respect .gitignore in eslint addon
#335
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
Conversation
🦋 Changeset detectedLatest commit: 5a5e41c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
.vercel to ignores in eslint addon@sveltejs/<adapter> out directories to eslint ignores.
|
thank you! however I'm not sure if having to manually update the perhaps it would be nicer to have the It can be implemented as so: import { fileURLToPath } from "node:url";
import { includeIgnoreFile } from "@eslint/compat";
const gitignorePath = fileURLToPath(new URL("./.gitignore", import.meta.url));
export default {
// ...
includeIgnoreFile(gitignorePath)
}thoughts? @manuel3108 @benmccann |
|
Yeah, i think that approach would make sense, although we will have basically the same problem in the |
the |
At this point for me it doesn't look like it's including the vercel output. So that's also missing. But I wouldn't be in favor of adding that globally to the templates, as explained above. |
here's the currently generated the only one that's missing is
yea but that would only be helpful for people who are changing adapters via |
I'm blind, as always!
Good point about the manual stuff, this should be the way. |
|
I just went through and ran all of the adapters to see what they output since I don't think any of those outputs are actually in the docs for the adapters at least that I could find. |
|
here are the generated dirs in the root: @sveltejs/adapter-node - /build
@sveltejs/adapter-static - /build
@sveltejs/adapter-cloudflare - /.wrangler
@sveltejs/adapter-cloudflare-workers /.wrangler
@sveltejs/adapter-netlify - /.netlify
@sveltejs/adapter-vercel - /.vercelnot sure what the |
|
Is there a reason there can't just be a exported constant somewhere that has all of these ignores to be used everywhere? |
Co-authored-by: Ben McCann <[email protected]>
Co-authored-by: Ben McCann <[email protected]>
Co-authored-by: CokaKoala <[email protected]>
not exactly sure I follow - who should be exporting these? the individual adapter packages? |
I don't think it being a separate package would be practical but it may be nice to have an internal package to use for it? Like a @sveltejs/constants or something idk. Otherwise you'd have to depend on 10 packages just to figure out what to ignore lol |
|
eh, that would be pretty niche and not particularly helpful when it comes to the anyway, I think we're in agreement that implementing #335 (comment) would be good, so feel free to add it to this PR! |
|
I meant more it could just be passed around to build whatever files need it. Either way let me wrap a few things up and I can give it a shot! |
@sveltejs/<adapter> out directories to eslint ignores..gitignore in eslint addon
|
This should be it but I cannot seem to get it to build or run tests on my machine I am probably just doing something wrong. |
commit: |
manuel3108
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, so much! This seems to be working great!
The only thing im unsure about, is the placement of the includeIgnoreFile call. According to the readme I would understand that this should be placed first in the eslint array, but currently it's placed last. In my local testing though, this didn't make any difference at all.
Yeah if you would rather have it at the beginning I can move it no problem at all! |
also move ignores to the top to follow the compat docs
|
Also should I update the template git ignores with the output files mentioned above? |
…into eslint-addon-ignores
AdrianGonz97
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you!
|
preview: https://svelte-dev-git-preview-cli-335-svelte.vercel.app/ this is an automated message |
I guess the whitespace issue at the top isn't solvable right? // ...
import ts from 'typescript-eslint';
const gitignorePath = fileURLToPath(new URL("./.gitignore", import.meta.url));
//... |
|
Not at the moment, but we have plans on addressing issues similar to this in the future |
Fixes #334
Searched the docs and tried the adapters out ended up also adding
.wranglerand.netlify