Skip to content

chore: use context.cwd #1176

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

Merged
merged 1 commit into from
Mar 31, 2025
Merged

chore: use context.cwd #1176

merged 1 commit into from
Mar 31, 2025

Conversation

43081j
Copy link
Contributor

@43081j 43081j commented Mar 31, 2025

Switches to using context.cwd since all ESLint versions we support now have it.

The previously used getCwd helper falls back to process.cwd() (which ESLint itself doesn't do). So in the few places we relied on that, a fall back to process.cwd() has been added.

This is the last remaining compat function, so we have also dropped the eslint-compat-utils dependency.

Copy link

changeset-bot bot commented Mar 31, 2025

🦋 Changeset detected

Latest commit: 80dd3f1

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

This PR includes changesets to release 1 package
Name Type
eslint-plugin-svelte 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

@43081j 43081j force-pushed the compat-gone branch 2 times, most recently from fb385e2 to a7267b7 Compare March 31, 2025 13:47
Copy link
Contributor

github-actions bot commented Mar 31, 2025

Try the Instant Preview in Online Playground

ESLint Online Playground

Install the Instant Preview to Your Local

npm i https://pkg.pr.new/eslint-plugin-svelte@1176

Published Instant Preview Packages:

View Commit

@43081j
Copy link
Contributor Author

43081j commented Mar 31, 2025

weirdly this CI failure doesn't seem related but im not sure why else it'd be happening 🤔

Switches to using `context.cwd` since all ESLint versions we support now
have it.

The previously used `getCwd` helper falls back to `process.cwd()` (which
ESLint itself doesn't do). So in the few places we relied on that,
a fall back to `process.cwd()` has been added.
@43081j
Copy link
Contributor Author

43081j commented Mar 31, 2025

it was me being blind. we still depend on the compat package for the rule tester

Copy link
Member

@baseballyama baseballyama 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!

@baseballyama
Copy link
Member

@43081j Will you make a 1 more PR for packages/eslint-plugin-svelte/tests/utils/eslint-compat.ts?

@baseballyama baseballyama merged commit bafbf5f into sveltejs:main Mar 31, 2025
17 checks passed
@43081j
Copy link
Contributor Author

43081j commented Mar 31, 2025

i was looking at that, i feel like we should be able to drop most of it (or all of it?)

i'll see where i get with it 👍

@43081j 43081j deleted the compat-gone branch March 31, 2025 14:19
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.

2 participants