java.lang.IllegalArgumentException: -1 is not a valid line offset for a file

Hello everyone, I am encountering an issue while running SonarScanner with ESLint integration on my project. The scan fails with the following error:

10:39:00.556 INFO: Rule | Time (ms) | Relative
10:39:00.556 INFO: :----|----------:|--------:
10:39:02.326 INFO: ------------------------------------------------------------------------
10:39:02.326 INFO: EXECUTION FAILURE
10:39:02.326 INFO: ------------------------------------------------------------------------
10:39:02.327 INFO: Total time: 1:18.454s
10:39:02.441 INFO: Final Memory: 19M/123M
10:39:02.442 INFO: ------------------------------------------------------------------------
10:39:02.442 ERROR: Error during SonarScanner execution
java.lang.IllegalArgumentException: -1 is not a valid line offset for a file
	at org.sonar.api.utils.Preconditions.checkArgument(Preconditions.java:43)
	at org.sonar.api.batch.fs.internal.DefaultInputFile.checkValid(DefaultInputFile.java:372)
	at org.sonar.api.batch.fs.internal.DefaultInputFile.newPointer(DefaultInputFile.java:307)
	at org.sonar.api.batch.fs.internal.DefaultInputFile.newRange(DefaultInputFile.java:322)
	at org.sonar.plugins.javascript.external.EslintReportSensor.getLocation(EslintReportSensor.java:139)
	at org.sonar.plugins.javascript.external.EslintReportSensor.saveEslintError(EslintReportSensor.java:97)
	at org.sonar.plugins.javascript.external.EslintReportSensor.importReport(EslintReportSensor.java:76)
	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.lambda$execute$1(AbstractExternalIssuesSensor.java:55)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.execute(AbstractExternalIssuesSensor.java:55)
	at org.sonar.plugins.javascript.external.EslintReportSensor.execute(EslintReportSensor.java:43)
	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:64)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:88)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:61)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:79)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:61)
	at org.sonar.scanner.scan.SpringModuleScanContainer.doAfterStart(SpringModuleScanContainer.java:82)
	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:226)
	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:205)
	at org.sonar.scanner.scan.SpringProjectScanContainer.scan(SpringProjectScanContainer.java:204)
	at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:200)
	at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:173)
	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:226)
	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:205)
	at org.sonar.scanner.bootstrap.SpringScannerContainer.doAfterStart(SpringScannerContainer.java:351)
	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:226)
	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:205)
	at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:138)
	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:226)
	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:205)
	at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:71)
	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:65)
	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
	at jdk.proxy1/jdk.proxy1.$Proxy0.execute(Unknown Source)
	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
	at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:126)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:81)
	at org.sonarsource.scanner.cli.Main.main(Main.java:62)
10:39:02.444 ERROR: 
10:39:02.444 ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
10:39:02.451 DEBUG: Cleanup org.eclipse.jgit.util.FS$FileStoreAttributes$$Lambda$302/0x00007ff96c287b50@7808fb9 during JVM shutdown
Cleaning up project directory and file based variables 00:01
ERROR: Job failed: exit code 1
1mERROR: Job failed: exit code 1

Here is some example of ESLint reports I am using (source code section is hidden for brevity and privacy) that are causing the error :

[
    {
        "filePath": "/builds/sti/templates/angular/components/core/app-initializer/app-initializer.module.ts",
        "messages": [],
        "suppressedMessages": [],
        "errorCount": 0,
        "fatalErrorCount": 0,
        "warningCount": 0,
        "fixableErrorCount": 0,
        "fixableWarningCount": 0,
        "usedDeprecatedRules": []
    },
    {
        "filePath": "/builds/sti/templates/angular/components/core/app-initializer/initialize-authentication-factory.ts",
        "messages": [
            {
                "ruleId": "@typescript-eslint/no-empty-function",
                "severity": 2,
                "message": "Unexpected empty arrow function.",
                "line": 11,
                "column": 28,
                "nodeType": "ArrowFunctionExpression",
                "messageId": "unexpected",
                "endLine": 11,
                "endColumn": 30
            }
        ],
        "suppressedMessages": [],
        "errorCount": 1,
        "fatalErrorCount": 0,
        "warningCount": 0,
        "fixableErrorCount": 0,
        "fixableWarningCount": 0,
        "source": "...",
        "usedDeprecatedRules": []
    },
    {
        "filePath": "/builds/sti/templates/angular/components/core/app-initializer/initialize-config-factory.ts",
        "messages": [
            {
                "ruleId": "@typescript-eslint/no-explicit-any",
                "severity": 2,
                "message": "Unexpected any. Specify a different type.",
                "line": 8,
                "column": 83,
                "nodeType": "TSAnyKeyword",
                "messageId": "unexpectedAny",
                "endLine": 8,
                "endColumn": 86,
                "suggestions": [
                    {
                        "messageId": "suggestUnknown",
                        "fix": {
                            "range": [
                                438,
                                441
                            ],
                            "text": "unknown"
                        },
                        "desc": "Use `unknown` instead, this will force you to explicitly, and safely assert the type is correct."
                    },
                    {
                        "messageId": "suggestNever",
                        "fix": {
                            "range": [
                                438,
                                441
                            ],
                            "text": "never"
                        },
                        "desc": "Use `never` instead, this is useful when instantiating generic type parameters that you don't need to know the type of."
                    }
                ]
            },
            {
                "ruleId": "@typescript-eslint/no-empty-function",
                "severity": 2,
                "message": "Unexpected empty arrow function.",
                "line": 15,
                "column": 18,
                "nodeType": "ArrowFunctionExpression",
                "messageId": "unexpected",
                "endLine": 15,
                "endColumn": 20
            },
            {
                "ruleId": "@typescript-eslint/no-explicit-any",
                "severity": 2,
                "message": "Unexpected any. Specify a different type.",
                "line": 18,
                "column": 84,
                "nodeType": "TSAnyKeyword",
                "messageId": "unexpectedAny",
                "endLine": 18,
                "endColumn": 87,
                "suggestions": [
                    {
                        "messageId": "suggestUnknown",
                        "fix": {
                            "range": [
                                759,
                                762
                            ],
                            "text": "unknown"
                        },
                        "desc": "Use `unknown` instead, this will force you to explicitly, and safely assert the type is correct."
                    },
                    {
                        "messageId": "suggestNever",
                        "fix": {
                            "range": [
                                759,
                                762
                            ],
                            "text": "never"
                        },
                        "desc": "Use `never` instead, this is useful when instantiating generic type parameters that you don't need to know the type of."
                    }
                ]
            },
            {
                "ruleId": "@typescript-eslint/no-empty-function",
                "severity": 2,
                "message": "Unexpected empty arrow function.",
                "line": 34,
                "column": 18,
                "nodeType": "ArrowFunctionExpression",
                "messageId": "unexpected",
                "endLine": 34,
                "endColumn": 20
            }
        ],
        "suppressedMessages": [],
        "errorCount": 4,
        "fatalErrorCount": 0,
        "warningCount": 0,
        "fixableErrorCount": 0,
        "fixableWarningCount": 0,
        "source": "...",
        "usedDeprecatedRules": []
    },
    {
        "filePath": "/builds/sti/templates/angular/components/core/app-initializer/initialize-domains-factory.ts",
        "messages": [
            {
                "ruleId": "@typescript-eslint/no-explicit-any",
                "severity": 2,
                "message": "Unexpected any. Specify a different type.",
                "line": 7,
                "column": 81,
                "nodeType": "TSAnyKeyword",
                "messageId": "unexpectedAny",
                "endLine": 7,
                "endColumn": 84,
                "suggestions": [
                    {
                        "messageId": "suggestUnknown",
                        "fix": {
                            "range": [
                                316,
                                319
                            ],
                            "text": "unknown"
                        },
                        "desc": "Use `unknown` instead, this will force you to explicitly, and safely assert the type is correct."
                    },
                    {
                        "messageId": "suggestNever",
                        "fix": {
                            "range": [
                                316,
                                319
                            ],
                            "text": "never"
                        },
                        "desc": "Use `never` instead, this is useful when instantiating generic type parameters that you don't need to know the type of."
                    }
                ]
            },
            {
                "ruleId": "@typescript-eslint/no-empty-function",
                "severity": 2,
                "message": "Unexpected empty arrow function.",
                "line": 22,
                "column": 18,
                "nodeType": "ArrowFunctionExpression",
                "messageId": "unexpected",
                "endLine": 22,
                "endColumn": 20
            }
        ],
        "suppressedMessages": [],
        "errorCount": 2,
        "fatalErrorCount": 0,
        "warningCount": 0,
        "fixableErrorCount": 0,
        "fixableWarningCount": 0,
        "source": "...",
        "usedDeprecatedRules": []
    },
    {
        "filePath": "/builds/sti/templates/angular/components/core/app-initializer/initialize-permission-factory.ts",
        "messages": [
            {
                "ruleId": "@typescript-eslint/no-explicit-any",
                "severity": 2,
                "message": "Unexpected any. Specify a different type.",
                "line": 9,
                "column": 84,
                "nodeType": "TSAnyKeyword",
                "messageId": "unexpectedAny",
                "endLine": 9,
                "endColumn": 87,
                "suggestions": [
                    {
                        "messageId": "suggestUnknown",
                        "fix": {
                            "range": [
                                557,
                                560
                            ],
                            "text": "unknown"
                        },
                        "desc": "Use `unknown` instead, this will force you to explicitly, and safely assert the type is correct."
                    },
                    {
                        "messageId": "suggestNever",
                        "fix": {
                            "range": [
                                557,
                                560
                            ],
                            "text": "never"
                        },
                        "desc": "Use `never` instead, this is useful when instantiating generic type parameters that you don't need to know the type of."
                    }
                ]
            }
        ],
        "suppressedMessages": [],
        "errorCount": 1,
        "fatalErrorCount": 0,
        "warningCount": 0,
        "fixableErrorCount": 0,
        "fixableWarningCount": 0,
        "source": "...",
        "usedDeprecatedRules": []
    },
    {
        "filePath": "/builds/sti/templates/angular/components/core/app-initializer/initialize-static-resources-factory.ts",
        "messages": [],
        "suppressedMessages": [],
        "errorCount": 0,
        "fatalErrorCount": 0,
        "warningCount": 0,
        "fixableErrorCount": 0,
        "fixableWarningCount": 0,
        "usedDeprecatedRules": []
    },
    {
        "filePath": "/builds/sti/templates/angular/components/core/app-initializer/public-api.ts",
        "messages": [],
        "suppressedMessages": [],
        "errorCount": 0,
        "fatalErrorCount": 0,
        "warningCount": 0,
        "fixableErrorCount": 0,
        "fixableWarningCount": 0,
        "usedDeprecatedRules": []
    },
    {
        "filePath": "/builds/sti/templates/angular/components/core/config/configuration.service.ts",
        "messages": [
            {
                "ruleId": "eslint-comments/no-use",
                "severity": 1,
                "message": "Unexpected ESLint directive comment.",
                "line": 11,
                "column": 0,
                "nodeType": null,
                "endLine": 11,
                "endColumn": 56
            }
        ],
        "suppressedMessages": [
            {
                "ruleId": "@typescript-eslint/no-explicit-any",
                "severity": 2,
                "message": "Unexpected any. Specify a different type.",
                "line": 127,
                "column": 73,
                "nodeType": "TSAnyKeyword",
                "messageId": "unexpectedAny",
                "endLine": 127,
                "endColumn": 76,
                "suggestions": [
                    {
                        "messageId": "suggestUnknown",
                        "fix": {
                            "range": [
                                4628,
                                4631
                            ],
                            "text": "unknown"
                        },
                        "desc": "Use `unknown` instead, this will force you to explicitly, and safely assert the type is correct."
                    },
                    {
                        "messageId": "suggestNever",
                        "fix": {
                            "range": [
                                4628,
                                4631
                            ],
                            "text": "never"
                        },
                        "desc": "Use `never` instead, this is useful when instantiating generic type parameters that you don't need to know the type of."
                    }
                ],
                "suppressions": [
                    {
                        "kind": "directive",
                        "justification": ""
                    }
                ]
            },
            {
                "ruleId": "@typescript-eslint/no-explicit-any",
                "severity": 2,
                "message": "Unexpected any. Specify a different type.",
                "line": 140,
                "column": 76,
                "nodeType": "TSAnyKeyword",
                "messageId": "unexpectedAny",
                "endLine": 140,
                "endColumn": 79,
                "suggestions": [
                    {
                        "messageId": "suggestUnknown",
                        "fix": {
                            "range": [
                                5117,
                                5120
                            ],
                            "text": "unknown"
                        },
                        "desc": "Use `unknown` instead, this will force you to explicitly, and safely assert the type is correct."
                    },
                    {
                        "messageId": "suggestNever",
                        "fix": {
                            "range": [
                                5117,
                                5120
                            ],
                            "text": "never"
                        },
                        "desc": "Use `never` instead, this is useful when instantiating generic type parameters that you don't need to know the type of."
                    }
                ],
                "suppressions": [
                    {
                        "kind": "directive",
                        "justification": ""
                    }
                ]
            },
            {
                "ruleId": "@typescript-eslint/no-explicit-any",
                "severity": 2,
                "message": "Unexpected any. Specify a different type.",
                "line": 169,
                "column": 79,
                "nodeType": "TSAnyKeyword",
                "messageId": "unexpectedAny",
                "endLine": 169,
                "endColumn": 82,
                "suggestions": [
                    {
                        "messageId": "suggestUnknown",
                        "fix": {
                            "range": [
                                6031,
                                6034
                            ],
                            "text": "unknown"
                        },
                        "desc": "Use `unknown` instead, this will force you to explicitly, and safely assert the type is correct."
                    },
                    {
                        "messageId": "suggestNever",
                        "fix": {
                            "range": [
                                6031,
                                6034
                            ],
                            "text": "never"
                        },
                        "desc": "Use `never` instead, this is useful when instantiating generic type parameters that you don't need to know the type of."
                    }
                ],
                "suppressions": [
                    {
                        "kind": "directive",
                        "justification": ""
                    }
                ]
            },
            {
                "ruleId": "@typescript-eslint/no-explicit-any",
                "severity": 2,
                "message": "Unexpected any. Specify a different type.",
                "line": 182,
                "column": 82,
                "nodeType": "TSAnyKeyword",
                "messageId": "unexpectedAny",
                "endLine": 182,
                "endColumn": 85,
                "suggestions": [
                    {
                        "messageId": "suggestUnknown",
                        "fix": {
                            "range": [
                                6530,
                                6533
                            ],
                            "text": "unknown"
                        },
                        "desc": "Use `unknown` instead, this will force you to explicitly, and safely assert the type is correct."
                    },
                    {
                        "messageId": "suggestNever",
                        "fix": {
                            "range": [
                                6530,
                                6533
                            ],
                            "text": "never"
                        },
                        "desc": "Use `never` instead, this is useful when instantiating generic type parameters that you don't need to know the type of."
                    }
                ],
                "suppressions": [
                    {
                        "kind": "directive",
                        "justification": ""
                    }
                ]
            }
        ],
        "errorCount": 0,
        "fatalErrorCount": 0,
        "warningCount": 1,
        "fixableErrorCount": 0,
        "fixableWarningCount": 0,
        "source": "...",
        "usedDeprecatedRules": []
    },
    {
        "filePath": "/builds/sti/templates/angular/components/core/icons/icons.module.ts",
        "messages": [],
        "suppressedMessages": [],
        "errorCount": 0,
        "fatalErrorCount": 0,
        "warningCount": 0,
        "fixableErrorCount": 0,
        "fixableWarningCount": 0,
        "usedDeprecatedRules": []
    }
]
[
  {
    "filePath": "/builds/sti/templates/angular/components/types/geography.types.ts",
    "messages": [
      {
        "ruleId": "eslint-comments/no-use",
        "severity": 1,
        "message": "Unexpected ESLint directive comment.",
        "line": 1,
        "column": 0,
        "nodeType": null,
        "endLine": 1,
        "endColumn": 21
      },
      {
        "ruleId": "eslint-comments/no-unlimited-disable",
        "severity": 1,
        "message": "Unexpected unlimited 'eslint-disable' comment. Specify some rule names to disable.",
        "line": 1,
        "column": 0,
        "nodeType": null,
        "endLine": 1,
        "endColumn": 21
      }
    ],
    "suppressedMessages": [
      {
        "ruleId": "@typescript-eslint/ban-tslint-comment",
        "severity": 2,
        "message": "tslint comment detected: \"/* tslint:disable */\"",
        "line": 2,
        "column": 1,
        "nodeType": "Block",
        "messageId": "commentDetected",
        "endLine": 2,
        "endColumn": 21,
        "fix": {
          "range": [
            21,
            42
          ],
          "text": ""
        },
        "suppressions": [
          {
            "kind": "directive",
            "justification": ""
          }
        ]
      },
      {
        "ruleId": "@typescript-eslint/no-empty-interface",
        "severity": 2,
        "message": "An interface declaring no members is equivalent to its supertype.",
        "line": 48,
        "column": 18,
        "nodeType": "Identifier",
        "messageId": "noEmptyWithSuper",
        "endLine": 48,
        "endColumn": 30,
        "fix": {
          "range": [
            1113,
            1156
          ],
          "text": "type GUIDirection = Direction"
        },
        "suppressions": [
          {
            "kind": "directive",
            "justification": ""
          }
        ]
      },
      {
        "ruleId": "@typescript-eslint/no-empty-interface",
        "severity": 2,
        "message": "An interface declaring no members is equivalent to its supertype.",
        "line": 50,
        "column": 18,
        "nodeType": "Identifier",
        "messageId": "noEmptyWithSuper",
        "endLine": 50,
        "endColumn": 28,
        "fix": {
          "range": [
            1165,
            1204
          ],
          "text": "type GUISection = Section"
        },
        "suppressions": [
          {
            "kind": "directive",
            "justification": ""
          }
        ]
      },
      {
        "ruleId": "@typescript-eslint/no-empty-interface",
        "severity": 2,
        "message": "An interface declaring no members is equivalent to its supertype.",
        "line": 52,
        "column": 18,
        "nodeType": "Identifier",
        "messageId": "noEmptyWithSuper",
        "endLine": 52,
        "endColumn": 25,
        "fix": {
          "range": [
            1213,
            1246
          ],
          "text": "type GUILane = Lane"
        },
        "suppressions": [
          {
            "kind": "directive",
            "justification": ""
          }
        ]
      },
      {
        "ruleId": "@typescript-eslint/no-empty-interface",
        "severity": 2,
        "message": "An interface declaring no members is equivalent to its supertype.",
        "line": 64,
        "column": 18,
        "nodeType": "Identifier",
        "messageId": "noEmptyWithSuper",
        "endLine": 64,
        "endColumn": 31,
        "fix": {
          "range": [
            1426,
            1470
          ],
          "text": "type RoadComponent = GeoObject"
        },
        "suppressions": [
          {
            "kind": "directive",
            "justification": ""
          }
        ]
      }
    ],
    "errorCount": 0,
    "fatalErrorCount": 0,
    "warningCount": 2,
    "fixableErrorCount": 0,
    "fixableWarningCount": 0,
    "source": "...",
    "usedDeprecatedRules": []
  }
]

Steps I have taken:

  1. Checked ESLint Reports: The ESLint reports generated seem to have valid line and column numbers.
  2. Validated ESLint Output: Ran ESLint manually and the output did not show any anomalies.
  3. Reviewed Integration Configurations: Verified the SonarQube project configurations for ESLint integration.
  4. Debug Logging: Re-ran the SonarScanner with the -X switch but could not pinpoint the exact issue.

Additional Details:

  • SonarQube Version: 10.5.1
  • SonarQube Scanner Version: sonar-scanner-cli:5.0
  • ESLint Version: 8.56.0
  • GitLab version: 16.11.0

I would greatly appreciate any insights or suggestions on how to resolve this issue. Has anyone encountered a similar problem or can anyone point me in the right direction?

Thank you in advance for your help!

[UPDATE] The error appears to be caused by certain ESLint warnings that don’t map correctly to line numbers in the code. I managed to resolve this issue by generating the ESLint report using the --quiet argument. This argument suppresses warnings, which might be causing the invalid line offset error.

npx eslint --quiet $CHANGED_FILES -f json -o eslint_report.json

@ganncamp Hello! I am curious about the underlying reason for this behavior. Could you please explain why SonarQube encounters issues when processing warnings from ESLint reports? Is there a specific reason or known limitation that causes the invalid line offset error?

Hi Samuele,

Thanks a lot for sharing your findings!

Would you be willing to share a sample of the JSON report with and without warnings?

This might help us handle this case without you needing to set the --silent argument and help other users in the future!

Hi Gabriel. here are (source code section is hidden for brevity and privacy) :

  • Without --quiet argument:
[
  {
    "filePath": "/builds/sti/templates/angular/components/@fuse/services/utils/public-api.ts",
    "messages": [
      {
        "ruleId": null,
        "fatal": false,
        "severity": 1,
        "message": "File ignored because of a matching ignore pattern. Use \"--no-ignore\" to override.",
        "nodeType": null
      }
    ],
    "suppressedMessages": [],
    "errorCount": 0,
    "fatalErrorCount": 0,
    "warningCount": 1,
    "fixableErrorCount": 0,
    "fixableWarningCount": 0,
    "usedDeprecatedRules": []
  },
  {
    "filePath": "/builds/sti/templates/angular/components/pages/enterprises/enterprises.component.html",
    "messages": [],
    "suppressedMessages": [],
    "errorCount": 0,
    "fatalErrorCount": 0,
    "warningCount": 0,
    "fixableErrorCount": 0,
    "fixableWarningCount": 0,
    "usedDeprecatedRules": []
  },
  {
    "filePath": "/builds/sti/templates/angular/components/pages/enterprises/enterprises.component.ts",
    "messages": [],
    "suppressedMessages": [],
    "errorCount": 0,
    "fatalErrorCount": 0,
    "warningCount": 0,
    "fixableErrorCount": 0,
    "fixableWarningCount": 0,
    "usedDeprecatedRules": []
  },
  {
    "filePath": "/builds/sti/templates/angular/components/pages/enterprises/enterprises.types.ts",
    "messages": [
      {
        "ruleId": "@typescript-eslint/consistent-indexed-object-style",
        "severity": 2,
        "message": "A record is preferred over an index signature.",
        "line": 69,
        "column": 15,
        "nodeType": "TSTypeLiteral",
        "messageId": "preferRecord",
        "endLine": 69,
        "endColumn": 45,
        "fix": {
          "range": [
            1977,
            2007
          ],
          "text": "Record<string, SortOrder>"
        }
      }
    ],
    "suppressedMessages": [],
    "errorCount": 1,
    "fatalErrorCount": 0,
    "warningCount": 0,
    "fixableErrorCount": 1,
    "fixableWarningCount": 0,
    "source": "...",
    "usedDeprecatedRules": []
  },
  {
    "filePath": "/builds/sti/templates/angular/components/utils/base-page-v3.component.ts",
    "messages": [
      {
        "ruleId": "eslint-comments/no-use",
        "severity": 1,
        "message": "Unexpected ESLint directive comment.",
        "line": 11,
        "column": 0,
        "nodeType": null,
        "endLine": 11,
        "endColumn": 53
      },
      {
        "ruleId": "eslint-comments/no-use",
        "severity": 1,
        "message": "Unexpected ESLint directive comment.",
        "line": 47,
        "column": 0,
        "nodeType": null,
        "endLine": 47,
        "endColumn": 71
      },
      {
        "ruleId": "eslint-comments/no-use",
        "severity": 1,
        "message": "Unexpected ESLint directive comment.",
        "line": 61,
        "column": 0,
        "nodeType": null,
        "endLine": 61,
        "endColumn": 67
      },
      {
        "ruleId": "eslint-comments/no-use",
        "severity": 1,
        "message": "Unexpected ESLint directive comment.",
        "line": 119,
        "column": 0,
        "nodeType": null,
        "endLine": 119,
        "endColumn": 67
      },
      {
        "ruleId": "eslint-comments/no-use",
        "severity": 1,
        "message": "Unexpected ESLint directive comment.",
        "line": 131,
        "column": 0,
        "nodeType": null,
        "endLine": 131,
        "endColumn": 52
      },
      {
        "ruleId": "eslint-comments/no-use",
        "severity": 1,
        "message": "Unexpected ESLint directive comment.",
        "line": 158,
        "column": 0,
        "nodeType": null,
        "endLine": 158,
        "endColumn": 67
      },
      {
        "ruleId": "eslint-comments/no-use",
        "severity": 1,
        "message": "Unexpected ESLint directive comment.",
        "line": 167,
        "column": 0,
        "nodeType": null,
        "endLine": 167,
        "endColumn": 52
      }
    ],
    "suppressedMessages": [
      {
        "ruleId": "@typescript-eslint/no-explicit-any",
        "severity": 2,
        "message": "Unexpected any. Specify a different type.",
        "line": 48,
        "column": 51,
        "nodeType": "TSAnyKeyword",
        "messageId": "unexpectedAny",
        "endLine": 48,
        "endColumn": 54,
        "suggestions": [
          {
            "messageId": "suggestUnknown",
            "fix": {
              "range": [
                2002,
                2005
              ],
              "text": "unknown"
            },
            "desc": "Use `unknown` instead, this will force you to explicitly, and safely assert the type is correct."
          },
          {
            "messageId": "suggestNever",
            "fix": {
              "range": [
                2002,
                2005
              ],
              "text": "never"
            },
            "desc": "Use `never` instead, this is useful when instantiating generic type parameters that you don't need to know the type of."
          }
        ],
        "suppressions": [
          {
            "kind": "directive",
            "justification": ""
          }
        ]
      },
      {
        "ruleId": "@typescript-eslint/no-explicit-any",
        "severity": 2,
        "message": "Unexpected any. Specify a different type.",
        "line": 62,
        "column": 51,
        "nodeType": "TSAnyKeyword",
        "messageId": "unexpectedAny",
        "endLine": 62,
        "endColumn": 54,
        "suggestions": [
          {
            "messageId": "suggestUnknown",
            "fix": {
              "range": [
                2449,
                2452
              ],
              "text": "unknown"
            },
            "desc": "Use `unknown` instead, this will force you to explicitly, and safely assert the type is correct."
          },
          {
            "messageId": "suggestNever",
            "fix": {
              "range": [
                2449,
                2452
              ],
              "text": "never"
            },
            "desc": "Use `never` instead, this is useful when instantiating generic type parameters that you don't need to know the type of."
          }
        ],
        "suppressions": [
          {
            "kind": "directive",
            "justification": ""
          }
        ]
      },
      {
        "ruleId": "@typescript-eslint/no-explicit-any",
        "severity": 2,
        "message": "Unexpected any. Specify a different type.",
        "line": 120,
        "column": 32,
        "nodeType": "TSAnyKeyword",
        "messageId": "unexpectedAny",
        "endLine": 120,
        "endColumn": 35,
        "suggestions": [
          {
            "messageId": "suggestUnknown",
            "fix": {
              "range": [
                4508,
                4511
              ],
              "text": "unknown"
            },
            "desc": "Use `unknown` instead, this will force you to explicitly, and safely assert the type is correct."
          },
          {
            "messageId": "suggestNever",
            "fix": {
              "range": [
                4508,
                4511
              ],
              "text": "never"
            },
            "desc": "Use `never` instead, this is useful when instantiating generic type parameters that you don't need to know the type of."
          }
        ],
        "suppressions": [
          {
            "kind": "directive",
            "justification": ""
          }
        ]
      },
      {
        "ruleId": "@typescript-eslint/dot-notation",
        "severity": 2,
        "message": "[\"id\"] is better written in dot notation.",
        "line": 125,
        "column": 77,
        "nodeType": "Literal",
        "messageId": "useDot",
        "endLine": 125,
        "endColumn": 81,
        "fix": {
          "range": [
            4766,
            4772
          ],
          "text": ".id"
        },
        "suppressions": [
          {
            "kind": "directive",
            "justification": ""
          }
        ]
      },
      {
        "ruleId": "@typescript-eslint/dot-notation",
        "severity": 2,
        "message": "[\"id\"] is better written in dot notation.",
        "line": 125,
        "column": 98,
        "nodeType": "Literal",
        "messageId": "useDot",
        "endLine": 125,
        "endColumn": 102,
        "fix": {
          "range": [
            4787,
            4793
          ],
          "text": ".id"
        },
        "suppressions": [
          {
            "kind": "directive",
            "justification": ""
          }
        ]
      },
      {
        "ruleId": "@typescript-eslint/dot-notation",
        "severity": 2,
        "message": "[\"_id\"] is better written in dot notation.",
        "line": 127,
        "column": 77,
        "nodeType": "Literal",
        "messageId": "useDot",
        "endLine": 127,
        "endColumn": 82,
        "fix": {
          "range": [
            4917,
            4924
          ],
          "text": "._id"
        },
        "suppressions": [
          {
            "kind": "directive",
            "justification": ""
          }
        ]
      },
      {
        "ruleId": "@typescript-eslint/dot-notation",
        "severity": 2,
        "message": "[\"_id\"] is better written in dot notation.",
        "line": 127,
        "column": 99,
        "nodeType": "Literal",
        "messageId": "useDot",
        "endLine": 127,
        "endColumn": 104,
        "fix": {
          "range": [
            4939,
            4946
          ],
          "text": "._id"
        },
        "suppressions": [
          {
            "kind": "directive",
            "justification": ""
          }
        ]
      },
      {
        "ruleId": "@typescript-eslint/no-explicit-any",
        "severity": 2,
        "message": "Unexpected any. Specify a different type.",
        "line": 159,
        "column": 36,
        "nodeType": "TSAnyKeyword",
        "messageId": "unexpectedAny",
        "endLine": 159,
        "endColumn": 39,
        "suggestions": [
          {
            "messageId": "suggestUnknown",
            "fix": {
              "range": [
                6140,
                6143
              ],
              "text": "unknown"
            },
            "desc": "Use `unknown` instead, this will force you to explicitly, and safely assert the type is correct."
          },
          {
            "messageId": "suggestNever",
            "fix": {
              "range": [
                6140,
                6143
              ],
              "text": "never"
            },
            "desc": "Use `never` instead, this is useful when instantiating generic type parameters that you don't need to know the type of."
          }
        ],
        "suppressions": [
          {
            "kind": "directive",
            "justification": ""
          }
        ]
      }
    ],
    "errorCount": 0,
    "fatalErrorCount": 0,
    "warningCount": 7,
    "fixableErrorCount": 0,
    "fixableWarningCount": 0,
    "source": "...",
    "usedDeprecatedRules": []
  }
]
  • With --quiet argument:
[
  {
    "filePath": "/builds/sti/templates/angular/components/pages/enterprises/enterprises.types.ts",
    "messages": [
      {
        "ruleId": "@typescript-eslint/consistent-indexed-object-style",
        "severity": 2,
        "message": "A record is preferred over an index signature.",
        "line": 69,
        "column": 15,
        "nodeType": "TSTypeLiteral",
        "messageId": "preferRecord",
        "endLine": 69,
        "endColumn": 45,
        "fix": {
          "range": [
            1977,
            2007
          ],
          "text": "Record<string, SortOrder>"
        }
      }
    ],
    "suppressedMessages": [],
    "errorCount": 1,
    "fatalErrorCount": 0,
    "warningCount": 0,
    "fixableErrorCount": 1,
    "fixableWarningCount": 0,
    "source": "...",
    "usedDeprecatedRules": []
  }
]
1 Like

That’s great Samuele! Thanks a lot for sharing!

@samuele-ruffino96 , thanks a lot for the valuable information that you shared: they will greatly help us identify and fix the issue.

We created a ticket to track the investigation and the fix: [JS-227] - Jira

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.