Skip to content

Commit

Permalink
fix: biome ignore comment in css files
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgrieser committed Jun 12, 2024
1 parent baff4b3 commit c276cc5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lua/rulebook/data/add-ignore-comment.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---@class ruleIgnoreConfig
---@field comment string|string[]|function if string, "%s" will be replaced with the rule id
---@field comment string|string[]|fun(vim.Diagnostic): string if string, "%s" will be replaced with the rule id
---@field location "prevLine"|"sameLine"|"encloseLine" "encloseLine" is a list with two strings, one to be inserted before and one after
---@field docs string used for auto-generated docs
---@field doesNotUseCodes? boolean the linter does not use codes/rule-ids
Expand Down Expand Up @@ -65,7 +65,11 @@ M = {
docs = "https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1",
},
biome = {
comment = "// biome-ignore %s: <explanation>",
-- biome works for css and js, so the comment syntax is dependent on the filetype
comment = function(diag)
local ignoreText = ("biome-ignore %s: <explanation>"):format(diag.code)
return vim.bo.commentstring:format(ignoreText)
end,
location = "prevLine",
docs = "https://biomejs.dev/linter/#ignoring-code",
},
Expand Down

0 comments on commit c276cc5

Please sign in to comment.