Modernize tooling: Migrate TSLint→ESLint, TypeScript 5.3, custom error classes#21
Draft
Modernize tooling: Migrate TSLint→ESLint, TypeScript 5.3, custom error classes#21
Conversation
Co-authored-by: vdolek <361441+vdolek@users.noreply.github.com>
Co-authored-by: vdolek <361441+vdolek@users.noreply.github.com>
Co-authored-by: vdolek <361441+vdolek@users.noreply.github.com>
Co-authored-by: vdolek <361441+vdolek@users.noreply.github.com>
Co-authored-by: vdolek <361441+vdolek@users.noreply.github.com>
Co-authored-by: vdolek <361441+vdolek@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Replace TSLint with ESLint for code modernization
Modernize tooling: Migrate TSLint→ESLint, TypeScript 5.3, custom error classes
Feb 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TSLint has been deprecated since 2019. This PR migrates to ESLint, upgrades TypeScript to 5.3.3, and modernizes the codebase to 2026 standards while maintaining 100% backward compatibility.
Tooling Migration
@typescript-eslintplugins with type-aware rulesnoUnusedLocals,noUnusedParameters,noImplicitReturns,noFallthroughCasesInSwitch)postbuildsed script, addedtype-checkandprepublishOnlyvalidationCode Quality
as unknown as T, type guards) or documented@ts-expect-errorwhere structurally necessary (ReadOnlyDictionary static method incompatibility)@typescript-eslint/no-explicit-any,@typescript-eslint/no-unsafe-call)Error Handling
Created typed error class hierarchy extending from
CollectionError:New error classes exported:
CollectionError,ArgumentOutOfRangeError,IndexOutOfRangeError,DuplicateKeyError,NoElementsError,NoMatchError, etc.Note:
ValueNotNumberErrorextendsTypeError(notCollectionError) to match original implementation behavior.Configuration
Added
.editorconfigfor consistent formatting across editors.Original prompt
Objective
Modernize the sharp-collections codebase to align with current TypeScript, JavaScript, and tooling best practices as of 2026.
Critical Changes
1. Replace TSLint with ESLint (CRITICAL - TSLint deprecated in 2019)
Remove these dependencies from package.json:
Add ESLint dependencies:
Create .eslintrc.json:
{ "root": true, "parser": "@typescript-eslint/parser", "extends": [ "eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:@typescript-eslint/recommended-requiring-type-checking" ], "plugins": ["@typescript-eslint", "chai-friendly"], "parserOptions": { "ecmaVersion": 2022, "sourceType": "module", "project": "./tsconfig.json" }, "rules": { "no-unused-expressions": "off", "chai-friendly/no-unused-expressions": "error", "@typescript-eslint/no-explicit-any": "warn" }, "ignorePatterns": ["dist/", "node_modules/", "*.js"] }Create .eslintignore:
Delete tslint.json file
Update package.json scripts:
2. Remove All @ts-ignore Comments
In src/extensions/enumerable/Single.ts:
Replace:
With:
Find and fix any other @ts-ignore comments in the codebase
3. Update TypeScript Configuration
Update tsconfig.json:
{ "compilerOptions": { "target": "ES2020", "module": "ES2020", "lib": ["ES2020", "ES2021", "ES2022"], "moduleResolution": "bundler", "declaration": true, "declarationMap": true, "sourceMap": true, "outDir": "./dist", "downlevelIteration": true, "strict": true, "noUnusedLocals": true, "noUnusedParameters": true, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, "baseUrl": "./", "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "exactOptionalPropertyTypes": true, "noUncheckedIndexedAccess": true, "removeComments": false }, "include": ["src"], "exclude": ["node_modules", "**/__tests__/*", "dist"] }4. Modernize Error Handling with Custom Error Classes
Replace src/Errors.ts content: