Skip to content
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

SonarLint discussion #1

Open
Roustalski opened this issue Jan 17, 2019 · 1 comment
Open

SonarLint discussion #1

Roustalski opened this issue Jan 17, 2019 · 1 comment

Comments

@Roustalski
Copy link

Roustalski commented Jan 17, 2019

Hi,

I have your extension pack installed but have run across an issue with SonarLint. There isn't currently a way to disable a particular rule, even though I find the code analysis very helpful.

As an example:

// Typescript snippet

import { IHookProperties, setDefault } from "ts-log-class";

setDefault({
  hook: (logProps: IHookProperties) => {
    if (logProps.arguments.hasOwnProperty("user")) {
      const user: any = JSON.parse(logProps.arguments.user);
      // @SupressWarnings("all")
      user.password = "[secret]";
      logProps.arguments.user = JSON.stringify(user);
    }
    return JSON.stringify(logProps);
  },
  out: (message?: any, ...optionalParameters: any[]) => {
    Logging.Logger.debug(message, optionalParameters);
  }
});

In this case I need to suppress the error Credentials should not be hard-coded (typescript:S2068) because one, it is a copy of the object, and two it prevents the password from being printed/logged in my cloud provider. Since there is no way to currently suppress this and any other errors that are false positives, should we consider temporarily removing SonarLint from the pack?

@Roustalski
Copy link
Author

FYI, I started a discussion on the Sonar community forum and also commented on the Epic over the VSCode extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant