Draft
Conversation
8ee63aa to
303d032
Compare
1 task
bcac179 to
4904a1c
Compare
This was referenced Apr 14, 2026
4904a1c to
3b6e983
Compare
8 tasks
- Migrate from local .eslintrc.cjs to @heroku-cli/test-utils/eslint-config - Fix test failures caused by ESLint auto-formatting: - apps:favorites:add: update error test to use proper 404 response - spaces:ps: fix JSON date serialization in test expectation - HerokuExec: add basic auth to nock mocks for updateClientKey tests - Update hook tests to modern style (remove old test chain syntax): - terms-of-service: use sinon stubs and standard Mocha tests - version: add comprehensive test coverage with proper mocking - Rename files to kebab-case per linting rules
- Apply ESLint auto-fixes across codebase (object sorting, ternary operators, etc) - Rename snake_case files to kebab-case per linting rules - Fix test failures caused by linting changes: - autocomplete: Fix plugins iteration (Map vs Array) - pg:kill: Reorder args (required pid before optional database) - accounts: Fix YAML property order (username before password) - apps:favorites:add: Update test to use proper 404 response - spaces:ps: Fix JSON date serialization in test - Add eslint-disable comments for intentional sort order exceptions Note: HerokuExec updateClientKey tests still failing, needs investigation
- Add n/no-unpublished-bin: off to eslint config (false positives) - Rename snake_case cert files to kebab-case: - certificate_details.ts → certificate-details.ts - format_date.ts → format-date.ts - get_cert_and_key.ts → get-cert-and-key.ts - Fix various linting issues across codebase Remaining: ~60 linting errors to be addressed - 21 @stylistic/lines-between-class-members - 9 perfectionist/sort-imports - 8 unicorn/filename-case - 6 no-undef (RequestInfo, BufferEncoding types) - Others (no-fallthrough, array-callback-return, etc.)
- Rename test/helpers/runCommand.ts to legacy-run-command.ts for old-style tests - Replace local run-command.ts with shared implementation from @heroku-cli/test-utils - Update 226+ test files to import runCommand from @heroku-cli/test-utils - Rename helper files to kebab-case: testInstances.ts -> test-instances.ts, uxStub.ts -> ux-stub.ts - Consolidate test utilities to use shared @heroku-cli/test-utils package This reduces code duplication and ensures all tests use the same command runner implementation.
- Replace local test/helpers/utils/expectOutput.ts with shared implementation - Update 57 test files to import expectOutput from @heroku-cli/test-utils - Use named import syntax for consistency with other test-utils exports This continues the consolidation of test utilities into the shared package.
Remove eslint plugins that are now handled by shared config. Also fix URL construction in exec.ts to avoid duplicate slashes in the API path.
The shared eslint config requires eslint-import-resolver-typescript v4.x for ESLint 9 flat config compatibility. Without it explicitly installed, npm resolves to v3.x from eslint-config-oclif, which has an incompatible interface and causes "invalid interface loaded as resolver" errors.
The bin/run.js file imports from the dist folder, which needs to exist before linting can resolve those imports. Running build before lint ensures the TypeScript compiler generates the dist folder first.
cf0c261 to
cb0d1bb
Compare
Use ternary expression with explicit return to satisfy getter-return rule while avoiding no-useless-return. Added explicit return type annotation for clarity.
- Add semi: ['warn', 'never'] to eslint config for no semicolons preference - Fix unicorn/prefer-ternary warning in members/add.ts - Remove unnecessary no-var from eslint-disable comment - Use String.raw for better backslash escaping in tests - Reorder imports and alphabetize mock properties
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.
Summary
Migrates the project from ESLint 8 with legacy
.eslintrc.cjsto ESLint 9 with flat config (eslint.config.js), adopting the shared eslint configuration from@heroku-cli/test-utils. This reduces duplication across Heroku CLI projects and ensures consistent linting rules.This PR primarily focuses on:
@heroku-cli/test-utils(runCommand, expectOutput, etc.)semi: ['warn', 'never']rule to enforce no-semicolon styleNote: Test helper, fixture, acceptance, and integration test linting changes are being handled in a separate PR (#3671).
Key changes:
.eslintrc.cjsand.eslintignorefileseslint.config.jsusing ESLint 9 flat config format@heroku-cli/test-utilsdependency for shared linting rules and test utilities@heroku-cli/test-utilsinstead of local implementationsType of Change
Patch Updates (patch semver update)
Testing
Notes:
Steps:
npm run lintto verify all linting rules passnpm testto ensure all tests pass