Akronae / eslint-plugin-exception-handling

💣 Lints unhandled functions that might throw errors. For JavaScript/TypeScript eslint.
25 stars 1 forks source link

Error: ENOENT: no such file or directory, open #1

Open pabau opened 3 months ago

pabau commented 3 months ago

Hi! thank you for your eslint plugin. I have a problem running it on my monorepo:

Error: ENOENT: no such file or directory, open '/opt/atlassian/pipelines/agent/build/libs/quartz/filters/src/lib/lead.ts'
Occurred while linting /opt/atlassian/pipelines/agent/build/libs/quartz/filters/src/lib/activity/prepareFilterActivity.ts:96
Rule: "exception-handling/no-unhandled"
    at Object.readFileSync (node:fs:448:20)
    at resolveImportedFunc (/opt/atlassian/pipelines/agent/build/node_modules/eslint-plugin-exception-handling/dist/index.cjs:259:22)
    at resolveFunc (/opt/atlassian/pipelines/agent/build/node_modules/eslint-plugin-exception-handling/dist/index.cjs:289:26)
    at checkfunc (/opt/atlassian/pipelines/agent/build/node_modules/eslint-plugin-exception-handling/dist/index.cjs:405:15)
    at CallExpression (/opt/atlassian/pipelines/agent/build/node_modules/eslint-plugin-exception-handling/dist/index.cjs:382:24)
    at ruleErrorHandler (/opt/atlassian/pipelines/agent/build/node_modules/eslint/lib/linter/linter.js:1076:28)
    at /opt/atlassian/pipelines/agent/build/node_modules/eslint/lib/linter/safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit (/opt/atlassian/pipelines/agent/build/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (/opt/atlassian/pipelines/agent/build/node_modules/eslint/lib/linter/node-event-generator.js:297:26) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/opt/atlassian/pipelines/agent/build/libs/quartz/filters/src/lib/lead.ts',
  ruleId: 'exception-handling/no-unhandled',
  currentNode: <ref *1> {
    type: 'CallExpression',
    callee: {
      type: 'Identifier',
      decorators: [],
      name: 'prepareCustomFieldQuery',
Akronae commented 3 months ago

Hi @pabau, thanks for your report. Looks like you are importing non existing file in prepareFilterActivity.ts Can you confirm your file exists? Is your code open-sourced? If so could you share your project. If not, would you be able to reproduce this issue in a sample project?