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
Config overrides api #123
Config overrides api #123
Conversation
Closes #82
This is very cool! Would it be possible to get a new NPM release with this feature? :-) |
Definitely! Sorry for the delay 🙈 |
/** | ||
* Applies values from the 'overrides' field in a configuration file. | ||
* @param {string} cwd The current working directory. | ||
* @param {Object} filePath The file path of the file being linted. |
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.
@tclindner is this working as intended for you? I'm seeing the path of the config file as filePath
instead of file being linted. Therefore filePath === globbedFilePath
is never truthy and overrides don't work.
Note how path gets pulled from config object here before passed to applyOverrides
:
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.
Hey @simison - it seems to be working for my basic setup. What does your setup look like? We can try to get a patch in.
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.
Heh, well you just got me to doubt myself and if I was testing thoroughly enough! 😅
Here's the config I'm working on Automattic/wp-calypso#36534
No worries if you don't have time, I can also dig deeper into this.
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, @simison! I think I have a fix ready. Please give v4.0.1 a shot and let me know if it resolves your issue. Thanks again for reporting it 👍
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.
Yasss, that worked fantastically! Thank you!
Description of change
Add logic to apply overrides - Closes #96
Add cosmicconfig and switch to globby
Add new utils for ignore and file list
Add error handling to config
Add typedef to LintIssue
Add new linter and results helper
Add tests for utils
Tests for new linter
Add test for absolute paths
Add tests for overrides and extends
Add ignore support to cli reporter
Update api now that CLIEngine is no longer exported
Update Reporter.js
Add initial version of transformer
Add config tests
Update CHANGELOG.md
Closes #82
Checklist