-
-
Notifications
You must be signed in to change notification settings - Fork 302
feat(pack): add prettier pack #1502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
567917b
feat(pack): add prettier pack
azdanov 2a2a1ec
Merge branch 'main' into add-prettier
azdanov a33100b
add additional filetypes and config files
azdanov b78bc82
use prettier instead of prettierd
azdanov b008083
Revert using prettier instead of prettierd
azdanov 3b03f24
Merge branch 'main' into add-prettier
azdanov 3696dcb
inline variables
azdanov c524bff
remove cache variables
azdanov 83e5d15
early return if prettier found
azdanov 7c13e1c
simplify config
azdanov ffb1efe
Merge branch 'main' into add-prettier
azdanov ebc2a02
Merge branch 'main' into add-prettier
Uzaaft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Prettier | ||
|
||
[Prettier](https://prettier.io/) is an opinionated code formatter with support for: | ||
|
||
JavaScript · TypeScript · Flow · JSX · JSON | ||
azdanov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
CSS · SCSS · Less | ||
HTML · Vue · Angular | ||
GraphQL · Markdown · YAML | ||
[Your favorite language?](https://prettier.io/docs/plugins) | ||
|
||
It enforces a consistent style by parsing your code and re-printing it with its own rules that take the maximum line length into account, wrapping code when necessary. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
---@type LazySpec | ||
return { | ||
{ | ||
"jay-babu/mason-null-ls.nvim", | ||
optional = true, | ||
opts = function(_, opts) | ||
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed or {}, { "prettierd" }) | ||
end, | ||
}, | ||
{ | ||
"stevearc/conform.nvim", | ||
optional = true, | ||
opts = function(_, opts) | ||
if not opts.formatters_by_ft then opts.formatters_by_ft = {} end | ||
for _, filetype in ipairs { | ||
"javascript", | ||
"javascriptreact", | ||
"typescript", | ||
"typescriptreact", | ||
"vue", | ||
"css", | ||
"scss", | ||
"less", | ||
"html", | ||
"json", | ||
"jsonc", | ||
"yaml", | ||
"markdown", | ||
"markdown.mdx", | ||
"graphql", | ||
"handlebars", | ||
"svelte", | ||
"astro", | ||
"htmlangular", | ||
} do | ||
opts.formatters_by_ft[filetype] = { "prettierd" } | ||
end | ||
end, | ||
}, | ||
{ | ||
"WhoIsSethDaniel/mason-tool-installer.nvim", | ||
optional = true, | ||
opts = function(_, opts) | ||
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed or {}, { "prettierd" }) | ||
end, | ||
}, | ||
{ | ||
"echasnovski/mini.icons", | ||
optional = true, | ||
opts = function(_, opts) | ||
if not opts.file then opts.file = {} end | ||
for _, filename in ipairs { | ||
".prettierrc", | ||
".prettierrc.cjs", | ||
".prettierrc.cts", | ||
".prettierrc.js", | ||
".prettierrc.json", | ||
".prettierrc.json5", | ||
".prettierrc.mjs", | ||
".prettierrc.mts", | ||
".prettierrc.toml", | ||
".prettierrc.ts", | ||
".prettierrc.yaml", | ||
".prettierrc.yml", | ||
"prettier.config.cjs", | ||
"prettier.config.js", | ||
"prettier.config.mjs", | ||
"prettier.config.mts", | ||
"prettier.config.ts", | ||
} do | ||
opts.file[filename] = { glyph = "", hl = "MiniIconsPurple" } | ||
end | ||
end, | ||
}, | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.