Parsing error on valid JS code

Lift could not parse the following code:

var publishCmd = `
git tag -a -f \${nextRelease.version} \${nextRelease.version} -F CHANGELOG.md
git push --force origin \${nextRelease.version}
./gradlew shadowJar --parallel || ./gradlew shadowJar --parallel || exit 1
./gradlew releaseKotlinMavenOnMavenCentralNexus --parallel || exit 2
./gradlew orchidDeploy || ./gradlew orchidDeploy || exit 3
./gradlew publishKotlinMavenPublicationToGithubRepository --continue || true
`
var config = require('semantic-release-preconfigured-conventional-commits');
config.plugins.push(
    ["@semantic-release/exec", {
        "publishCmd": publishCmd,
    }],
    ["@semantic-release/github", {
        "assets": [ 
            { "path": "build/shadow/*-all.jar" },
         ]
    }],
    "@semantic-release/git",
)

Which, however, is syntactically valid (and works as expected). Here is the comment:

Danilo,
In this case the ESLint tool is ran and alerts that the trailing comma (after semantic-release/git) isn’t parsable. We’ve previously discussed removing these syntax and parse errors from reporting and I’ll revisit that now, especially in light of this syntax being legal ECMAScript.

@danysk It appears the decision was already made before this conversation. We won’t be reporting these issues after the next deployment. While I don’t know when that is for sure, we usually deploy every week so it should happen soon.

2 Likes

Lovely, thanks