Skip to content
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

feat(typescript): biome pack #1006

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

willparsons
Copy link

@willparsons willparsons commented May 29, 2024

Closes #962

TODO

  • Disable prettierd only if biome is running and should be the formatter
  • Support null-ls and conform

📑 Description

  • Added biome pack: pack.typescript-biome.
  • Pulled out shared config into pack.typescript.core.
  • Updated README

ℹ Additional Information

I pulled out the core of the typescript pack so that the eslint+prettier and biome configuration can be separated easily. The default for pack.typescript hasn't changed.

Copy link

Review Checklist

Does this PR follow the [Contribution Guidelines](development guidelines)? Following is a partial checklist:

Proper conventional commit scoping:

  • If you are adding a new plugin, the scope would be the name of the category it is being added into. ex. feat(utility): added noice.nvim plugin

  • If you are modifying a pre-existing plugin or pack, the scope would be the name of the plugin folder. ex. fix(noice-nvim): fix LSP handler error

  • Pull request title has the appropriate conventional commit type and scope where the scope is the name of the pre-existing directory in the project as described above

  • README is properly formatted and uses fenced in links with <url> unless they are inside a [title](url)

  • Proper usage of opts table rather than setting things up with the config function.

opts = function(_, opts)
if not opts.handlers then opts.handlers = {} end

if not has_biome() then return end
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really happy about this. I tried to use get_clients to just check if biome is attached, but in this case it didn't seem feasible because the lsp is attaching after this config is running.


-- TODO: prettier should be off for all filetypes that biome supports,
-- currently this is { "javascript", "javascriptreact", "typescript", "typescriptreact", "json" }
opts.handlers.prettierd = function() end
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know much about configuring null-ls, how would you do this?

The reason for wanting to do this is that prettierd will attach to json files even though biome is running and should be the primary formatter, but for markdown it should still be prettier.

@willparsons
Copy link
Author

just found this for picking the formatter dynamically: LazyVim/LazyVim#2116 (comment)

will look into it

@Uzaaft
Copy link
Member

Uzaaft commented May 29, 2024

I think at this point it should just be typescript-biome and not like this.

@Uzaaft
Copy link
Member

Uzaaft commented May 29, 2024

I.e pack/typescript-biome

@willparsons
Copy link
Author

updated the structure 👍🏻

@willparsons willparsons changed the title WIP: feat(typescript): biome pack feat(typescript): biome pack May 29, 2024
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be reverted

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aren't we going to end up having to copy the config around though?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be reverted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Typescript pack] support biome for linter and formatter
2 participants