tamayika / vscode-any-lint

VSCode Any Lint allows you to lint any files with any command line tools
Other
4 stars 2 forks source link

Ignore location : currentLine wrapped? #18

Closed mgzenitech closed 1 month ago

mgzenitech commented 1 month ago

Screenshot from 2024-07-17 17-03-44

Trying now to add ignore lines :)

Based on info @ https://dotenv-linter.github.io/#/usage/check?id=skip-checks

dotenv-linter has to wrap the line with comments before and after:

# dotenv-linter:off UnorderedKey
FOO=BAR
# dotenv-linter:on UnorderedKey

Right now I can only disable it for either whole file or any line below this one:

          {
            "comment": "`# dotenv-linter:off ${$$.ruleId}`",
            "location": "previousLine",
            "title": "`Ignore ${$$.ruleId} rule for entire file`",
            "type": "ignore"
          }

Maybe we could have something like:

"location": "currentLine",
"comment": "`# dotenv-linter:off ${$$.ruleId}\n${currentLine}\n# dotenv-linter:on ${$$.ruleId}`"

? If the currentLine would be exposed as variable we could just prepend and append those lines directly. What do you think?

Or even better way would be to have new location: wrapCurrentLine or something similar

"location": "wrapCurrentLine",
"comment": [
    "`# dotenv-linter:off ${$$.ruleId}`",
    "`# dotenv-linter:on ${$$.ruleId}`"
]
tamayika commented 1 month ago

I added rewriteLine location and released 0.3.3. Please check documentation.