Skip to content

Can't lint files with square brackets in the name #11940

@staab

Description

@staab

Tell us about your environment

MacOS 10.14.5 (18F132)
zsh 5.3 (x86_64-apple-darwin18.0)

  • ESLint Version: v6.0.1
  • Node Version: v8.15.0
  • npm Version: 6.9.0

What parser (default, Babel-ESLint, etc.) are you using?
default

Please show your full configuration:

Configuration
module.exports = {
  "env": {
    "browser": true,
    "node": true,
    "es6": true,
  },
  "extends": [
    "eslint:recommended",
    "plugin:prettier/recommended",
  ],
  "globals": {
    "Atomics": "readonly",
    "SharedArrayBuffer": "readonly",
  },
  "parserOptions": {
    "ecmaVersion": 2018,
    "sourceType": "module",
  },
  "rules": {
    "no-unused-vars": ["error", {args: "none"}],
  },
}

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

No source, the bug happens even if the file is empty.

$ cat src/routes/blog/\[slug\].svelte
console.log('x',)
$ npx eslint src/routes/blog/\[slug\].svelte
No files matching 'src/routes/blog/[slug].svelte' were found.
$ npx eslint src/routes/blog/[slug].svelte
No files matching 'src/routes/blog/[slug].svelte' were found.
$ npx eslint src/routes/blog/\\[slug\\].svelte
No files matching 'src/routes/blog/\[slug\].svelte' were found.

What did you expect to happen?

That eslint would lint the file.

What actually happened? Please include the actual, raw output from ESLint.

Eslint was unable to find the file.

Are you willing to submit a pull request to fix this bug?

I could give it a shot, but I'm probably not the best person to solve it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionbugESLint is working incorrectlycoreRelates to ESLint's core APIs and features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions