Skip to content

Replace tslint with ESLint - #83

Merged
ofalvai merged 1 commit into
masterfrom
eslint-replace-tslint
Oct 19, 2026
Merged

ofalvai merged 1 commit into
masterfrom
eslint-replace-tslint

Conversation

@ofalvai

@ofalvai ofalvai commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Why

tslint is blocking the upgrade to TypeScript 7. This replaces it with ESLint, configured through the shared @bitrise/eslint-plugin, and extends that config only where this repo needs it.

What changes

  • eslint.config.mjs applies the plugin's config to src/**/*.ts and test/**/*.mts. tslint only covered test/.
  • npm run lint and lint:fix are new. Lint runs with --max-warnings 0.
  • CI runs npm run lint in both workflows. The npm test* scripts run it before the type check. typecheck and typecheck:tests no longer lint.
  • The plugin's Prettier setup (2 spaces, single quotes, 120 columns, trailing commas) reformatted src/ and test/.

Reviewing the diff

Most of the diff is Prettier output in test/test.mts, test/codesign.mts and src/acquisition-sdk/. Start with the config, package.json and the workflows. For the source files, the non-trivial edits are small:

  • Unused parameters are prefixed with _, and unused catch (e) bindings are now catch.
  • The 20 no-explicit-any hits are typed. test.mts gets two small interfaces for the mock server's request bodies, and errorMessage in the SDK is a string.
  • Two inline lint disables in acquisition-sdk.ts, each with a comment (see below).

Trade-off: dependency weight

The plugin is built for React apps, so it pulls in React, Storybook, jest and testing-library plugins that this library does not use. Package count in package-lock.json:

Setup Packages
No linter 693
Standalone config (ESLint, typescript-eslint, Prettier, import sorting, unused imports) 793
@bitrise/eslint-plugin (this PR) 930

I measured the standalone setup and chose the plugin to stay on the shared Bitrise config, at about 140 extra packages.

🤖 Generated with Claude Code

Copilot AI balanced review requested due to automatic review settings October 8, 2026 11:17
@ofalvai ofalvai self-assigned this Oct 8, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The lint script’s single-quoted globs fail under Windows npm shells.

1 open finding
What changed in this PR

Replaces TSLint with shared ESLint tooling across TypeScript source and tests.

Changes:

  • Adds ESLint configuration, scripts, dependencies, and CI enforcement.
  • Removes TSLint and updates related documentation.
  • Reformats and strengthens typings in SDK and test code.
File Description
eslint.config.mjs Configures shared ESLint rules and exclusions.
package.json Adds ESLint dependencies and scripts.
package-lock.json Locks the new lint dependencies.
tslint.json Removes obsolete TSLint configuration.
.npmignore Excludes ESLint configuration from publishing.
.github/​workflows/​ci-test.yml Adds CI linting.
.github/​workflows/​publish.yml Adds pre-publish linting.
AGENTS.md Documents lint commands.
.agents/​skills/​verify-codepush/​SKILL.md Updates test type-check guidance.
src/​acquisition-sdk/​acquisition-sdk.ts Reformats and tightens lint-related typing.
src/​acquisition-sdk/​code-push-error.ts Applies formatting.
src/​acquisition-sdk/​types.ts Applies formatting.
test/​test.mts Reformats tests and replaces explicit any types.
test/​codesign.mts Applies formatting.

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

Comment thread package.json
"test:unit:android": "cd android && ./gradlew :app:test",
"test:unit:ios": "xcodebuild test -project ios/CodePush.xcodeproj -scheme CodePushTests -destination \"platform=iOS Simulator,id=$(xcrun simctl list devices available | grep -m1 iPhone | grep -oE '[0-9A-F-]{36}')\"",
"tslint": "tslint -c tslint.json test/**/*.mts"
"lint": "eslint --max-warnings 0 'src/**/*.ts' 'test/**/*.mts'",

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.

Not that important, we don't support Windows anymore.

Use @bitrise/eslint-plugin as the lint config, and lint src/ as well as
test/. Lint runs separately from the type checks and fails on warnings.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@ofalvai
ofalvai force-pushed the eslint-replace-tslint branch from d4a5ac7 to bc912d2 Compare October 19, 2026 07:39
@ofalvai
ofalvai merged commit dab59d1 into master Oct 19, 2026
6 checks passed
@ofalvai
ofalvai deleted the eslint-replace-tslint branch October 19, 2026 12:08
@ofalvai ofalvai mentioned this pull request Oct 19, 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.

3 participants