From 46f98819942c3771ac720f9a7cbea9ec295bf29c Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Wed, 25 Mar 2026 21:25:35 +0000 Subject: [PATCH] Fixed pre-commit lint hook for TW v4 workspaces Added apps/posts and apps/shade to scoped workspaces in lint-staged config so eslint runs from within each package directory, where eslint-plugin-tailwindcss can correctly resolve Tailwind v4 modules. --- .lintstagedrc.cjs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.lintstagedrc.cjs b/.lintstagedrc.cjs index b5ce3dcd45c..d84278b25e9 100644 --- a/.lintstagedrc.cjs +++ b/.lintstagedrc.cjs @@ -1,8 +1,10 @@ const path = require('path'); -const FLAT_CONFIG_WORKSPACES = [ +const SCOPED_WORKSPACES = [ 'e2e', - 'apps/admin' + 'apps/admin', + 'apps/posts', + 'apps/shade' ]; function normalize(file) { @@ -44,11 +46,11 @@ function buildRootEslintCommand(files) { module.exports = { '*.{js,ts,tsx,jsx,cjs}': (files) => { - const workspaceGroups = new Map(FLAT_CONFIG_WORKSPACES.map(workspace => [workspace, []])); + const workspaceGroups = new Map(SCOPED_WORKSPACES.map(workspace => [workspace, []])); const rootFiles = []; for (const file of files) { - const workspace = FLAT_CONFIG_WORKSPACES.find(candidate => isInWorkspace(file, candidate)); + const workspace = SCOPED_WORKSPACES.find(candidate => isInWorkspace(file, candidate)); if (workspace) { workspaceGroups.get(workspace).push(file); @@ -58,7 +60,7 @@ module.exports = { } return [ - ...FLAT_CONFIG_WORKSPACES + ...SCOPED_WORKSPACES .map(workspace => buildScopedEslintCommand(workspace, workspaceGroups.get(workspace))) .filter(Boolean), buildRootEslintCommand(rootFiles)