vscode-standard: File names with brackets are ignored

What version of this package are you using? v1.5.0

What operating system, Node.js, and npm version? Windows 10 v15.11.0 7.6.0

What happened? When working with files that include special characters like brackets, the extension explicitly ignores them, for some reason For example, epicTextFile.js would be registered, but [epicTextFile].js would not.

What did you expect to happen? The extension should treat all files the same and lint them regardless of special characters

Are you willing to submit a pull request to fix this bug? I don’t understand TypeScript / this codebase enough to be very helpful but sure

These are my extension settings

  // StandardJS
  "javascript.validate.enable": false,
  "typescript.validate.enable": false,
  "standard.enable": true,
  "standard.usePackageJson": true,
  "standard.autoFixOnSave": true,
  "standard.validate": [
    "javascript",
    "javascriptreact",
    "typescript",
    "typescriptreact"
  ],

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (13 by maintainers)

Most upvoted comments

This still persists to this day. Specifically a next.js project, will always fail if the file has brackets, double brackets, or the folder name has brackets.

Hello @Divlo happy to hear that!

In the meanwhile I built it my own .vsix and seems to work fine. I will wait the official VSCode marketplace publish to install the version 2.1.1 😃

Thank you so much @Divlo. Maybe this will help you, I think is also related with the eslint issue: https://github.com/microsoft/vscode-eslint/issues/977

Anything that I can help you with just let me know!

Excuse me for the late reply @josegutierro! Thanks for your investigation, indeed I just tried to reproduce the issue again and your examples are correct. 👍 It doesn’t work when a bracket file is inside a bracket folder, but if it’s only the folder or only the filename with brackets it works.

I reopened the issue as this is a confirmed bug, sorry if we closed it even if it wasn’t completely fixed, we closed it because we didn’t know how to reproduce the issue.

Concerning the fix, I will try when I have some time to fix it, but we always accept PRs and welcome new contributors. 😄 Maybe this commit can help to fix the issue: https://github.com/standard/vscode-standard/commit/6f17ebb609f41faca0d30d2190672f1c4f7915d7

Hello,

In my case the problem exists when a bracket file is inside a bracket folder, for example:

/pages/[id].js -> It works /pages/blog/[id].js -> Also it works /pages/[blogId]/[id].js -> It does not work

I stumbled across the same issue when using the extension while working on a Next.js project.

Here are two screenshots displaying the error: image image

What version of this package are you using? v1.5.1

What operating system, Node.js, and yarn version? Windows 10 v15.0.1 1.22.4