Skip to content

Commit 8ae3804

Browse files
azdanovUzaaft
andauthored
feat(pack): add eslint (#1503)
* feat(pack): add eslint * Update lua/astrocommunity/pack/eslint/README.md Co-authored-by: Uzair Aftab <[email protected]> * Update README.md --------- Co-authored-by: Uzair Aftab <[email protected]>
1 parent 2f550c0 commit 8ae3804

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# ESLint
2+
3+
[ESLint](https://eslint.org/) statically analyzes your code to quickly find problems. It is built into most text editors and you can run ESLint as part of your continuous integration pipeline.
4+
5+
## Prerequisites
6+
7+
To use ESLint, you must have [Node.js](https://nodejs.org/en/) LTS installed
8+
and built with SSL support. (If you are using an official Node.js distribution, SSL is always built in.)
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---@type LazySpec
2+
return {
3+
{
4+
"williamboman/mason-lspconfig.nvim",
5+
optional = true,
6+
opts = function(_, opts)
7+
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed or {}, { "eslint" })
8+
end,
9+
},
10+
{
11+
"WhoIsSethDaniel/mason-tool-installer.nvim",
12+
optional = true,
13+
opts = function(_, opts)
14+
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed or {}, { "eslint-lsp" })
15+
end,
16+
},
17+
{
18+
"echasnovski/mini.icons",
19+
optional = true,
20+
opts = function(_, opts)
21+
opts.file = opts.file or {}
22+
local eslint_files = {
23+
-- ESLint <=8 (Deprecated)
24+
".eslintignore",
25+
".eslintrc",
26+
".eslintrc.cjs",
27+
".eslintrc.js",
28+
".eslintrc.json",
29+
".eslintrc.yaml",
30+
".eslintrc.yml",
31+
-- ESLint >=9
32+
"eslint.config.cjs",
33+
"eslint.config.cts",
34+
"eslint.config.js",
35+
"eslint.config.mjs",
36+
"eslint.config.mts",
37+
"eslint.config.ts",
38+
}
39+
for _, filename in ipairs(eslint_files) do
40+
opts.file[filename] = { glyph = "󰱺", hl = "MiniIconsYellow" }
41+
end
42+
end,
43+
},
44+
}

0 commit comments

Comments
 (0)