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

move all client-side javascript into modules folder, and adjust eslint config accordingly #2078

Open
NovemLinguae opened this issue Nov 25, 2024 · 0 comments · May be fixed by #2124
Open

move all client-side javascript into modules folder, and adjust eslint config accordingly #2078

NovemLinguae opened this issue Nov 25, 2024 · 0 comments · May be fixed by #2124
Labels
Module: morebits The morebits.js library Module: twinkle The twinkle.js global gadget file tests

Comments

@NovemLinguae
Copy link
Member

NovemLinguae commented Nov 25, 2024

Why

  • shouldn't have non-config files in the root
  • right now the root contains both node files (server-side JS code) and twinkle.js/morebits.js (client-side JS code), which makes it hard to set up eslint to lint both types of files

What

  • move twinkle.js and morebits.js into modules/ folder
  • probably move .css files in the root too
  • fix everything that breaks (deploy script, jest, documentation, etc.)
  • eslint config
    • use wikimedia/server for the root/whole project (.eslintrc.json)
    • move client-side JS config settings to the eslint config file in the modules folder (modules/.eslintrc.json)
    • remove scripts/ and tests/ from .eslintignore. should work now with wikimedia/server set up in the root config

Follow up patch

  • apply eslint autofixes to .js files in scripts/ and tests/ folders
@NovemLinguae NovemLinguae added Module: morebits The morebits.js library Module: twinkle The twinkle.js global gadget file tests labels Nov 25, 2024
NovemLinguae added a commit to NovemLinguae/twinkle that referenced this issue Dec 9, 2024
Move twinkle.js, morebits.js, CSS files, etc. out of the root. The root directory should be config files and readmes only.

Wikimedia also does this. JS files are always all placed in a directory called /modules/ (or sometimes a subdirectory with a different name, the other name escpaes me at the moment). But never in the root.

Fixes wikimedia-gadgets#2078

To test:
- npm start
- perl deploy.pl

Maybe:
- put the old modules in a subdirectory? modules/menuItems/*.js or something?
@NovemLinguae NovemLinguae linked a pull request Dec 9, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Module: morebits The morebits.js library Module: twinkle The twinkle.js global gadget file tests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant