Add alternate files for .stories.ts and .tsx files
This commit is contained in:
parent
ce005be887
commit
8ad59444c7
1 changed files with 12 additions and 0 deletions
|
@ -36,6 +36,18 @@
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
add_rule("ts", function(filename)
|
||||||
|
return filename:gsub("%.stories.ts$", ".tsx")
|
||||||
|
end)
|
||||||
|
|
||||||
|
add_rule("tsx", function(filename)
|
||||||
|
if filename:find("%.stories.tsx$") then
|
||||||
|
return filename:gsub("%.stories.tsx$", ".tsx")
|
||||||
|
end
|
||||||
|
|
||||||
|
return filename:gsub("%.tsx$", ".stories.tsx")
|
||||||
|
end)
|
||||||
|
|
||||||
if vim.fn.filereadable "composer.json" == 1 then
|
if vim.fn.filereadable "composer.json" == 1 then
|
||||||
add_rule("json", function(filename)
|
add_rule("json", function(filename)
|
||||||
return filename:find "composer.json" and filename:gsub("%.json$", ".lock") or nil
|
return filename:find "composer.json" and filename:gsub("%.json$", ".lock") or nil
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue