Skip to content

Fix editorconfig parseSync option #387 - #394

Open
Bartheleway wants to merge 2 commits into
schorfES:mainfrom
Bartheleway:fix-editor-config
Open

Fix editorconfig parseSync option #387#394
Bartheleway wants to merge 2 commits 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 (a62a0ab).
⚠️ Report is 129 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 on lines +321 to 325
it('should allow working from another directory', () => {
const originalCwd = cwd();

chdir(path.resolve(__dirname, '__fixtures__/deep'));

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.

Should I fix? I feel that it will not cause damage even if test fails.

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
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