Fix lint-staged config for plugins#1264
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
The milestone check seems to be stuck, as I did add a milestone. I'll merge anyway. I don't think we should use the |
| const pluginFiles = micromatch( | ||
| files, | ||
| `**/${ PLUGIN_BASE_NAME }/plugins/${ plugin }/**`, | ||
| { dot: true } | ||
| ); | ||
|
|
||
| if ( pluginFiles.length ) { | ||
| commands.push( | ||
| `composer lint:${ plugin } ${ joinFiles( pluginFiles ) }` | ||
| ); | ||
| } |
There was a problem hiding this comment.
I just realized that this should technically also include **/${ PLUGIN_BASE_NAME }/tests/plugins/${ plugin }/* at least until #1262 is merged (although hopefully that will be done momentarily and this won't be needed).
|
|
||
| const otherFiles = micromatch( | ||
| files, | ||
| `!**/${ PLUGIN_BASE_NAME }/plugins/**`, |
There was a problem hiding this comment.
Ditto, if the above is done, then this would also omit !**/${ PLUGIN_BASE_NAME }/tests/plugins/**
Summary
See #1089
Relevant technical choices
package.jsontolint-staged.config.js.