Skip to content

Commit

Permalink
chore: release 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Canciller committed Mar 8, 2024
1 parent 098e288 commit 35a3cab
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,12 @@ Run `npx tsc --noEmit --pretty false` using `:Typecheck` command and show the re
},
}
```

## Options

```lua
{
command = 'Typecheck',
}
```

16 changes: 14 additions & 2 deletions lua/typescript-type-checker.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
---@class Config
---@field command string
local config = {
command = "Typecheck",
}

---@class TypescriptTypeChecker
local M = {}

---@type Config
M.config = config

M.run = function()
local tsc_command = "npx tsc --noEmit --pretty false"
local issues_found = false -- Track whether any issues were found
Expand Down Expand Up @@ -57,8 +66,11 @@ M.run = function()
})
end

M.setup = function()
vim.api.nvim_create_user_command("Typecheck", function()
---@param args Config?
M.setup = function(args)
M.config = vim.tbl_deep_extend("force", M.config, args or {})

vim.api.nvim_create_user_command(M.config.command, function()
M.run()
end, {
force = true,
Expand Down

0 comments on commit 35a3cab

Please sign in to comment.