Skip to content

[no-unsafe-call] and [no-unsafe-member-access] improve reporting message when noImplicitThis is not enabled #3197

@JounQin

Description

@JounQin
  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have read the FAQ and my problem is not listed.

Repro

context: sveltejs/eslint-plugin-svelte3#102 (comment)

reproduction: https://github.com/frederikhors/issueWithThisAny

{
  "rules": {
    "@typescript-eslint/no-unsafe-call": 2,
    "@typescript-eslint/no-unsafe-member-access": 2
  }
}
export const store = () => {
  const methods = {
    OnInit() {
      this.Login();
    },

    Login() {
      //
    },

    async Logout() {
      //
    },
  };

  return methods;
};
{
  "extends": "@tsconfig/svelte/tsconfig.json",

  "compilerOptions": {
    "module": "ES2020",
    "target": "ES2020",
    "types": ["svelte", "node"],
    // "noImplicitThis": true
  },

  "include": ["*"],
  "exclude": ["node_modules/*", "__sapper__/*", "public/*"]
}

Expected Result

Reporting with message that tells the user this is type any because noImplicitThis is not enabled

Actual Result

No extra tips

Additional Info

Versions

package version
@typescript-eslint/eslint-plugin 4.17.0
@typescript-eslint/parser 4.17.0
TypeScript 4.2.3
ESLint 7.22.0
node 14.16.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy