Commit 492ae5e
Improve codebase quality: fix bugs, modernize code, add CI (#131)
* Improve codebase quality: fix bugs, modernize code, add CI
Bug fixes:
- Fix error-handling bug in index.js where forEach loop called utils.error()
(which throws) on every iteration with a shadowed variable
- Fix loose equality (==) to strict (===) in containsPattern and test
- Remove unnecessary regex 'g' flag on regexes used with .test(), eliminating
brittle lastIndex state management
Modernization:
- Use Array.includes() instead of indexOf() !== -1
- Use Array.flat() instead of reduce(concat)
- Use arrow functions in utility callbacks
Tooling:
- Add ESLint 'lint' script to package.json
- Change 'test' script from watch mode to lint+unit (CI-friendly)
- Add eqeqeq ESLint rule to prevent future loose equality
- Add GitHub Actions CI workflow (Node 14/16/18/20 matrix)
- Update mock-fs from v4 to v5 for Node.js 22 compatibility (fixes 8 pre-existing test failures)
https://claude.ai/code/session_017GbwKxDk7oJN3tXXKSbUDg
* fix(ci): drop Node 14 and handle OpenSSL 3.0 in Node 18+
- Remove Node 14 from CI matrix (EOL, npm 6 can't parse lockfile v3)
- Set --openssl-legacy-provider for Node 18+ to fix webpack 4's
use of the removed md4 hash algorithm (ERR_OSSL_EVP_UNSUPPORTED)
https://claude.ai/code/session_017GbwKxDk7oJN3tXXKSbUDg
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 39c8086 commit 492ae5e
7 files changed
Lines changed: 5808 additions & 4755 deletions
File tree
- .github/workflows
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
| 3 | + | |
| 4 | + | |
7 | 5 | | |
8 | 6 | | |
9 | 7 | | |
| |||
14 | 12 | | |
15 | 13 | | |
16 | 14 | | |
17 | | - | |
18 | | - | |
19 | 15 | | |
20 | 16 | | |
21 | 17 | | |
| |||
25 | 21 | | |
26 | 22 | | |
27 | 23 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
| 24 | + | |
32 | 25 | | |
33 | 26 | | |
34 | 27 | | |
| |||
0 commit comments