Bug 39188 - ESLint doesn't work due bug in old "globals" node package
Summary: ESLint doesn't work due bug in old "globals" node package
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Victor Grousset/tuxayo
QA Contact: Testopia
URL:
Keywords:
Depends on: 38664
Blocks:
  Show dependency treegraph
 
Reported: 2025-02-24 04:41 UTC by Victor Grousset/tuxayo
Modified: 2025-02-24 09:35 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 39188: Fix ESLint by Updating "globals" node package (1.33 KB, patch)
2025-02-24 04:50 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 39188: [DO NOT PUSH] yarn.lock [DON'T APPLY IF IT CONFLICTS] (1.07 KB, patch)
2025-02-24 04:50 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Victor Grousset/tuxayo 2025-02-24 04:41:07 UTC
1. eslint ./koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsFormAdd.vue
2. TypeError: Key "languageOptions": Key "globals": Global "AudioWorkletGlobalScope " has leading or trailing whitespace

globals was introduced in these commits:
Bug 38664: Add @babel/core back to package.json
Bug 38664: Update yarn.lock

And somehow it pulls the version from Apr 2019. Which had a trailing space in a value.
Comment 1 Victor Grousset/tuxayo 2025-02-24 04:50:56 UTC
Created attachment 178544 [details] [review]
Bug 39188: Fix ESLint by Updating "globals" node package

According to the main dev of ESLint, we should add it to devDependencies
because we are the ones calling globals from eslint.config.mjs:
https://github.com/eslint/eslint/issues/19209#issuecomment-2518452107

Test plan:
1. run: eslint ./koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsFormAdd.vue
2. TypeError: Key "languageOptions": Key "globals": Global "AudioWorkletGlobalScope " has leading or trailing whitespace
3. :(
4. Apply patch
5. sudo yarn install --modules-folder /kohadevbox/node_modules
6. run: eslint ./koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsFormAdd.vue
7. eslint output a report about the issues found in the file
8. signoff :D
Comment 2 Victor Grousset/tuxayo 2025-02-24 04:50:58 UTC
Created attachment 178545 [details] [review]
Bug 39188: [DO NOT PUSH] yarn.lock [DON'T APPLY IF IT CONFLICTS]