-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: migrate to eslint-for-ai with enhanced type safety #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
e7368ec
refactor: migrate to eslint-for-ai with type-safe JSON parsing
eli0shin 19d33c1
feat: add @total-typescript/ts-reset for improved type definitions
eli0shin 5d4d4e5
chore: add Changesets for automated release management
eli0shin c5c21ec
chore: add changeset for eslint-for-ai migration and improvements
eli0shin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # Changesets | ||
|
|
||
| Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works | ||
| with multi-package repos, or single-package repos to help you version and publish your code. You can | ||
| find the full documentation for it [in our repository](https://github.com/changesets/changesets) | ||
|
|
||
| We have a quick list of common questions to get you started engaging with this project in | ||
| [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json", | ||
| "changelog": ["@changesets/changelog-github", { "repo": "eli0shin/mcp-controller" }], | ||
| "commit": false, | ||
| "fixed": [], | ||
| "linked": [], | ||
| "access": "public", | ||
| "baseBranch": "main", | ||
| "updateInternalDependencies": "patch", | ||
| "ignore": [] | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| 'mcp-controller': minor | ||
| --- | ||
|
|
||
| Add @total-typescript/ts-reset for improved type definitions and migrate to eslint-for-ai with type-safe JSON parsing. Also includes Changesets for automated release management. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| --- | ||
| description: Create a changeset from git history | ||
| --- | ||
|
|
||
| Create a changeset for the current branch automatically: | ||
|
|
||
| 1. Gather all changes: | ||
| - Run `git log main..HEAD --oneline` to get all commits on this branch | ||
| - Run `git diff` to see unstaged changes | ||
| - Run `git diff --cached` to see staged changes | ||
| 2. Analyze the commits and current changes to determine the semver bump: | ||
| - `major` if any commit contains "BREAKING" or "!" | ||
| - `minor` if any commit starts with "feat" | ||
| - `patch` otherwise (fix, chore, refactor, docs, etc.) | ||
| 3. Generate a concise summary (1-2 sentences) describing all changes (commits + uncommitted) | ||
| 4. Create a changeset file by running `bunx changeset add --empty` then editing the created file, OR by directly writing a new file to `.changeset/` with a random kebab-case name (e.g., `tall-lions.md`) | ||
|
|
||
| The changeset file format: | ||
|
|
||
| ```markdown | ||
| --- | ||
| 'mcp-controller': <patch|minor|major> | ||
| --- | ||
|
|
||
| <your generated summary> | ||
| ``` | ||
|
|
||
| Do not ask me any questions - determine everything from the git history and create the changeset file directly. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| name: Changeset Check | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| check: | ||
| name: Check for changeset | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Check for source changes | ||
| id: changes | ||
| run: | | ||
| if git diff --name-only origin/main...HEAD | grep -q '^src/'; then | ||
| echo "src_changed=true" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "src_changed=false" >> $GITHUB_OUTPUT | ||
| fi | ||
|
|
||
| - name: Setup Bun | ||
| if: steps.changes.outputs.src_changed == 'true' | ||
| uses: oven-sh/setup-bun@v2 | ||
|
|
||
| - name: Install dependencies | ||
| if: steps.changes.outputs.src_changed == 'true' | ||
| run: bun install | ||
|
|
||
| - name: Check for changesets | ||
| if: steps.changes.outputs.src_changed == 'true' | ||
| run: bunx changeset status --since=origin/main --strict |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| name: Version | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| version: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| id-token: write | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: oven-sh/setup-bun@v2 | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '24' | ||
| registry-url: 'https://registry.npmjs.org' | ||
|
|
||
| - name: Install dependencies | ||
| run: bun install | ||
|
|
||
| - name: Build | ||
| run: bun run build | ||
|
|
||
| - name: Test | ||
| run: bun run test | ||
|
|
||
| - name: Create Release Pull Request or Publish | ||
| uses: changesets/action@v1 | ||
| with: | ||
| version: bunx changeset version | ||
| publish: bunx changeset publish | ||
| title: 'chore: version packages' | ||
| createGithubReleases: true | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
Large diffs are not rendered by default.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,53 +1,16 @@ | ||
| import js from '@eslint/js'; | ||
| import tseslint from 'typescript-eslint'; | ||
| import importPlugin from 'eslint-plugin-import-x'; | ||
| import globals from 'globals'; | ||
| import forAi from 'eslint-for-ai'; | ||
|
|
||
| export default tseslint.config( | ||
| js.configs.recommended, | ||
| ...tseslint.configs.recommended, | ||
| export default [ | ||
| ...forAi.configs.recommended, | ||
| { | ||
| languageOptions: { | ||
| globals: { | ||
| ...globals.node, | ||
| settings: { | ||
| 'import-x/resolver': { | ||
| typescript: true, | ||
| }, | ||
| }, | ||
| plugins: { | ||
| 'import-x': importPlugin, | ||
| 'import-x/core-modules': ['bun:test'], | ||
| }, | ||
| rules: { | ||
| // TypeScript-specific rules | ||
| '@typescript-eslint/no-explicit-any': 'error', | ||
| '@typescript-eslint/consistent-type-definitions': ['error', 'type'], | ||
|
|
||
| // Import rules - enforce top-level ES module imports only | ||
| 'import-x/no-commonjs': 'error', | ||
| 'import-x/no-dynamic-require': 'error', | ||
| 'import-x/no-amd': 'error', | ||
| 'import-x/no-import-module-exports': 'error', | ||
| '@typescript-eslint/no-require-imports': 'error', | ||
| '@typescript-eslint/no-unused-vars': 'off', | ||
|
|
||
| // General rules | ||
| 'no-console': 'error', | ||
| 'prefer-const': 'error', | ||
|
|
||
| // Ban dynamic imports - only top-level import declarations allowed | ||
| 'no-restricted-syntax': [ | ||
| 'error', | ||
| { | ||
| selector: 'ImportExpression', | ||
| message: | ||
| 'Dynamic imports are not allowed. Use top-level import declarations only.', | ||
| }, | ||
| ], | ||
| 'for-ai/no-standalone-class': 'off', | ||
| }, | ||
| }, | ||
| { | ||
| files: ['**/*.test.ts', 'tests/**/*'], | ||
| rules: { | ||
| 'no-console': 'off', | ||
| }, | ||
| } | ||
| ); | ||
|
|
||
| ]; |
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.