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

Refactor to slightly simplify the code #7675

Merged
merged 5 commits into from May 8, 2024

Conversation

Mouvedia
Copy link
Contributor

@Mouvedia Mouvedia commented May 3, 2024

Which issue, if any, is this issue related to?

N/A

Is there anything in the PR that needs further explanation?

  • eslint-plugin-perf-standard/check-function-inline for 3 functions
  • 2 try…catch refactors
  • 1 typo

Copy link

changeset-bot bot commented May 3, 2024

⚠️ No Changeset found

Latest commit: 7127fbe

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

Copy link
Member

@ybiquitous ybiquitous left a comment

Choose a reason for hiding this comment

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

@Mouvedia Thanks for the refactoring. Overall LGTM, but can you check my review comments?

if (typeof lookup === 'string') {
return getModulePath(configDir, lookup, cwd);
}
const cb = (/** @type { any } */ lookup) => {
Copy link
Member

Choose a reason for hiding this comment

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

[suggest] So, how about the following? ⬇️

Suggested change
const cb = (/** @type { any } */ lookup) => {
/** @type {<T>(lookup: T) => (string | T)} */
const toAbsolutePath = (lookup) => {

In addition, I prefer a more descriptive variable name over cb.

lib/utils/getCacheFile.mjs Outdated Show resolved Hide resolved
lib/utils/getCacheFile.mjs Show resolved Hide resolved
lib/utils/getFileIgnorer.mjs Outdated Show resolved Hide resolved
@ybiquitous ybiquitous changed the title Refactor misc. Refactor to make code a bit simplified May 8, 2024
@Mouvedia Mouvedia changed the title Refactor to make code a bit simplified Refactor to slightly simplify the code May 8, 2024
Copy link
Member

@ybiquitous ybiquitous left a comment

Choose a reason for hiding this comment

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

Thanks, looks great to me 😄

@ybiquitous ybiquitous merged commit 1ec9b62 into stylelint:main May 8, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants