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

JS: simplify static boolean expressions

Open
#548 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
go, javascript
Domain
tooling

Research direction

Start by reading the JavaScript minifier entry point and its tests for static expressions; the issue does not name specific files. Check how boolean literals are currently emitted, then add coverage for both if (true) and if (false) cases. Done means static boolean conditions are evaluated away while nonstatic conditions remain unaffected.

Written by the indexing model from the issue text.

Description

Example of code which is not optimized:

if (true) {
console.log("true")
}
if (false) {
console.log("false")
}

It is minified into !0&&console.log("true"),!1&&console.log("false") while it would be better to pre-evaluate the expression and just minify it into console.log("true") (of course only static boolean values).

Thanks!

Dominant language
Go
Stars
4.1k
Forks
244
Avg merge
2d 4h
Merged PRs (30d)
10

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

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 tdewolff/minify

All issues in tdewolff/minify

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.