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

Not compatible with eslint 9+. Invalid languageOptions.globals object key "AudioWorkletGlobalScope " #1269

Open
k-paxian opened this issue Jan 7, 2025 · 3 comments · May be fixed by #1299

Comments

@k-paxian
Copy link

k-paxian commented Jan 7, 2025

With latest eslint 9.17.0
They now validating the configs before applying them

this.language.validateLanguageOptions(this.languageOptions);

So it fails to apply this plugin 🤷

image
image

Also it needs to be aligned with this new way of defining globals
https://eslint.org/docs/latest/use/configure/language-options#predefined-global-variables

@k-paxian k-paxian changed the title Invalid languageOptions.globals object key "AudioWorkletGlobalScope " Not compatible with eslint 9+. Invalid languageOptions.globals object key "AudioWorkletGlobalScope " Jan 7, 2025
@irmantasluk
Copy link

I have the same issue, same error.

@Pentadome
Copy link

workaround. We shouldn't need these globals anyway

import pluginVueA11y from 'eslint-plugin-vuejs-accessibility';

const a11yConfig = pluginVueA11y.configs['flat/recommended'];

a11yConfig.forEach((x) => {
  // there seems to be problem with the globals.
  // We shouldn't need these anyways because we use typescript
  // to define global variables.
  // @ts-expect-error -- deleting is intentional here.
  delete x.languageOptions.globals;
});

@G-Rath G-Rath linked a pull request Mar 21, 2025 that will close this issue
@G-Rath
Copy link

G-Rath commented Mar 21, 2025

The actual fix for this is to update all versions of globals in your dependency tree, which you can typically do with npm update globals though you might need to "force" a higher major version to be used by explicitly adding globals as a dependency and then removing it again.

Specifically, you want to not be using v13.12.1.

An indirect issue with eslint-plugin-vuejs-accessibility that would help prevent this is that they're using globals as an implicit dependency, which is why package managers don't help you here - this can be fixed by #1280 and/or #1299

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

Successfully merging a pull request may close this issue.

4 participants