Skip to content

Commit

Permalink
build: downgrade Prettier to 2.x
Browse files Browse the repository at this point in the history
Jest 29 doesn't fully support Prettier 3
  • Loading branch information
ahnpnl committed Jun 27, 2024
1 parent c2b56ca commit a844b93
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 91 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { color } from '../entry'

jest.mock('some-module', () => ({}) as Partial<Record<string, unknown>>, { virtual: true })
jest.mock('some-module', () => ({} as Partial<Record<string, unknown>>), { virtual: true })

jest.mock('../entry', () => {
return { color: 'blue' }
Expand Down
99 changes: 21 additions & 78 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
"eslint-plugin-jest": "^28.6.0",
"eslint-plugin-jsdoc": "^48.5.0",
"eslint-plugin-prefer-arrow": "^1.2.3",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-prettier": "^4.2.1",
"execa": "5.1.1",
"fs-extra": "11.2.0",
"glob": "^10.2.6",
Expand All @@ -137,7 +137,7 @@
"lint-staged": "latest",
"lodash.camelcase": "^4.3.0",
"lodash.set": "^4.3.2",
"prettier": "^3.3.2",
"prettier": "^2.8.8",
"typescript": "~5.5.2"
},
"lint-staged": {
Expand Down
4 changes: 2 additions & 2 deletions src/cli/config/migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ Visit https://kulshekhar.github.io/ts-jest/user/config/#jest-preset for more inf
return shouldRemoveDuplicatedConfig
? acc
: acc
? { ...acc, [fileRegex]: transformerConfig }
: { [fileRegex]: transformerConfig }
? { ...acc, [fileRegex]: transformerConfig }
: { [fileRegex]: transformerConfig }
},
undefined,
)
Expand Down
5 changes: 1 addition & 4 deletions src/legacy/compiler/ts-compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,7 @@ export class TsCompiler implements TsCompilerInstance {

program: Program | undefined

constructor(
readonly configSet: ConfigSet,
readonly runtimeCacheFS: StringMap,
) {
constructor(readonly configSet: ConfigSet, readonly runtimeCacheFS: StringMap) {
this._ts = configSet.compilerModule
this._logger = rootLogger.child({ namespace: 'ts-compiler' })
this._parsedTsConfig = this.configSet.parsedTsConfig as ParsedCommandLine
Expand Down
5 changes: 1 addition & 4 deletions src/utils/ts-error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ export const INSPECT_CUSTOM = inspect.custom || 'inspect'
export class TSError extends BaseError {
name = 'TSError'

constructor(
public diagnosticText: string,
public diagnosticCodes: number[],
) {
constructor(public diagnosticText: string, public diagnosticCodes: number[]) {
super(
interpolate(Errors.UnableToCompileTypeScript, {
diagnostics: diagnosticText.trim(),
Expand Down

0 comments on commit a844b93

Please sign in to comment.