Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Add a lint rule and CI check for unbounded `console`/debug output leaking into production builds

Open
#290 2 comments 0 reactions 0 assignees View on GitHub

@shobhamerabacha-star is already working on this.

Since Oct 9, 2026.

Assessment

Difficulty
3/5
Estimated time
Half a day
Newbie friendliness
55/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
eslint, github-actions, nodejs, typescript
Domain
ci-cd, tooling

Research direction

Start with .eslintrc.js to add the no-console and no-floating-promises rules, then with .github/workflows/build-check.yml for the grep step, and package.json line 18 for the lint script that uses --fix. The six console.* calls are in src/, including src/common/database/database-index.service.ts:117, and the floating promise is at src/profiling/profiling.service.ts:144. Done means the rules are configured with spec files excluded, the calls use the configured logger, the CI grep fails on reintroduced console.*, and npm test and npx tsc --noEmit pass. The warn-or-error choice and logger choice are not settled in the issue, so confirm them first.

Written by the indexing model from the issue text.

Description

accessibility good first issue tooling

Problem

Six raw console.* calls remain in src/, including one in src/common/database/database-index.service.ts:117. .eslintrc.js has no no-console rule, and CI (.github/workflows/build-check.yml) runs tsc --noEmit, a narrow Jest subset, and the build — none of which flags this.

There is a related smell: src/profiling/profiling.service.ts:144 uses setTimeout(async () => { ... }), wrapping an async callback in a timer with no error handling — a floating promise that would produce an unhandled rejection rather than a visible failure.

Why it matters

In an operator-facing system, unhandled output and unhandled rejections both hide real failures. A console.log that nobody routes goes to stdout with no request context (see the logging-facade issue), and an async callback inside setTimeout whose promise rejects is silent by default in Node.

The general lesson: the lint config does not currently guard several classes of mistake that matter here, and CI does not compensate.

Suggested Direction

  1. Add no-console to .eslintrc.js as a warning, with warn/error allowed only if the team wants to keep those:
    'no-console': ['warn', { allow: ['warn', 'error'] }],
    
    Move the six existing calls to the configured logger in the same PR.
  2. Add no-async-promise-executor and a floating-promise guard. TypeScript's no-floating-promises needs type-aware linting; parserOptions.project is already configured in .eslintrc.js, so the type-aware rules are available. Enable @typescript-eslint/no-floating-promises as a warning — it would have caught profiling.service.ts:144.
  3. Exclude spec files from no-console, since asserting on console output is legitimate in tests.
  4. Add a CI grep as a hard backstop, since lint runs with --fix (package.json:18) and may rewrite rather than fail:
    - name: Reject console.* in src
      run: |
        if grep -rn --include='*.ts' -E 'console\.(log|debug)' src/ ; then
          echo 'console.* found in src/ - use the configured logger'
          exit 1
        fi
    
  5. Treat npm run lint carefully. It runs with --fix, which rewrites files rather than failing. A separate lint:check without --fix would be a better CI gate.

Constraints

  • Spec files legitimately use console; scope the rule and the grep to exclude *.spec.ts.
  • Generated files (src/graphql/client/generated.ts) should be excluded from any of this.
  • Do not introduce a different formatter/linter in this issue — the config and dependency-alignment issues cover that.

Acceptance Criteria

  • no-console is configured in .eslintrc.js, scoped to exclude spec files.
  • The six existing console.* calls in src/ are replaced with the configured logger.
  • profiling.service.ts:144 is fixed and covered by no-floating-promises.
  • A CI step fails if console.* reappears in src/.
  • npm test and npx tsc --noEmit pass.
Dominant language
TypeScript
Stars
7
Forks
55
Avg merge
1d 17h
Merged PRs (30d)
5

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from SourceXXL/alian_structure-api

All issues in SourceXXL/alian_structure-api

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.