Skip to content

Fix editorconfig parseSync option #387 - #394

Merged
schorfES merged 1 commit into
schorfES:mainfrom
Bartheleway:fix-editor-config
Sep 19, 2026
Merged

schorfES merged 1 commit into
schorfES:mainfrom
Bartheleway:fix-editor-config

Conversation

@Bartheleway

@Bartheleway Bartheleway commented May 4, 2026

Copy link
Copy Markdown
Contributor

Fix #387

@codecov

codecov Bot commented May 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.68%. Comparing base (f1a96e0) to head (f824890).
⚠️ Report is 135 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #394      +/-   ##
==========================================
- Coverage   99.68%   99.68%   -0.01%     
==========================================
  Files           7        7              
  Lines         320      319       -1     
  Branches       90       95       +5     
==========================================
- Hits          319      318       -1     
  Misses          1        1              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Fixes the .editorconfig integration in Validator to address issue #387 by changing how the EditorConfig library is invoked so it no longer depends on process.cwd() being within the target project.

Changes:

  • Add Node’s path module to support filename extraction.
  • Replace the previous CWD-based “relative path” logic with path.basename(...) when passing config to editorconfig.parseSync().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Validator.js Outdated
Comment thread src/Validator.js Outdated
Comment thread src/Validator.js Outdated
Comment thread src/Validator.js Outdated
@Bartheleway
Bartheleway force-pushed the fix-editor-config branch 2 times, most recently from 7a9d837 to c979a9f Compare June 2, 2026 09:33
@Bartheleway

Copy link
Copy Markdown
Contributor Author

Are we all good or is there anything else to clarify or modify ?

@schorfES

Copy link
Copy Markdown
Owner

Hi @Bartheleway, I am a bit busy and haven't really managed to have a deeper look yet. But I promise to do it soon. I am wondering at first sight if we still need all these path checks, or if we can simply forward the value into editorconfig...

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.

Comment thread src/Validator.js Outdated
Comment thread src/Validator.test.js
Comment thread src/constants/messages.js Outdated
Comment thread README.md Outdated

@schorfES schorfES left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Hi @Bartheleway,sorry for the long waiting...

From what I see now, I am pretty sure we can simplify a few things and adjust the tests accordingly. From my point of view, I would just pass a valid value for the editorconfig filename into the option and let editorconfig do the rest.

Thanks in advance for your collaboration, looking forward to your thoughts!

Comment thread src/Validator.js Outdated
Comment thread src/__fixtures__/.editorconfig
Comment thread README.md Outdated
Comment thread package.json Outdated
@Bartheleway
Bartheleway force-pushed the fix-editor-config branch 2 times, most recently from 5b4dc12 to a62a0ab Compare August 7, 2026 11:21
@Bartheleway
Bartheleway requested a review from schorfES August 17, 2026 08:00

@schorfES schorfES left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Hi @Bartheleway, sorry for keeping you waiting so long for feedback. The changes look mostly good to me, except for the open issue flagged by Copilot.

Additionally, I don't see the need to update lint-staged and rename the config in this PR. Even so, that change is incomplete because the filename in .husky/pre-commit also needs to be adjusted. Regardless, I "cherry-picked" that change into #418.

Finally, please rebase your PR with the latest main to update lint-staged. You can then drop your 2nd commit.

We are almost at the finish line... 🏁

Comment thread src/Validator.test.js
Comment thread package.json Outdated
Comment thread src/Validator.test.js
].forEach(editorconfig => {
const message = Messages.PATH_ISNT_FILE.message.replace('{a}', editorconfig);
const error = new Error(message);
it('should not throw if file does not exist', () => {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

@Bartheleway Would you describe this change as a BREAKING CHANGE?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes and no. Before we were expecting a filename or path and we now expect only a filename, this sounds like a breaking change. Giving a path didn't really work and that's why I did this PR so it is not really breaking but more making it to work 😄 (even though I am pretty sure I got it to work in some older version).

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

But we're also not throwing any errors as we did before. So apart from the path vs. filename configuration that you mentioned, this also slightly changed the behavior. So I would tend to say we're going for a BREAKING CHANGE here and bump the version to 3.0.0.

@schorfES
schorfES merged commit 187b9db into schorfES:main Sep 19, 2026
12 checks passed
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.

[EditorConfig] Not properly loading config

3 participants