Skip to content

Add eslint and autofix script#7

Open
javisperez wants to merge 5 commits intomainfrom
add-eslint
Open

Add eslint and autofix script#7
javisperez wants to merge 5 commits intomainfrom
add-eslint

Conversation

@javisperez
Copy link
Copy Markdown
Collaborator

This pull request adds a full ESLint setup with TypeScript support, stylistic rules, and automated linting as part of the development workflow. It introduces configuration files, scripts, and dependencies to ensure consistent code style and quality, and integrates linting into the pre-commit process.

ESLint configuration and tooling:

  • Added a comprehensive eslint.config.js file that configures ESLint with TypeScript support, stylistic rules, import sorting, and custom rule adjustments.
  • Updated package.json to include ESLint-related scripts (lint, lint:fix), a lint-staged configuration for fixing staged files, and all necessary development dependencies for linting and formatting. [1] [2]

Development workflow enhancements:

  • Added a .husky/pre-commit hook to automatically run lint-staged (and thus ESLint) before commits, enforcing code quality at commit time.
  • Added a prepare script in package.json to set up Husky hooks automatically after installing dependencies.

javisperez added 3 commits May 8, 2026 11:21
Signed-off-by: Javis Pérez <javis@jozu.com>
Signed-off-by: Javis Pérez <javis@jozu.com>
Signed-off-by: Javis Pérez <javis@jozu.com>
Comment thread eslint.config.js
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the real change, the rest is just a precommit git hook to lint files on commit and the lint:fix of the whole project to keep the style consistent.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an ESLint + TypeScript linting setup (with import sorting and stylistic rules) and wires it into the local workflow via lint/lint:fix, lint-staged, and a Husky pre-commit hook. The PR also reformats much of src/ to match the new style (single quotes, no semicolons, trailing commas, import ordering).

Changes:

  • Add flat-config ESLint setup with TypeScript + stylistic + import-sorting rules.
  • Add lint / lint:fix, lint-staged, and Husky pre-commit integration.
  • Apply formatting updates across commands/types/tests to satisfy the new lint rules.

Reviewed changes

Copilot reviewed 39 out of 40 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/types/kitops.ts Formatting updates for type exports
src/types/commands.ts Formatting updates for CLI types
src/index.ts Reformat exports and type re-exports
src/core/exec.ts Formatting changes in exec helpers
src/core/tests/exec.spec.ts Formatting changes in exec tests
src/commands/version.ts Formatting changes
src/commands/unpack.ts Formatting changes
src/commands/tag.ts Formatting changes
src/commands/remove.ts Formatting changes
src/commands/push.ts Formatting changes
src/commands/pull.ts Formatting changes
src/commands/pack.ts Formatting changes
src/commands/logout.ts Formatting changes
src/commands/login.ts Formatting changes
src/commands/list.ts Formatting changes
src/commands/kit.ts Formatting changes
src/commands/inspect.ts Formatting changes
src/commands/init.ts Formatting changes
src/commands/info.ts Formatting changes
src/commands/index.ts Reordered command exports
src/commands/diff.ts Formatting changes
src/commands/tests/version.spec.ts Formatting changes in tests
src/commands/tests/unpack.spec.ts Formatting changes in tests
src/commands/tests/tag.spec.ts Formatting changes in tests
src/commands/tests/remove.spec.ts Formatting changes in tests
src/commands/tests/push.spec.ts Formatting changes in tests
src/commands/tests/pull.spec.ts Formatting changes in tests
src/commands/tests/pack.spec.ts Formatting changes in tests
src/commands/tests/logout.spec.ts Formatting changes in tests
src/commands/tests/login.spec.ts Formatting changes in tests
src/commands/tests/list.spec.ts Formatting changes in tests
src/commands/tests/kit.spec.ts Formatting changes in tests
src/commands/tests/inspect.spec.ts Formatting changes in tests
src/commands/tests/init.spec.ts Formatting changes in tests
src/commands/tests/info.spec.ts Formatting changes in tests
src/commands/tests/diff.spec.ts Formatting changes in tests
pnpm-lock.yaml Lockfile updates for new tooling deps
package.json Add lint scripts, deps, lint-staged, prepare
eslint.config.js New ESLint flat config for TS + style rules
.husky/pre-commit New pre-commit hook running lint-staged
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json
Comment thread package.json Outdated
Comment thread .husky/pre-commit
Comment thread src/index.ts
javisperez added 2 commits May 8, 2026 12:11
Signed-off-by: Javis Pérez <javis@jozu.com>
Signed-off-by: Javis Pérez <javis@jozu.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants