Ошибка:
andrew @ andrew-Extensa-5230 ~/CODE/JS/React/IdeaNick (master)
└─ $ ▶ git commit -m "fix eslint-config"
✔ Backed up original state in git stash (ba03fa6)
✔ Hiding unstaged changes to partially staged files...
⚠ Running tasks for staged files...
❯ backend/.lintstagedrc.yml — 2 files
❯ *.{ts,tsx,js} — 2 files
✖ eslint --cache --cache-location ./node_modules/.cache/.eslintcache --fix [FAILED]
◼ prettier --loglevel warn --cache --write
↓ *.{json,yml,scss} — no files
↓ Skipped because of errors from tasks.
↓ Skipped because of errors from tasks.
✔ Reverting to original state because of errors...
✔ Cleaning up temporary files...
✖ eslint --cache --cache-location ./node_modules/.cache/.eslintcache --fix:
Oops! Something went wrong! :(
ESLint: 9.20.1
ReferenceError: pluginNode is not defined
at file:///home/andrew/CODE/JS/React/IdeaNick/backend/eslint.config.js?mtime=1754296162327:9:13
at ModuleJob.run (node:internal/modules/esm/module_job:370:25)
at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:665:26)
at async loadConfigFile (/home/andrew/CODE/JS/React/IdeaNick/node_modules/.pnpm/eslint@9.20.1/node_modules/eslint/lib/config/config-loader.js:197:21)
at async ConfigLoader.calculateConfigArray (/home/andrew/CODE/JS/React/IdeaNick/node_modules/.pnpm/eslint@9.20.1/node_modules/eslint/lib/config/config-loader.js:500:32)
(node:16384) [MODULE_TYPELESS_PACKAGE_JSON] Warning: Module type of file:///home/andrew/CODE/JS/React/IdeaNick/backend/eslint.config.js?mtime=1754296162327 is not specified and it doesn't parse as CommonJS.
Reparsing as ES module because module syntax was detected. This incurs a performance overhead.
To eliminate this warning, add "type": "module" to /home/andrew/CODE/JS/React/IdeaNick/backend/package.json.
(Use `node --trace-warnings ...` to show where the warning was created)
husky - pre-commit script failed (code 1)
Конфиг:
import baseConfig from '../eslint.config.js'
import pluginNode from 'eslint-plugin-node'
/** @type {import('eslint').Linter.FlatConfig[]} */
export default [
...baseConfig,
{
plugins: {
node: pluginNode,
},
rules: {
'node/no-process-env': 'error'
},
},
{
files: ['**/*.{ts,js}'],
languageOptions: {
parserOptions: {
project: './tsconfig.json',
},
},
},
{
ignores: ['dist', 'node_modules', 'coverage', 'eslint.config.js'],
},
]