Repository navigation
[Git hooks] Replace pre-push with pre-commit - #10327
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…nfig Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # package.json # yarn.lock
Also cover the lint-staged ESLint task with tests. Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: weronika.olejniczak <weronika.olejniczak@elastic.co>
Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: weronika.olejniczak <weronika.olejniczak@elastic.co>
|
Tested different scenarios locally with real commits:
There is an edge case that we might want to act on: if you have a clean workspace, you haven't built packages yet (or you haven't build We could either check, when the plugin is necessary, if it is built or not and print something like “Run Thanks for making this much faster! 🎉 |
Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # yarn.lock
…ssing Co-authored-by: Cursor <cursoragent@cursor.com>
Run EUI lint in CI when the ESLint plugin changes, document the build step and Husky rollback, and use forward slashes in generated paths so the hook works on Windows. Co-authored-by: Cursor <cursoragent@cursor.com>
angeles-mzb
left a comment
There was a problem hiding this comment.
Retested, I can see the hint now, I'd remove the stack trace so the hint can actually be found but I don't think we will encounter this often so up to you. Approving!
node:internal/modules/cjs/loader:1611
const err = new Error(`Cannot find module '${request}'`);
^
Error: Failed to load plugin '@elastic/eui' declared in '.eslintrc.js': Cannot find module '.../eui/packages/eui/node_modules/@elastic/eslint-plugin-eui/lib/cjs/index.js'
Require stack:
-.../eui/packages/eui/__placeholder__.js
Referenced from: .../eui/packages/eui/.eslintrc.js
Run `yarn workspace @elastic/eui build:workspaces` first.
at createEsmNotFoundErr (node:internal/modules/cjs/loader:1611:15)
at finalizeEsmResolution (node:internal/modules/cjs/loader:1600:9)
at resolveExports (node:internal/modules/cjs/loader:754:14)
at Module._findPath (node:internal/modules/cjs/loader:821:31)
at Module._resolveFilename (node:internal/modules/cjs/loader:1557:27)
at wrapResolveFilename (node:internal/modules/cjs/loader:1118:27)
at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1169:12)
at require.resolve (node:internal/modules/helpers:175:31)
at Object.resolve (.../eui/packages/eui/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2325:46)
at ConfigArrayFactory._loadPlugin (.../eui/packages/eui/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3392:33) {
code: 'MODULE_NOT_FOUND',
path: '.../eui/packages/eui/node_modules/@elastic/eslint-plugin-eui',
messageTemplate: 'plugin-missing',
messageData: {
pluginName: '@elastic/eslint-plugin-eui',
resolvePluginsRelativeTo: '.../eui/packages/eui',
importerName: '.eslintrc.js'
}
}
Node.js v24.22.3
husky - pre-commit script failed (code 1)
43bd81a to
850eee0
Compare
850eee0 to
256345a
Compare
Co-authored-by: Cursor <cursoragent@cursor.com>
256345a to
7367382
Compare
💚 Build Succeeded
History
|
💚 Build Succeeded
History
|
Closes https://github.com/elastic/eui-private/issues/450. Depends on #10325.
Replaces the slow
pre-pushhook (rebuild, lint, tests) with a pre-commit hook (Husky + lint-staged) on staged files:--fixineuiand the theme packages, using each package's own config.Type checks and tests stay in CI.