Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(eslint-plugin): replace unclear "error typed" with more helpful description#11704

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
wjhsf wants to merge2 commits intotypescript-eslint:main
base:main
Choose a base branch
Loading
fromwjhsf:wjh/avoid-unclear-error-typed
Open
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletionpackages/eslint-plugin/src/rules/no-unsafe-call.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -73,7 +73,7 @@ export default createRule<[], MessageIds>({
node: reportingNode,
messageId,
data: {
type: isErrorType ? '`error` type' : '`any`',
type: isErrorType ? 'unresolved due to error' : '`any`',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Not the most natural phrasing

🤔 yeah, I'm not sure that this specific change is better for users. Looking atthe deploy preview playground, the report message is:

Unsafe call of a(n) unresolved due to error typed value.

It took me a few tries to parse out the English grammar in that sentence, and I had to rely on already knowing the rule & this PR.

I'm drawing a blank here (and am a little swamped), but let's bikeshed. What's a more clear phrase we could go with?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Using an entirely new message would be best. Something along the lines of "Unsafe call of a type that could not be resolved." That's what I originally started doing in this PR, but then I had to touch more files than I wanted to, so I changed to the kludgy phrasing.

},
});
return;
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,9 +18,9 @@ const enum State {
Chained = 3,
}

function createDataType(type: ts.Type): '`any`' | '`error` typed' {
function createDataType(type: ts.Type): '`any`' | 'unresolved due to error' {
const isErrorType = tsutils.isIntrinsicErrorType(type);
return isErrorType ? '`error` typed' : '`any`';
return isErrorType ? 'unresolved due to error' : '`any`';
}

export type Options = [
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -289,7 +289,7 @@ value();
{
column: 1,
data: {
type: '`error` type',
type: 'unresolved due to error',
},
endColumn: 6,
line: 3,
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -207,7 +207,7 @@ value.property;
column: 7,
data: {
property: '.property',
type: '`error` typed',
type: 'unresolved due to error',
},
endColumn: 15,
line: 4,
Expand DownExpand Up@@ -340,7 +340,7 @@ function foo(x: { a: number }, y: NotKnown) {
column: 5,
data: {
property: '[y]',
type: '`error` typed',
type: 'unresolved due to error',
},
endColumn: 6,
line: 3,
Expand DownExpand Up@@ -515,7 +515,7 @@ function foo(x: { a: number }, y: NotKnown) {
column: 5,
data: {
property: '[y]',
type: '`error` typed',
type: 'unresolved due to error',
},
endColumn: 6,
line: 3,
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp