Commit 1521234
Migrate from tslint to ESLint 10 + typescript-eslint 8
tslint went end-of-life in 2019. Migrating to the modern ESLint stack
drops the EOL footprint and lets style rules actually be enforced during
builds going forward (the old gulp-tslint task ran with emitError: false,
so violations have accumulated for years).
Config:
- eslint.config.mjs (flat config) translates the 23 rules from
src/tslint.json into the closest ESLint equivalents. A handful
(jsdoc-format, one-line, variable-name, whitespace, typedef-whitespace)
don't have clean ports; typedef-whitespace was removed from
@typescript-eslint in 8.x. None of those were materially enforced
under tslint.
- The legacy gulp.src **/*.+(ts|tsx) glob matched .d.ts files because
".d.ts" ends in ".ts"; the new config excludes .d.ts explicitly. It
also excludes *_internal.ts copies sourced from WebClipper_Internal
via copyInternal (lint those in their own repo, not in our build).
- no-unused-expressions allows ternary and short-circuit forms to match
the codebase's existing one-line conditional control flow.
Code touch-ups (the parts that didn't translate cleanly):
- `var` -> `let` across 18 files (262 occurrences in the three
namespace files alone — Constants, ClipperStorageKeys,
OffscreenMessageTypes — plus assorted others picked up by --fix).
`declare var browser` -> `declare let browser`.
- 4 surgical `// eslint-disable-next-line no-console` comments at the
legitimate console call sites (offscreenCommunicator.ts,
offscreen.ts, logManager.ts public stub) plus a file-level disable
on webConsole.ts whose entire purpose is console wrapping.
- Indentation and trailing-space fixes from `eslint --fix`.
Gulpfile:
- The `tslint` task is replaced by a `lint` task that spawns
node_modules/eslint/bin/eslint.js via child_process (same pattern
the tsc task uses). require.resolve("eslint/package.json") + path
walking gets us the bin without tripping eslint's restrictive
"exports" field.
- `tslint` is kept as an alias of `lint` so any external callers /
pipeline references keep working.
- --no-error-on-unmatched-pattern keeps the .tsx glob future-proof
(the V3 codebase has no .tsx files at the moment).
Dropped: tslint (3.15.1), gulp-tslint (6.1.2), gulp-plumber (1.2.1 —
only used by the old tslint stream). Deleted: src/tslint.json.
Added: eslint (10.4.0), typescript-eslint (8.59.4).
Verified: build clean (8.85s end-to-end), lint reports 0 errors, Aria
still bundled (8x microsoft.applications.telemetry.LogManager hits in
target/chrome/logManager.js).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent bcda05a commit 1521234
21 files changed
Lines changed: 1934 additions & 1531 deletions
File tree
- src
- scripts
- communicator
- extensions
- edge
- webExtensionBase
- logging
- submodules
- storage
| 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 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | 15 | | |
17 | 16 | | |
18 | | - | |
19 | 17 | | |
20 | 18 | | |
21 | 19 | | |
| |||
148 | 146 | | |
149 | 147 | | |
150 | 148 | | |
151 | | - | |
| 149 | + | |
152 | 150 | | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
170 | 162 | | |
171 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
172 | 167 | | |
173 | 168 | | |
174 | 169 | | |
| |||
0 commit comments