Skip to content

An error on astro#CollectPathsFromConfigΒ #9

@ghost

Description

Every time I open an astro file in Nvim with this plugin, I get an error below.

Error opening file: vim/_editor.lua:0: nvim_exec2()..BufReadPost Autocommands for "*.astro"..FileType Autocommands for "*"..function <SNR>1_LoadFTPlugin[19]..script /Users/(my computer name)/.local/share/nvim/lazy/vim-astro/ftplugin/astro.vim[83]..function astro#CollectPathsFromConfig, line 9: Vim(let):E474: Trailing comma: },   }, }

I guess something is going wrong on this line, but I have no idea what to do to fix the error without fixing my tsconfig.json file.

That error happens when my tsconfig.json has to trail commas like this.

{
  "extends": "astro/tsconfigs/strictest",
  "compilerOptions": {
    "paths": {
      "@components/*": ["./src/components/*"],
      "@layouts/*": ["./src/layouts/*"],
    },
  },
}

The reason why I do not want to modify my tsconfig.json is that I do not actually want my prettier or eslint to remove those trailing commas; it is my project's style to do those.

Do you have any solutions for this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions