Add eslint and autofix script#7
Open
javisperez wants to merge 5 commits intomainfrom
Open
Conversation
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>
javisperez
commented
May 8, 2026
Collaborator
Author
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 Huskypre-commitintegration. - 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.
Signed-off-by: Javis Pérez <javis@jozu.com>
Signed-off-by: Javis Pérez <javis@jozu.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
eslint.config.jsfile that configures ESLint with TypeScript support, stylistic rules, import sorting, and custom rule adjustments.package.jsonto include ESLint-related scripts (lint,lint:fix), alint-stagedconfiguration for fixing staged files, and all necessary development dependencies for linting and formatting. [1] [2]Development workflow enhancements:
.husky/pre-commithook to automatically run lint-staged (and thus ESLint) before commits, enforcing code quality at commit time.preparescript inpackage.jsonto set up Husky hooks automatically after installing dependencies.