Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
frostplexx authored Jun 6, 2024
1 parent 276e034 commit d8adcad
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,20 @@ require("lint").linters_by_ft = require("mason-bridge").get_linters()
-- ...
```

## Have Tools Register for Every Filetype

Some tools like for example `codespell` do not have a language specified because they are to be used on every filetype / language.
`mason-bridge` returns these tools with a `*` as the placeholder for the language.
To correctly register correctly in nvim-lint you need to modify your `nvim-lint` config like this:
```lua
local names = lint._resolve_linter_by_ft(vim.bo.filetype)
names = vim.list_extend({}, names)
vim.list_extend(names, lint.linters_by_ft["*"] or {})

-- try_lint() can be called in an autocommand as described in the nvim-lint README
lint.try_lint(names)
```

Refer to the [Configuration](#configuration) section for information about which settings are available.

# Configuration
Expand Down

0 comments on commit d8adcad

Please sign in to comment.