Skip to content

Instantly share code, notes, and snippets.

@jgarber623
Created March 21, 2018 18:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jgarber623/ae89f6ad69687e31a378f022219d9226 to your computer and use it in GitHub Desktop.
Save jgarber623/ae89f6ad69687e31a378f022219d9226 to your computer and use it in GitHub Desktop.

This configuration works, but doesn't include any rule customization:

{
  "extends": [
    "web-recommended"
  ],
  "formatters": [
    "codeframe"
  ],
  "ignoredUrls": [
    {
      "domain": ".*\\.googleapis\\.com/.*",
      "rules": ["*"]
    }
  ]
}

This configuration does not work:

{
  "extends": [
    "web-recommended"
  ],
  "formatters": [
    "codeframe"
  ],
  "rules": {
    "http-compression": ["warning", {
      "html": {
        "brotli": false
      }
    }]
  },
  "ignoredUrls": [
    {
      "domain": ".*\\.googleapis\\.com/.*",
      "rules": ["*"]
    }
  ]
}

The error message shown is "Invalid rule configuration in .sonarwhalrc: http-compression."

My goal is to silence errors/warnings about using Brotli and Zopfli compression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment