Skip to content

Commit e8e7aa8

Browse files
authored
Merge pull request #155 from kaonis/feat/154-eslint-flat-config
feat: migrate linting to ESLint flat config (closes #154)
2 parents 9182401 + f9e8a75 commit e8e7aa8

8 files changed

Lines changed: 109 additions & 47 deletions

File tree

.eslintrc.json

Lines changed: 0 additions & 36 deletions
This file was deleted.

apps/cnc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"test:ci": "npm run test:preflight && jest --ci --coverage --maxWorkers=2",
1616
"test:schema-gate": "npm run test:preflight && jest --ci --runInBand src/services/__tests__/nodeManager.test.ts",
1717
"test:coverage": "npm run test:preflight && jest --coverage",
18-
"lint": "ESLINT_USE_FLAT_CONFIG=false eslint src --ext .ts --max-warnings=0",
18+
"lint": "eslint src --max-warnings=0",
1919
"format": "prettier --write \"src/**/*.ts\"",
2020
"pm2:start": "pm2 start ecosystem.config.js",
2121
"pm2:stop": "pm2 stop woly-cnc",

apps/node-agent/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
"start": "ts-node src/app.ts",
1717
"dev": "nodemon --watch src --exec ts-node src/app.ts",
1818
"prod": "npm run build && npm run pm2:start",
19-
"lint": "ESLINT_USE_FLAT_CONFIG=false eslint src --max-warnings=0",
20-
"lint-fix": "ESLINT_USE_FLAT_CONFIG=false eslint --fix src --max-warnings=0",
19+
"lint": "eslint src --max-warnings=0",
20+
"lint-fix": "eslint --fix src --max-warnings=0",
2121
"format": "prettier --write src",
2222
"security:audit": "npm audit --audit-level=high",
2323
"pm2:start": "pm2 start ecosystem.config.js",

docs/DEPENDENCY_MAJOR_UPGRADE_PLAN.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,20 @@ Primary impact:
5252
Tracking issue: #148
5353
4. Wave D: ESLint 10 compatibility revisit
5454
Tracking issue: #150
55+
5. Wave E: ESLint flat config migration precondition
56+
Tracking issue: #154
5557

5658
## 4. Decision Table (2026-02-15)
5759

5860
| Dependency | Decision | Rationale | Tracking |
5961
|---|---|---|---|
60-
| ESLint v9 | Merge candidate | Compatible major with typescript-eslint v8 peer requirements | #146 |
62+
| ESLint v9 | Merged | Adopted with typescript-eslint v8 via PR #151 | #146 |
6163
| ESLint v10 | Deferred pending upstream compatibility | Still blocked: latest `@typescript-eslint/*@8.55.0` peers `eslint ^8.57.0 || ^9.0.0` | #150 |
62-
| typescript-eslint v8 | Merge candidate | Coupled with ESLint v9 upgrade under current compatibility constraints | #146 |
63-
| eslint-config-prettier v10 | Merge candidate | Companion lint stack upgrade with low runtime risk | #146 |
64+
| typescript-eslint v8 | Merged | Upgraded with ESLint v9 toolchain migration via PR #151 | #146 |
65+
| eslint-config-prettier v10 | Merged | Upgraded with ESLint v9 toolchain migration via PR #151 | #146 |
6466
| Zod v4 | Merged | Runtime schema compatibility validated across protocol/C&C/node-agent and merged via PR #152 | #147 |
6567
| npm v11 | Merged | Workspace tooling and CI remained stable; adopted via PR #17 | #148 |
68+
| ESLint flat config mode | In progress | Removes legacy `.eslintrc`/`ESLINT_USE_FLAT_CONFIG=false` dependency to clear ESLint 10 precondition | #154 |
6669

6770
## 5. Exit Criteria for #144
6871

docs/ROADMAP_V6.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@ Scope: New autonomous cycle after V5 completion.
66
## 1. Status Audit
77

88
### Repository and branch status
9-
- `master` synced at merge commit `71dd306` (PR #17).
9+
- `master` synced at merge commit `9182401` (PR #153).
1010
- Active execution branch: `master`.
1111

1212
### Open issue snapshot (`kaonis/woly-server`)
1313
- #4 `Dependency Dashboard`
14+
- #154 `[Lint] Migrate to ESLint flat config before ESLint 10 adoption`
1415
- #150 `[Dependencies] Revisit ESLint 10 adoption after typescript-eslint compatibility`
1516

1617
### CI snapshot
17-
- Post-merge checks for `71dd306` are green (CI + CodeQL).
18+
- Post-merge checks for `9182401` are green (CI + CodeQL).
1819
- Dependency triage workflow and audit/security gates are documented and active.
1920

2021
## 2. Iterative Phases
@@ -74,6 +75,17 @@ Acceptance criteria:
7475

7576
Status: `Blocked` (2026-02-15; latest `@typescript-eslint/*@8.55.0` peers `eslint ^8.57 || ^9`)
7677

78+
### Phase 6: ESLint flat config migration precondition
79+
Issue: #154
80+
Labels: `priority:low`, `technical-debt`, `testing`
81+
82+
Acceptance criteria:
83+
- Migrate `cnc` and `node-agent` lint tasks to ESLint flat config mode.
84+
- Remove legacy `.eslintrc` dependency and `ESLINT_USE_FLAT_CONFIG=false` usage.
85+
- Keep lint/typecheck/test/build gates green.
86+
87+
Status: `In Progress` (2026-02-15)
88+
7789
## 3. Execution Loop Rules
7890

7991
For each phase:
@@ -110,3 +122,7 @@ For each phase:
110122
- 2026-02-15: Adopted npm 11 via PR #17 (`packageManager` set to `npm@11.10.0`), closing #148.
111123
- 2026-02-15: Verified post-merge checks for npm 11 adoption green on `master` (CI + CodeQL, commit `71dd306`).
112124
- 2026-02-15: Re-validated ESLint 10 compatibility checkpoint for #150 (`npm view @typescript-eslint/eslint-plugin@latest peerDependencies` still `^8.57.0 || ^9.0.0`), keeping #150 open and blocked.
125+
- 2026-02-15: Merged roadmap/dependency checkpoint docs via PR #153 and verified post-merge `master` checks green (CI + CodeQL).
126+
- 2026-02-15: Started Phase 6 issue #154 on branch `feat/154-eslint-flat-config`.
127+
- 2026-02-15: Migrated lint configuration to root `eslint.config.js`, removed legacy `.eslintrc.json`, and switched app lint scripts to flat-config mode without `ESLINT_USE_FLAT_CONFIG=false`.
128+
- 2026-02-15: Ran local gates for #154 (`npm run lint`, `npm run typecheck`, `npm run test:ci`, `npm run build`) successfully.

eslint.config.js

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
const js = require('@eslint/js');
2+
const globals = require('globals');
3+
const tsPlugin = require('@typescript-eslint/eslint-plugin');
4+
const tsParser = require('@typescript-eslint/parser');
5+
const prettierConfig = require('eslint-config-prettier');
6+
7+
module.exports = [
8+
{
9+
ignores: [
10+
'dist/',
11+
'node_modules/',
12+
'**/*.js',
13+
'**/*.test.ts',
14+
'**/*.spec.ts',
15+
'**/__tests__/**',
16+
],
17+
},
18+
{
19+
...js.configs.recommended,
20+
languageOptions: {
21+
...js.configs.recommended.languageOptions,
22+
ecmaVersion: 2022,
23+
sourceType: 'module',
24+
globals: {
25+
...globals.node,
26+
...globals.es2022,
27+
},
28+
},
29+
},
30+
{
31+
files: ['**/*.ts'],
32+
languageOptions: {
33+
parser: tsParser,
34+
ecmaVersion: 2022,
35+
sourceType: 'module',
36+
globals: {
37+
...globals.node,
38+
...globals.es2022,
39+
},
40+
},
41+
plugins: {
42+
'@typescript-eslint': tsPlugin,
43+
},
44+
rules: {
45+
...tsPlugin.configs.recommended.rules,
46+
...prettierConfig.rules,
47+
'no-undef': 'off',
48+
'@typescript-eslint/no-explicit-any': 'warn',
49+
'@typescript-eslint/explicit-function-return-type': 'off',
50+
'@typescript-eslint/explicit-module-boundary-types': 'off',
51+
'@typescript-eslint/no-unused-vars': [
52+
'warn',
53+
{
54+
argsIgnorePattern: '^_',
55+
caughtErrorsIgnorePattern: '^_',
56+
},
57+
],
58+
'prefer-const': 'error',
59+
'no-var': 'error',
60+
},
61+
},
62+
];

package-lock.json

Lines changed: 18 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,12 @@
3030
"protocol:version:major": "npm version major --workspace=@kaonis/woly-protocol"
3131
},
3232
"devDependencies": {
33+
"@eslint/js": "^9.39.2",
3334
"@typescript-eslint/eslint-plugin": "^8.0.0",
3435
"@typescript-eslint/parser": "^8.0.0",
3536
"eslint": "^9.0.0",
3637
"eslint-config-prettier": "^10.0.0",
38+
"globals": "^17.3.0",
3739
"prettier": "^3.1.1",
3840
"turbo": "^2",
3941
"typescript": "^5.9.3"

0 commit comments

Comments
 (0)