2

When running lint-staged I get the following error -

enter image description here

This is my lint-staged config file -

module.exports = {
    'src/**/*.ts': ['eslint --fix', () => 'tsc --noEmit'],
    '**/*.{ts,js,json,yaml}': 'prettier --write',
    '**/*': 'inflint -c inflint.config.ts',
};
  • Error seems to be unrelated to config file contents. I believe you have an issue with overlapping config files. Or maybe config file and settings in `package.json`. Can you please write your folder structure and tell if package.json has config for `lint-staged`? – Andrew Miroshnichenko Jun 15 '22 at 14:44

1 Answers1

0

Run with the debug flag and see where the corresponding config is being picked up as don't see it taken from package.json

In my case, had taken a backup of earlier node_modules to node_modules.bk and it's picking the lint-staged config in third-party package.json as it might be ignoring only node_modules, after deleting node_modules.bk it worked fine.

npx lint-staged -d

lint-staged:loadConfig Successfully loaded config from ...react-i18next/package.json`:
  lint-staged:loadConfig {
  lint-staged:loadConfig   linters: { '*.{ts,tsx,js,json,md}': [ 'prettier --write', 'git add' ] },
  lint-staged:loadConfig   ignore: [
  lint-staged:loadConfig     '**/dist/**/*.js',
  lint-staged:loadConfig     '**/react-i18next.js',
  lint-staged:loadConfig     '**/react-i18next.min.js'
  lint-staged:loadConfig   ]
  lint-staged:loadConfig } +0ms
Naga Kiran
  • 8,585
  • 5
  • 43
  • 53