Skip to content

Commit

Permalink
feat: add pylint and typescript (@ts-ignore)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgrieser committed Sep 21, 2023
1 parent 09e758f commit 0f7c3d2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,17 @@ Most LSPs provide code actions for to do that – this plugin adds commands for
- Requires diagnostics provided by a source that supports neovim's builtin diagnostics system (`vim.diagnostic`). nvim's builtin LSP client and [nvim-lint](https://github.com/mfussenegger/nvim-lint) are such sources.

## Supported Linters for adding ignore-comments
<!-- list-of-supported-linters start -->
<!-- AUTO-GENERATED – DO NOT CHANGE -->
<!-- supported-linters start -->
- selene
- shellcheck
- vale
- yamllint
- stylelint
- LTeX
<!-- list-of-supported-linters end -->
- typescript
- pylint
<!-- supported-linters end -->

You easily add a custom via the [plugin configuration](#configuration). However, please consider making a PR to add support for a linter if it is missing.

Expand Down
15 changes: 12 additions & 3 deletions lua/rule-breaker/ignoreRuleData.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---@class ruleIgnoreConfig
---@field comment string|string[] with %s for the rule id
---@field location "sameLine"|"prevLine"|"encloseLine"
---@field docs string
---@field docs? string url to documentation elaborating how ignore comments work for the linter

-- INFO "encloseLine" is a list with two strings, one to be inserted before and
-- one to be inserted after. (prevLine or sameLine comments are obviously
Expand Down Expand Up @@ -30,8 +30,6 @@ local data = {
docs = "https://stylelint.io/user-guide/ignore-code/",
},
LTeX = {
-- ltex does not allow disabling individual rules, so it has to be
-- enabled/disables completely
comment = { "<!-- LTeX: enabled=false -->", "<!-- LTeX: enabled=true -->" },
location = "encloseLine",
docs = "https://valentjn.github.io/ltex/advanced-usage.html",
Expand All @@ -41,6 +39,17 @@ local data = {
location = "encloseLine",
docs = "https://vale.sh/docs/topics/config/#markup-based-configuration",
},
pylint ={
comment = "# pylint: disable=%s",
location = "sameLine",
docs = "https://pylint.readthedocs.io/en/latest/user_guide/messages/message_control.html",
},
-- tsserver
typescript = {
comment = "// @ts-ignore",
location = "prevLine",
docs = "https://www.typescriptlang.org/", -- no docs found that are more specific
},
}

--------------------------------------------------------------------------------
Expand Down

0 comments on commit 0f7c3d2

Please sign in to comment.