Consume @itwin/eslint-plugin 6.0.0, update linting, remove a pnpm override#342
Consume @itwin/eslint-plugin 6.0.0, update linting, remove a pnpm override#342
Conversation
- Bump @itwin/eslint-plugin ^4.1.1 → ^6.0.0 and eslint ^8.57.1 → ^9.11.1 in all 5 packages
- Remove flat-cache>flatted pnpm override (no longer needed: eslint@9 brings flatted@3.4.2)
- Fix all lint errors introduced by v6 rule changes:
- Replace deprecated 'deprecation/deprecation' disable comments with '@typescript-eslint/no-deprecated'
- Update '@typescript-eslint/no-var-requires' disable comments to 'no-require-imports'
- Replace unused catch bindings (err/error) with bare catch {} blocks
- Add eslint-disable-next-line for no-non-null-assertion sites (per project policy)
- Fix prefer-promise-reject-errors violations
- Fix @itwin/require-version-in-deprecation: use '. ' separator, no 'x' in semver
- Remove stale/duplicate eslint-disable comments made unnecessary by v6
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
anmolshres98
left a comment
There was a problem hiding this comment.
are all the eslint disable lines needed? could null assertions be correctly checked instead of disabling it for specific lines? perhaps you can quickly evaluate?
…n-null assertions - Remove dormant minimatch pnpm override (no package uses minimatch 9.x) - Convert require() to top-level imports in TestConfig.ts, add dotenv/dotenv-expand as devDeps - Replace non-null assertions with proper null guards in production code (Client.ts, IntrospectionClient.ts) and integration test Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Re: review comment on eslint disables and non-null assertions — Went through all the
Left the test-only ones ( The |
Override picomatch@<2.3.2 and picomatch@>=4.0.0<4.0.4 to patched versions, resolving ReDoS vulnerability (GHSA-c2c7-rcm5-vvqj) from transitive deps via mocha/chokidar, beachball, and typescript-eslint. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Bump mocha from ^10.8.2 to ^11.7.5 across all packages. mocha 11 uses chokidar@4 which no longer depends on the vulnerable picomatch@4.0.3, removing the need for the picomatch@>=4.0.0<4.0.4 pnpm override. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
anmolshres98
left a comment
There was a problem hiding this comment.
I think you committed this one file by mistake other than that looks good I think. thanks
- certaBackend.ts: convert dotenv/dotenv-expand requires to imports - loadConfig.ts: convert dotenv-expand require to import - Upgrade dotenv-expand to v12 in oidc-signin-tool - TokenStore.ts and renderer/Client.ts: cannot convert due to dual CJS/ESM build and runtime conditional loading respectively Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Follow up from #341 (comment)
Dependency upgrades:
@itwin/eslint-pluginto version 6.0.0 andeslintto version 9.11.1 inpackages/browser/package.jsonandpackages/electron/package.json, ensuring all packages use the latest linting tools.Lint rule adjustments and code style:
deprecation/deprecationand@typescript-eslint/no-var-requires) with updated ones (@typescript-eslint/no-deprecatedand@typescript-eslint/no-require-imports) throughout the codebase for improved lint compatibility.@deprecated in 1.1.0.). We also have a custom lint rule in iTwin/eslint-plugin that is more strict on thiscatchblocks, leading to cleaner and more modern code.Other minor improvements:
flat-cache>flattedin the rootpackage.json.These changes collectively modernize the codebase’s linting setup and ensure compatibility with the latest standards.