-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
ref: replace consistent-type-imports with verbatimModuleSyntax #95225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
0f77d54
49c50d6
d540b90
6e9647d
48f46ec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,11 @@ process.env.NODE_ENV = 'test'; | |
process.env.PUBLIC_URL = ''; | ||
process.env.TZ = 'America/New_York'; | ||
|
||
// We have a jest.config.ts file in ESM syntax but with verbatimModuleSyntax, | ||
// this is seen as a CommonJS file by Jest because we don't have type: "module" set in package.json. | ||
// The separate tsconfig.jest.json file turns off verbatimModuleSyntax | ||
process.env.TS_NODE_PROJECT = 'tsconfig.jest.json'; | ||
|
||
Comment on lines
+9
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this was a bit of a struggle to get there. to elaborate a bit: Under the hood, jest uses With However, the file is actually written in ESM syntax. One fix would be to rename it to The best fix would be to add I’m unsure who owns this, but the split between esm/cjs and extensions we have is a bit messy |
||
// Makes the script crash on unhandled rejections instead of silently | ||
// ignoring them. In the future, promise rejections that are not handled will | ||
// terminate the Node.js process with a non-zero exit code. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
import type {Location, LocationDescriptorObject} from 'history'; | ||
|
||
import ExternalLink from 'sentry/components/links/externalLink'; | ||
import {DEFAULT_QUERY} from 'sentry/constants'; | ||
import {t, tct} from 'sentry/locale'; | ||
import type {Event} from 'sentry/types/event'; | ||
import type {Group, GroupTombstoneHelper} from 'sentry/types/group'; | ||
import type {Organization} from 'sentry/types/organization'; | ||
|
||
export const DEFAULT_QUERY = 'is:unresolved issue.priority:[high, medium]'; | ||
|
||
export enum Query { | ||
FOR_REVIEW = 'is:unresolved is:for_review assigned_or_suggested:[me, my_teams, none]', | ||
PRIORITIZED = DEFAULT_QUERY, // eslint-disable-line @typescript-eslint/prefer-literal-enum-member | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note: verbatimModuleSyntax also enables isolatedModules, where files must be parseable on their own. For enums, that means they can’t reference a value outside of its file, or it’ll error with:
This is the only place where we had this violation (it’s also a lint violation as we can see), and since |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"verbatimModuleSyntax": false | ||
}, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: since knip also parses the
jest.config.ts
file, it suffers from the same problem as jest, so I’ve applied the same “fix”.