Linting consistency

Indeed, linting for themes/plugins is deliberately decoupled from core. They might run different versions & configs of the linting tools. This is essential so that we can roll out changes without suddenly breaking linting in all repos.

We could probably make bin/lint work - it’ll need to cd into the plugin/theme directory, pnpm i, and then run any linting commands in the context of that directory. But it must not attempt to use core’s linting config on themes/plugins.

It should. Most of our team use VSCode (or VSCode derivations), so that’s what we optimize for. Eslint and Prettier VSCode plugins will search for the ‘nearest’ installation & config for a given file.

Have you run pnpm i in the theme/plugin directory? That’s required to install its linting dependencies, so that VSCode can find the right copy of prettier/eslint to use.

1 Like