mitchspano / sfdx-scan-pull-request

Runs sfdx-scanner on a pull request and generates in-line comments with the findings.
Apache License 2.0
73 stars 25 forks source link

Is there a way to "ignore" some files when this action is run on PR? #81

Open jae-spyrosoft opened 6 months ago

jae-spyrosoft commented 6 months ago

Problem

How to exclude staticresources folder (or any other folder) from scanning.

Already tried

I tried to exclude the whole staticresources folder by creating custom eslint configuration file like so:

{
    "extends": "@salesforce/eslint-config-lwc/recommended",
    "ignorePatterns": ["**/staticresources"]
}

However the above configuration results in many Scanner Internal violations with the file-must-compile rule error.

Example:

    {
      "engine": "eslint-custom",
      "fileName": "force-app/main/default/tabs/Files_Import.tab-meta.xml",
      "violations": [
        {
          "line": 1,
          "column": 0,
          "severity": 2,
          "message": "Parsing error: Unexpected token (1:0)",
          "ruleName": "files-must-compile",
          "category": "Scanner Internal",
          "url": ""
        }
      ]
    },
jae-spyrosoft commented 6 months ago

Without excluding staticresources folder I am getting tons of errors due to the fact that one of my resources is a minified javascript library which for some reason is also being scanned.