Skip to content

chore: fix lint script for ci#24

Merged
jonathunne merged 1 commit intotetherto:mainfrom
harshit-cmd:fix-lint-script
May 5, 2026
Merged

chore: fix lint script for ci#24
jonathunne merged 1 commit intotetherto:mainfrom
harshit-cmd:fix-lint-script

Conversation

@harshit-cmd
Copy link
Copy Markdown
Contributor

@harshit-cmd harshit-cmd commented May 4, 2026

Description

Fix npm run lint, which was crashing with 8 "TSConfig does not include this file" parse errors and never actually running any rules.

Root cause: .eslintrc.js enables type-aware linting via parserOptions.project: './tsconfig.json', but tsconfig.json excludes src/__tests__/ and *.test.ts/*.spec.ts so tsc doesn't emit tests into dist/. The parser couldn't find type info for test files and bailed before linting anything.

Fix: add a separate tsconfig.eslint.json (extends base, includes tests) and point ESLint at it. The build's tsconfig.json is untouched, so published dist/ output is unchanged.

Changes:

  • tsconfig.eslint.json (new): extends tsconfig.json, includes src/**/*, relaxes noUnusedLocals/noUnusedParameters for tests.
  • .eslintrc.js: points at tsconfig.eslint.json (with tsconfigRootDir: __dirname); adds an overrides block for src/__tests__/** that enables the jest env and disables type-aware rules that don't apply to tests/mocks (no-unsafe-*, no-explicit-any, require-await, unbound-method, no-extra-semi).
  • Mocks: let mockStorageconst; unused options param → _options.

Production source stays under the full strict ruleset including recommended-requiring-type-checking.

Motivation and Context

The lint job in .github/workflows/build.yml runs on every PR but was crashing before it could lint anything — we had no real lint coverage. This restores it.

This is the canonical "split tsconfig" pattern from the typescript-eslint docs for libraries that ship a narrower set of files than they lint.

Related Issue

PR fixes the following issue: N/A — internal CI fix.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

@jonathunne jonathunne merged commit 1bab484 into tetherto:main May 5, 2026
2 checks passed
@jonathunne jonathunne mentioned this pull request May 5, 2026
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