Skip to content

when I use lint-staged, it test my cac which is in the node_modules #1478

Closed as not planned
@Moqizhongyuan

Description

Description

I used lint-staged to check the code in my staging area, but logically, my node_modules folder should be ignored by my .gitignore file. However, I still encountered linting errors from a third-party dependency.

Steps to reproduce

pnpm i cac -S
npx --no -- lint-staged
"lint-staged": {
    "**/*.{js,jsx,tsx,ts}": [
      "npm run lint"
    ]
  },

Debug Logs

This is the JSON file that has been checked for errors.
"lint-staged": {
    "linters": {
      "*.{js,json,ts}": [
        "prettier --write",
        "git add"
      ],
      "*.md": [
        "markdown-toc -i",
        "prettier --write",
        "git add"
      ]
    },
    "ignore": [
      "dist/**",
      "mod.js"
    ]
  },
✖ Validation Error:

  Invalid value for 'ignore': [ 'dist/**', 'mod.js' ]

  Advanced configuration has been deprecated. Failed to parse config from file "/Users/zhongyuanyu/Desktop/cli/island-ssg/node_modules/.pnpm/[email protected]/node_modules/cac/package.json".

Environment

  • OS: macOS Sonoma
  • Node.js: v20.17.0
  • lint-staged: ^15.2.10

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions