Skip to content

Conversation

JasonWeinzierl
Copy link
Owner

@JasonWeinzierl JasonWeinzierl commented Nov 7, 2024

import * as ts from "typescript" does not work as expected in ESM until TypeScript 5.5 (see https://devblogs.microsoft.com/typescript/announcing-typescript-5-5/#easier-api-consumption-from-ecmascript-modules). This was causing projects using an ESM eslint config with TypeScript 4.7 through 5.4 to get:

Oops! Something went wrong! :(

ESLint: 8.57.1

TypeError: Cannot read properties of undefined (reading 'Any')

This changes to import ts from "typescript" so the import works on those older TypeScript versions in ESM.

  • Also increase minimum TypeScript version to 4.7.4 to align with typescript-eslint/typescript-estree's supported versions.

Copy link

github-actions bot commented Nov 7, 2024

LCOV of commit 9bf6e82 during .github/workflows/ci.yml #36

Summary coverage rate:
  lines......: 96.2% (3252 of 3379 lines)
  functions..: 92.9% (196 of 211 functions)
  branches...: 91.1% (613 of 673 branches)

Files changed coverage rate:
                                         |Lines       |Functions  |Branches    
  Filename                               |Rate     Num|Rate    Num|Rate     Num
  =============================================================================
  src/etc/could-be-function.ts           | 100%      8| 100%     1| 100%      4
  src/etc/could-be-type.ts               |97.7%     88| 100%     4|97.7%     44
  src/etc/get-loc.ts                     | 100%     16| 100%     1| 100%      1
  src/etc/get-type-services.ts           | 100%     76|73.3%    15|92.0%     25
  src/rules/no-cyclic-action.ts          |88.9%    108| 100%     4|68.4%     19
  src/rules/no-unsafe-subject-next.ts    | 100%     53| 100%     1| 100%     14
  src/rules/throw-error.ts               | 100%     51| 100%     3| 100%      7

It was just tseslint v7 that doesn't like ts 5.6.
@JasonWeinzierl JasonWeinzierl merged commit 1693df0 into main Nov 7, 2024
2 checks passed
@JasonWeinzierl JasonWeinzierl deleted the fix-old-ts-versions branch November 7, 2024 17:45
@JasonWeinzierl JasonWeinzierl added the bug Something isn't working label Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant