Skip to content

[Enhancement][dts]: align the tsc error format of isolatedDeclaration  #9718

Closed
@SoonIter

Description

@SoonIter

Summary

deno's implementation is earlier than tsc, so it has its own error format.

But presently, tsc has its standard error format, and users would use it with tsc isolatedDeclaration: true in tsconfig.json and wish they both have the same error diagnostic behavior

there is one case

input

import { useState } from 'react';
import './App.css';

function App() {
	return (
    	<div className="App"></div>
  	);
}

export default App;

expected behavior

src/App.tsx(4,10): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations.

actual behavior

output successfully

import { useState } from 'react';
import './App.css';
declare function App(); // -> 'App' implicitly has an 'any' return type
export default App;

Related links

#9715 (comment)_

web-infra-dev/rspack#8097

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions