Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Error while loading rule '@typescript-eslint/no-empty-function': Cannot read properties of undefined #923

Closed
marekdedic opened this issue Nov 22, 2024 · 1 comment · Fixed by #924

Comments

@marekdedic
Copy link
Contributor

When running pnpm run update, I get the following error:

/home/user/eslint-plugin-svelte/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/rules/no-empty-function.js:125
        const [{ allow }] = context.options;
                 ^

TypeError: Error while loading rule '@typescript-eslint/no-empty-function': Cannot read properties of undefined (reading 'allow')
Occurred while linting /home/user/eslint-plugin-svelte/packages/eslint-plugin-svelte/src/types-for-node.ts
    at Object.create (/home/user/eslint-plugin-svelte/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/rules/no-empty-function.js:125:18)
    at create (/home/user/eslint-plugin-svelte/node_modules/.pnpm/@[email protected]_@[email protected][email protected]_typesc_dmdtqn535btny6mjh3zmxsioty/node_modules/@typescript-eslint/eslint-plugin/src/rules/no-empty-function.ts:68:28)
    at Object.create (/home/user/eslint-plugin-svelte/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@typescript-eslint/utils/src/eslint-utils/RuleCreator.ts:103:14)
    at createRuleListeners (/home/user/eslint-plugin-svelte/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/linter.js:944:21)
    at /home/user/eslint-plugin-svelte/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/linter.js:1082:84
    at Array.forEach (<anonymous>)
    at runRules (/home/user/eslint-plugin-svelte/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/linter.js:1013:34)
    at #flatVerifyWithoutProcessors (/home/user/eslint-plugin-svelte/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/linter.js:1911:31)
    at Linter._verifyWithFlatConfigArrayAndWithoutProcessors (/home/user/eslint-plugin-svelte/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/linter.js:1993:49)
    at Linter._verifyWithFlatConfigArray (/home/user/eslint-plugin-svelte/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/linter.js:2082:21)
@marekdedic
Copy link
Contributor Author

I think this is caused by typescript-eslint/typescript-eslint#10338 and can be fixed either by upgrading typescript-eslint to 8.15 or downgrading eslint to 9.14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant