1

I'd like to disable the warning AL1025, because of the nature of the AL compiler, I get a lot of warnings related to my node_modules folder. Apparently, it should be possible to suppress warnings in the app.json like this

  "suppressWarnings": ["AL1025"]

But I still get those warnings:

Microsoft (R) AL Compiler version 7.4.7.43721
Copyright (C) Microsoft Corporation. All rights reserved

Compilation started for project 'ABC Sample Ext' containing '11' files at '19:58:7.337'.

/Users/username/Dev/abc-workspace/abc-sample/node_modules/he/LICENSE-MIT.txt(1,1): warning AL1025: The file at location '/Users/username/Dev/abc-workspace/abc-sample/node_modules/he/LICENSE-MIT.txt' does not match any definition.

What am I doing wrong?

binford
  • 1,655
  • 1
  • 18
  • 36

1 Answers1

4

You need to define a ruleset that tells the compiler which warnings/errors to ignore.

There are two parts to this:

  1. Define the ruleset
  2. Activate the ruleset

The ruleset is defined in JSON format with a name, description and collection of rules. A rule must have an id, a description and justification.

An example could be:

{
    "name": "Custom ruleset",
    "description": "Set some rules as hidden",
    "rules": [
        {
            "id": "AL1025",
            "action": "Info",
            "justification": "Allow non-AL files in workspace"           
        }
    ]
}

Then you need to activate the rules you defined. This is done by defining al.ruleSetPath in your settings.json (in the .vscode folder):

{
    "al.ruleSetPath": "./custom.ruleset.json"
}
kaspermoerch
  • 16,127
  • 4
  • 44
  • 67
  • +1 for the workaround but I rather would like to get the `suppressWarnings` attribute of the `app.json` working. – binford Sep 07 '21 at 16:07
  • I guess there might be a dependency to the version of Business Central you are using. Which version is that? – kaspermoerch Sep 08 '21 at 07:06