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

eslint: fix prefer-const #2099

Merged
merged 3 commits into from
Dec 8, 2024

Conversation

NovemLinguae
Copy link
Member

manual fixes

@NovemLinguae NovemLinguae merged commit b20e3a8 into wikimedia-gadgets:master Dec 8, 2024
5 checks passed
mdaniels5757 added a commit to mdaniels5757/twinkle-for-commons that referenced this pull request Dec 10, 2024
* docs: update CONTRIBUTING.md (wikimedia-gadgets#1756)

* docs: mention git branches, GitHub forks, manual testing

* space

* remove advice about squashing and merging. not needed imo

* mention "fixes 123" trick for closing GitHub issues

* xfd: fix "undefined" error in userspace log XfD CfDS edit summary (wikimedia-gadgets#1768)

* build(deps-dev): bump eslint from 8.33.0 to 8.37.0 (wikimedia-gadgets#1766)

Bumps [eslint](https://github.com/eslint/eslint) from 8.33.0 to 8.37.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](eslint/eslint@v8.33.0...v8.37.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* tag: rename {{More footnotes}} to {{More footnotes needed}} (wikimedia-gadgets#1760)

* warn: Add uw-translation (wikimedia-gadgets#1740)

* block: fix extra period in {{uw-botuhblock}} edit summary (wikimedia-gadgets#1774)

* fix edit summary for uw-wrongsummary (wikimedia-gadgets#1773)

* Add welcome-copyright (wikimedia-gadgets#1758)

* Update friendlywelcome.js

Add welcome-copyright to the welcome module

* Update friendlywelcome.js

add comma

* fix template parameters

---------

Co-authored-by: NovemLinguae <[email protected]>

* build(deps-dev): bump eslint from 8.37.0 to 8.39.0 (wikimedia-gadgets#1772)

Bumps [eslint](https://github.com/eslint/eslint) from 8.37.0 to 8.39.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](eslint/eslint@v8.37.0...v8.39.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* protect: add generic ECP option to protection module (wikimedia-gadgets#1762)

* warn: add uw-fringe 1-4 (wikimedia-gadgets#1742)

* add uw-fringe1-4

* add commas

* fix lint

* Update twinklewarn.js

del uw-fringe4

* Update twinklewarn.js

rm stray comma

* ci: always run unit tests (wikimedia-gadgets#1781)

* bump jest from v27 to v29 (wikimedia-gadgets#1787)

- bump jest from v27 to v29
- bump mock-mediawiki to v1.4.0
- install jest-environment-jsdom, needed for jest v29 to work
- adjust snapshot test syntax a bit, to work with jest v29

* add dependency notes to DEVELOPER.md (wikimedia-gadgets#1777)

* add dependency notes to DEVELOPER.md

* add jest-environment-jsdom

* `npm update` everything (wikimedia-gadgets#1794)

Now that we're finally on the latest version of Jest, it should be safe to update all our npm dependencies.

These are all **dev** dependencies and have no chance of breaking the Twinkle build used on-wiki.

Since these are all dev dependencies, the only testing needed should be 1) make sure CI passes and 2) make sure `npm start` works.

Tested, works.

* twinkle.js: fix addPortlet() in vector-2022 (wikimedia-gadgets#1816)

* fix twinkle menu background on vector-2022 zebra (wikimedia-gadgets#1799)

Hotfix for https://phabricator.wikimedia.org/T337893. Already deployed by @MusikAnimal

Co-authored-by: MusikAnimal

* diff/welcome: readability refactor (wikimedia-gadgets#1802)

I had to dig into this code to explore a bug, and I found it confusing. This renames some variables, and changes the wording of some things on the Wikipedia:Twinkle/Preferences screen. Should be no change in functionality.

* welcome: minor refactor (wikimedia-gadgets#1804)

- add comment
- capitalize a template name
- remove dead code (the template W-short does not support the parameter heading=true)

Related wikimedia-gadgets#1785

* tag: add namespace rules for redirect tags (wikimedia-gadgets#1467)

* tag: add namespace rules for redirect tags

* comment with stack overflow link

* change mainspaceOnly to not allow talk namespace

* rebase

* mention CC BY-SA 4.0

* merge conflict

* use string.endsWith()

* protect: sanitized-css: don't tick <noinclude> check box (wikimedia-gadgets#1637)

* sanitized-css: don't tick <noinclude> check box

* refactor based on code review suggestion

Co-authored-by: Siddharth VP <[email protected]>

* fix

* Morebits.pageNameNorm.startsWith

* Morebits.pageNameNorm.startsWith

* includes()

---------

Co-authored-by: Siddharth VP <[email protected]>

* twinkle: notifications for CSD C1 should default to true (wikimedia-gadgets#1706)

* Added media related and emoji redirect templates (wikimedia-gadgets#1741)

* Update friendlytag.js

added media and emoji redirect templates

* Update friendlytag.js

* fix front end code of flag checkbox. back end is still broken

* remove optional params from {{R from emoji}}

---------

Co-authored-by: NovemLinguae <[email protected]>

* Store module prefills under Twinkle.prefill (wikimedia-gadgets#1683)

* Update twinkle.js

* Update friendlywelcome.js

* Update twinklearv.js

* Update twinklefluff.js

* Update twinklewarn.js

* Fix lint error

* Elaborate comment

* Optimize: only get/set prefills on demand

* Call prototype hasOwnProperty()

* Simplify

* comments

---------

Co-authored-by: NovemLinguae <[email protected]>

* Fix double punctuation issues at AIV (wikimedia-gadgets#1734)

* Fix double punctuation issues at AIV

* fix double ternary

* refactor

---------

Co-authored-by: NovemLinguae <[email protected]>

* tag: fix pagetriagelist API undefined error (wikimedia-gadgets#1755)

* fix merge conflict

* simplify

* ce

* tag: add {{r from airport code}} and {{r from airline code}} (wikimedia-gadgets#1784)

* add {{r from airport code}} and {{r from airline code}}

* restriction: insideMainspaceOnly

* errant spaces

---------

Co-authored-by: NovemLinguae <[email protected]>

* welcome: add {{WikiProject Women in Red invite}} (wikimedia-gadgets#1792)

* add {{WikiProject Women in Red invite}}

* readd, accidentally deleted?

* fix WP spelling, fix template name

* alphabetize

---------

Co-authored-by: NovemLinguae <[email protected]>

* Alphabetized  "Problem user welcome templates" (wikimedia-gadgets#1796)

* alphabetized "Problem user welcome templates"

* Alphabetized "Problem user welcome templates"

* final commit

* `npm update` (wikimedia-gadgets#1825)

`npm start` tested, works. If CI passes, this should be safe to merge. Will likely resolve the 2 pending dependabot PRs.

* add documentation for deploying / sync.pl (wikimedia-gadgets#1823)

* add documentation for deploying / sync.pl

related wikimedia-gadgets#1771

* add

* switch dependabot from monthly to yearly (wikimedia-gadgets#1824)

The dependabot patches generate a lot of noise in emails, PR requests, etc. These are just dev dependencies, so I don't think they're worth much time and effort to keep updated. A yearly reminder should be enough.

* `npm update` (wikimedia-gadgets#1849)

Should close the 3 dependabot PRs.

* Rmtr order (wikimedia-gadgets#1735)

* Change placement order at RMTR

* Fix newline issues

* level 4 heading

* add tests, always add exactly 1 empty line

* comment

---------

Co-authored-by: NovemLinguae <[email protected]>

* Use separate template for two sections of WP:PNT (wikimedia-gadgets#1752)

- Needtrans is for pages needing translation, and will need its text reset on English Wikipedia.
- Duflu is for rough translations, and will need to be restored to its old text rather than redirecting.

* added {{uw-blar}} and {{uw-articletodraft}} (wikimedia-gadgets#1797)

* first commit

* second commit

* fix 2 code review comments

---------

Co-authored-by: NovemLinguae <[email protected]>

* Added Template:uw-refspam as a single-issue notice wikimedia-gadgets#1666 (wikimedia-gadgets#1798)

* first commit

* second commit

* Added Template:uw-refspam wikimedia-gadgets#1666

* Added Template:uw-refspam

* Added

* label, summary

* adjust wording

* hideLinkedPage, hideReason

---------

Co-authored-by: NovemLinguae <[email protected]>

* Twinkle uses new mw.util.addPortlet API (wikimedia-gadgets#1881)

* Twinkle uses new mw.util.addPortlet API

Fixes: wikimedia-gadgets#1835

* add comment

---------

Co-authored-by: NovemLinguae <[email protected]>

* Fix RMTR bug (wikimedia-gadgets#1853)

Reported by QuietHere at https://en.wikipedia.org/wiki/Wikipedia_talk:Twinkle#RM%2FTR_error

Hotfix already released

* fix hideReason not working when used without hideLinkedPage (wikimedia-gadgets#1851)

Typo in a previous patch

* hideReason=true for Uw-blar and Uw-articletodraft (wikimedia-gadgets#1850)

I just merged wikimedia-gadgets#1797, but I realized it needs `hideReason: true` because the {{{2}}} parameter is not a reason. This patch fixes that.

Related wikimedia-gadgets#1797
Related wikimedia-gadgets#1753

* build(deps-dev): bump eslint from 8.46.0 to 8.52.0 (wikimedia-gadgets#1880)

Bumps [eslint](https://github.com/eslint/eslint) from 8.46.0 to 8.52.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](eslint/eslint@v8.46.0...v8.52.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump jest-environment-jsdom from 29.6.2 to 29.7.0 (wikimedia-gadgets#1874)

Bumps [jest-environment-jsdom](https://github.com/jestjs/jest/tree/HEAD/packages/jest-environment-jsdom) from 29.6.2 to 29.7.0.
- [Release notes](https://github.com/jestjs/jest/releases)
- [Changelog](https://github.com/jestjs/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jestjs/jest/commits/v29.7.0/packages/jest-environment-jsdom)

---
updated-dependencies:
- dependency-name: jest-environment-jsdom
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump jest from 29.6.2 to 29.7.0 (wikimedia-gadgets#1873)

Bumps [jest](https://github.com/jestjs/jest/tree/HEAD/packages/jest) from 29.6.2 to 29.7.0.
- [Release notes](https://github.com/jestjs/jest/releases)
- [Changelog](https://github.com/jestjs/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jestjs/jest/commits/v29.7.0/packages/jest)

---
updated-dependencies:
- dependency-name: jest
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* twinkle: Put TW menu back on the right side of the More menu (wikimedia-gadgets#1887)

* twinkle: Put TW menu back on the right side of the More menu

Fixes wikimedia-gadgets#1886
Related wikimedia-gadgets#1881

* use var instead of let

* comment

* fix double element bug

* log, fix bug

* twinkle: fix vector-2022 TW menu bug (wikimedia-gadgets#1896)

* twinkle: fix vector-2022 TW menu bug

Fixes wikimedia-gadgets#1895 TW menu becomes unusable in vector-2022 if you dock the tools menu to the right side

* same element for both lines

* DEVELOPER.md: update deploy section (wikimedia-gadgets#1894)

* build(deps-dev): bump eslint from 8.52.0 to 8.54.0 (wikimedia-gadgets#1899)

Bumps [eslint](https://github.com/eslint/eslint) from 8.52.0 to 8.54.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](eslint/eslint@v8.52.0...v8.54.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update twinkle.css for Vector Zebra CSS refactor (wikimedia-gadgets#1906)

Removes hotfix for T337893. 
These extra styles for Vector are currently not necessary
and cause excess padding.

Bug: T353214

* xfd: add a line break to the end of some entries (wikimedia-gadgets#1904)

RFD, CFD, and TFD entries added to daily log pages by Twinkle currently have no line break between the entry being added and the next entry. They touch each other.

This patch fixes that. After this patch, there will be a line break between each entry.

* minor update to deploy documentation (wikimedia-gadgets#1902)

* twinkle-pagestyles.css: expand comment (wikimedia-gadgets#1893)

* fix PR labeler (wikimedia-gadgets#1908)

fix PR labeler is failing CI wikimedia-gadgets#1907

- upgrade to version 5 format
- start labeling .github/* files with the "Test" label, because it makes sense, and so I can test this

* Revert "fix PR labeler" (wikimedia-gadgets#1936)

* Fix PR labeler CI (wikimedia-gadgets#1928)

Fix wikimedia-gadgets#1907

I can't easily figure out how to upgrade the syntax of https://github.com/wikimedia-gadgets/twinkle/blob/master/.github/labels.yml from v4 to v5. As a band aid fix to get our CI working, force the PR labeler to use v4.

* welcome: fix Women in Red typo (wikimedia-gadgets#1935)

* warn: add uw-longsd (wikimedia-gadgets#1938)

* morebits: change default label from "Submit Query" to "Submit" (wikimedia-gadgets#1865)

* tag: improve readability of WP:PNT code (wikimedia-gadgets#1952)

* tag: add code comments

* more concise

* fix linter error

* tag: update template names, add {{BLP one source}}

* Rename {{Like resume}} to {{Resume-like}}
* Rename {{BLP unsourced}} to {{BLP unreferenced}}
* Add {{BLP one source}}
* Rename {{Cleanup-PR}} to {{Cleanup press release}}

* warn: fix dark mode (wikimedia-gadgets#1982)

* warn: fix dark mode

The bug is that the warn dialog is a mix of light and dark elements.

Two strategies come to mind. Either lighten everything, or darken everything. I chose to lighten everything.

Follow-up patches will be needed for other modules. This patch just focuses on the warn module.

- in the warn module, remove dark mode styling from everything but the submit button
- sprinkle the "notheme" class liberally
- most elements can have classes added in the Morebits module, but the select2 element (fancy searchable dropdown list similar to jquery-chosen) is a third party library so needs special code
- add comment to morebits describing how select2 works

* update snapshots

* config: fix grammar in helptip (wikimedia-gadgets#1986)

Requested by Graham87 at https://en.wikipedia.org/wiki/MediaWiki_talk:Gadget-Twinkle.js#Interface-protected_edit_request_on_28_July_2024

* xfd: widen cfd/s "new name" text box (wikimedia-gadgets#1989)

fix wikimedia-gadgets#1984

* tag: add {{No significant coverage (sports)}} and {{No significant coverage}} (wikimedia-gadgets#1834)

* Update friendlytag.js

* lint fix + general fixes

* tweak per PR

Thank you to @Eejit43 for the suggestions.

* fix lint

* apply lint roller

* update per novemlinguae

* fix typo causing an undefined

---------

Co-authored-by: NovemLinguae <[email protected]>

* added 10 days, 6 months, 2 years in protect (wikimedia-gadgets#1869)

* added 10 days, 6 months, 2 years in protect

* 2 year -> 2 years

---------

Co-authored-by: NovemLinguae <[email protected]>

* build: turn off dependabot (wikimedia-gadgets#2006)

- turn off dependabot
- remove some dependabot stuff from .md file
- add a sentence to a .md file

fixes wikimedia-gadgets#1852

* See https://en.wikipedia.org/wiki/Template_talk:Welcome-unregistered-constructive#Requested_move_29_December_2023 (wikimedia-gadgets#1941)

* Update friendlywelcome.js (wikimedia-gadgets#1943)

Add category wikimedia-gadgets#1905

* arv: censor username if offensive username is ticked (wikimedia-gadgets#1946)

* Issue wikimedia-gadgets#1945 Implementation

* why is vsc doing this

* Update twinklearv.js

* is this what the linter doesn't like?

* i'm sorry, please squash this

* fixed, sorry

* would have outputted as a double space,

i'm going to bed, i am so sorry.

---------

Co-authored-by: DarmaniLink <redacted>

* Update tag module to use longer template names for readability (wikimedia-gadgets#1953)

Co-authored-by: NovemLinguae <[email protected]>

* Fix removing tags for maintenance templates where |name= points to a valid redirect (wikimedia-gadgets#1960)

Co-authored-by: siddharthvp <[email protected]>

For wikimedia-gadgets#1863/wikimedia-gadgets#1618

* Add unsourced, and welcomeen-it/hi/id (wikimedia-gadgets#1963)

* Add unsourced, and welcomeen-it/hi/id

Fixes wikimedia-gadgets#1958 wikimedia-gadgets#1957 wikimedia-gadgets#1814

* welcome-anon -> welcome-unregistered

* welcome-anon -> welcome-unregistered

* fix double signature

* alphabetical order

---------

Co-authored-by: NovemLinguae <[email protected]>
Co-authored-by: NovemLinguae <[email protected]>

* Use CodeQL v3 over v1 (wikimedia-gadgets#1964)

* Update codeql-analysis.yml

CodeQL v1 is deprecated per https://github.blog/changelog/2023-01-18-code-scanning-codeql-action-v1-is-now-deprecated/

Update to v2

* Update codeql-analysis.yml

Never mind, v3 exists...

* Update twinklewarn.js with {{uw-usertalk}} (wikimedia-gadgets#1973)

* Update twinklewarn.js with {{uw-usertalk}}

Add the template for single issue notice of misusing user talk pages.

* hideLinkedPage: true

---------

Co-authored-by: NovemLinguae <[email protected]>

* warn: fix typo in uw-longsd (wikimedia-gadgets#2015)

* speedy: replace db-templatecat with C4 (wikimedia-gadgets#1994) (wikimedia-gadgets#2004)

This commit also removes "G8: Redirects to non-existent targets" from
the category-specific list, as it will never display on a redirect page
(the redirect-specific categories, which contain G8, will display
instead).

* twinkle: Move nuisance error to console (wikimedia-gadgets#1998) (wikimedia-gadgets#2002)

The error message for a failed network request to get preferences is now
logged to console instead of being shown as a popup. The error fires
if the user navigates away from the page before the request completes,
leading to unwanted popups.

* tag: fix multiple issues grouping (wikimedia-gadgets#1997) (wikimedia-gadgets#2003)

Fix regression where section-specific tags were no longer ignored due to
a change in the HTML structure of article headings.

* tag: disable tagging of category redirects (wikimedia-gadgets#1947) (wikimedia-gadgets#2007)

* Add dark mode compatibility to Twinkle (wikimedia-gadgets#2023)

* xfd: tag CfD/S C2F with cfm-speedy, not cfr-speedy (wikimedia-gadgets#2043)

* Closes wikimedia-gadgets#1788 - Change template to redirected template name (wikimedia-gadgets#2017)

* Performance optimizations in dev-server (wikimedia-gadgets#2030)

* dev-server: allow using OAuth2 token for enabling/disabling onwiki gadget

Speeds up the process of disabling onwiki gadget as OAuth2 doesn't require login.

Closes wikimedia-gadgets#1883

* dev-server: mitigate token errors while re-enabling onwiki gadget

By preemptively fetching a new CSRF token if more than 15 minutes passed from the user starting the server.

* dev-server: parallelize filesystem read calls

Earlier, each file was being read sequentially from disk. Parallelizing the calls is seen to reduce load times by 25%.

* tag: add requested additional tags (wikimedia-gadgets#2005)

* tag: add "organizations" to {{Notability}} (wikimedia-gadgets#1999)

Splits the "companies and organizations" option to "companies" and
"organizations" in {{Notability}}. These display the same, and use the
same notability guideline, but add the tagged article to different
categories.

* tag: add {{Fringe theories}} (wikimedia-gadgets#1996)

* tag: alphabetization corrections

* tag: add deleted/nominated on Commons (wikimedia-gadgets#1959)

* fix plural

* alphabetize (including the word "Clean")

---------

Co-authored-by: NovemLinguae <[email protected]>

* tag: add parenthetical referencing tag wikimedia-gadgets#2022 (wikimedia-gadgets#2024)

* tag: Adding {{Cleanup colors}} + {{Overcoloured}} (wikimedia-gadgets#2026)

* tag: Adding {{Cleanup colors}} + {{Overcoloured}}

New PR for wikimedia-gadgets#1857. fixes wikimedia-gadgets#1847

* Update friendlytag.js

---------

Co-authored-by: NovemLinguae <[email protected]>

* Remove IE 11 compatibility code (wikimedia-gadgets#1900)

IE 11 is no longer supported, by Twinkle or by MediaWiki, for a while now.

* add tags and warnings (wikimedia-gadgets#1991)

* add {{more plot}}

* uw-mislead 1 through 3

* fix syntax error

* add {{Uw-talkinarticle1}} to 3

* replace text i forgot to replace

* uw-ai 1 to 3

* add uw-fv1

* add {{Uw-bareurl}}

* add uw-redirect 1 through 4

* add {{Uw-multiple-accts}}

* add {{uw-circular}}

* adjust wording

* add uw-ai4

* move circular from warn to notice

---------

Co-authored-by: NovemLinguae <[email protected]>

* speedy: update u5, tag: add {{User-generated}}, {{BLP one source}}, {{BLP no footnotes}} (wikimedia-gadgets#1992)

* update speedy u5 (wikimedia-gadgets#1930)

* eslint

Fixed indentation using eslint

* eslint

Fixed indentation using eslint

* tag: add templates (wikimedia-gadgets#1972)

I added {{User-generated}} and {{BLP no footnotes}} into the 'General content issues' -> 'Verifiability and sources' section of friendlytag.js.
 {{BLP one source}} was already present as of 8e5fc21.

* fixed indentation

* modify tabs to reduce diff

* adjust label too, to meet acceptance criteria

* adjust description

---------

Co-authored-by: NovemLinguae <[email protected]>

* welcome: add {{Welcome draft}} wikimedia-gadgets#2020 (wikimedia-gadgets#2025)

* talkback: remove leading whitespace on new pages (wikimedia-gadgets#2028)

* talkback: remove leading whitespace on new pages

* refactor (break long line into 2 lines)

---------

Co-authored-by: NovemLinguae <[email protected]>

* protect: stop noincluded tags breaking headers (wikimedia-gadgets#2029)

If a noincluded protection tag is added at the start of the same line as
a section heading, it will stop the heading from rendering correctly.
A newline will now be added after noincluded tags if the page starts
with ==

* Change markTalkbackAsMinor to default to off (wikimedia-gadgets#2033)

Fixes wikimedia-gadgets#2032

* update {{Advert}} tag according to TfD (wikimedia-gadgets#2036)

* update {{Advert}} tag according to TfD

Fixes wikimedia-gadgets#2035

* alphabetize

* mention "advert" in the description, so folks searching for "advert" can find it

---------

Co-authored-by: NovemLinguae <[email protected]>
Co-authored-by: NovemLinguae <[email protected]>

* Adding {{uw-pronouns1}}, {{uw-pronouns2}} and {{uw-pronouns3}} (wikimedia-gadgets#2037)

Fixes wikimedia-gadgets#2034

* tag: refactor file tag form validation code (wikimedia-gadgets#2047)

* tag: readability refactor of form validation code for files

* debug

* simplify {{Bad GIF|JPEG|SVG}} validation logic. some loss of functionality, but worth it for readability

* tag: add {{Maybe free media}} and {{Fake SVG}} for files (wikimedia-gadgets#2041)

* Add {{Maybe free media}} and {{Fake SVG}}

* Delete .idea directory (committed by accident)

* revert changes to package-lock.json

* fix linter error

---------

Co-authored-by: NovemLinguae <[email protected]>
Co-authored-by: NovemLinguae <[email protected]>

* gadget.txt: sync with what's onwiki (wikimedia-gadgets#2049)

no changes except for whitespace

* no longer allow users to set portlet preferences (wikimedia-gadgets#1978)

* no longer allow users to set portlet preferences

- No longer allow users to set portlet preferences. These hidden preferences were rarely used (6 instances found), and increase technical debt by making the code complex. I think it makes sense to eliminate them.
- Move defaults for these values to the Twinkle.addPortlet() function, a more natural spot for these.
- One of these preferences was used outside the Twinkle.addPortlet() function, so modify Twinkle.addPortlet() to return the preference and place it in a variable.
- Add a comment about what $.collapsibleTabs is.

Related wikimedia-gadgets#1836

Note to self: not manually tested yet.

* fix bug

* improve docblocks

* fix bugs

* improve docblock

* add comments

* comments. remove "type" variable

* remove unneeded values

* scripts: delete unused (wikimedia-gadgets#2045)

fix wikimedia-gadgets#2044 delete unused scripts

note: test and make sure `npm start` still works

* SECURITY.md: update (wikimedia-gadgets#2052)

* SECURITY.md: update

* fix github usernames

* scripts: rename sync.pl to deploy.pl (wikimedia-gadgets#2051)

related wikimedia-gadgets#2044

* config: fix loss of green box and background color for saving success message (wikimedia-gadgets#2014)

* get ready for mw-message-box deprecation

fixes wikimedia-gadgets#2012

Was unable to use Codex, because Codex is usually only loaded on certain pages by certain extensions that use Codex. There is no guarantee it would be loaded and available on the page [[Wikipedia:Twinkle/Preferences]].

The strategy in this patch is to copy paste the necessary CSS from MediaWiki to Morebits.

* mw.loader.using( 'mediawiki.legacy.messageBox'

* switch to codex since mediawiki.legacy.messageBox is deprecated

* remove <br><br>. remove margin-top

* welcome: add some {{Welcomeen-XX}} templates (wikimedia-gadgets#2042)

* welcome: add some {{Welcomeen-XX}} templates

* alphabetize

* Support batch requested moves (wikimedia-gadgets#1888)

* Update morebits.js

* Update morebits.js

* Update twinklexfd.js

* Update twinklexfd.js

* Update twinklexfd.js

* Update twinklexfd.js

* Update morebits.js

* Update twinklexfd.js

* always default to the non talk page

---------

Co-authored-by: NovemLinguae <[email protected]>

* prevent placing of protection, XFD, or CSD tags on TimedText pages  (wikimedia-gadgets#2027)

* Prevent prot, XFD, CSD tagging of TimedText pages

TimedText pages cannot have any tags applied to them, so Twinkle should
not allow the user to place any tags there.

* fix lint errors

* add comments

---------

Co-authored-by: NovemLinguae <[email protected]>

* xfd: refactor regex to use mw.Title (wikimedia-gadgets#2054)

* welcome: add level 2 headings for foreign language welcomes (wikimedia-gadgets#2053)

Foreign language welcomes are odd in that they place a signed message with two level 3 headings, but no level 2 heading.

Talk page messages should always have a level 2 heading, so this adds that, while keeping the level 3 headings as well.

* rename modules/friendlyX.js to modules/twinkleX.js (wikimedia-gadgets#2055)

* eslint: switch from custom rules to eslint-config-wikimedia (wikimedia-gadgets#1976)

* https://github.com/wikimedia/eslint-config-wikimedia

Why switch?
- it's standard for wikimedia projects
- it has some cool features such as jquery deprecation warnings, and enforcing a specific version of JavaScript
- I believe it has many more rules than our previous configuration, which will help with identifying areas of the code to modernize

What this patch does
- delete all old linter rules, except for these rules I carried over:
	- `no-nested-ternary`
	- `no-restricted-syntax` for `.done()` and `.fail()`
- upgrade eslint a couple minor versions
- add eslint-config-wikimedia and its default rules
- disable controversial rules such as
	- whitespace in parentheses (`space-in-parens`, `space-before-function-paren`, `array-bracket-spacing`, `computed-property-spacing`, `object-curly-spacing`)
	- max line length 100 (`max-len`)
- disable some rules
	- `indent` because it would involve touching almost every line, messing up git blame (although I may autofix this in the future and set a .git-blame-ignore-revs to reduce git blame spam)
	- `wrap-iife` to reduce VS Code yellow underline spam (will autofix this in a future patch)
	- couple others that I don't like and have disabled in my other projects
- set it to ES6 since wikimedia "modern layer" support is now on ES6
- warn/error for syntax or internal functions higher than ES6 (this is more thorough than the old >ES6 detection we were using)
- set all remaining detected violations to "warn" for now, so that CI passes
- will apply autofixes for all the rules that "warn" in a future patch

The rules are in two groups, with an extra line break in the middle separating them.
- The top group are rules that should not be fixed
- The bottom group are rules that should be fixed over time via autofixes and manual fixing. Once everything for that rule is fixed, that rule can be deleted, so that the linter starts enforcing it in CI.

Over time, rules will be fixed and removed from the config, and the code will be incrementally modernized, until it arrives at the Wikimedia standard.

* turn off template-curly-spacing

* remove dependency eslint

* line break, to create visual separation between the 3 groups

* rename twinklefluff.js to twinklerollback.js (wikimedia-gadgets#2056)

* rollback: support older fluff preferences (wikimedia-gadgets#2059)

Continue honoring the confirmOnFluff and confirmOnMobileFluff preferences (renamed in wikimedia-gadgets#2056) which are in use by 900+ users.

When a user changes any of their Twinkle preferences, these two preferences if in use will get automatically renamed. When this has occurred for most users, support for them can be dropped.

* arv: refactor AIV report generation (wikimedia-gadgets#2060)

* extract aiv report creation to methods

* fix lint error

* use more concise method name

* config: don't ignore old fluff preferences (wikimedia-gadgets#2061)

* rollback: don't delete user preferences

- fixes an issue where if a user still had the old confirmOnFluff or confirmOnRollback preferences, and visited the preferences page and saved, their preferences were ignored and silently deleted
- refactor complicated conditional in twinklerollback.js module
- reverts wikimedia-gadgets#2059 because we accomplish the same thing by putting the code in twinkle.js

* un-extract variable

* fix wrong variable bug

Co-authored-by: Siddharth VP <[email protected]>

* fix semicolon bug

---------

Co-authored-by: Siddharth VP <[email protected]>

* refactor UAA report generation logic (wikimedia-gadgets#2062)

* eslint: apply autofixes 1 (wikimedia-gadgets#2058)

* move ignorePatterns to .eslintignore, makes bash commands easier

* wrap-iife

* no-var

* prefer-const

* prefer-arrow-callback

* arrow-parens

* arrow-body-style

* manual fixes, to deal with comments that confused the autofix

* fix merge conflict

* move comments out of arrow functions to line above

* split long lines into multiple lines

* rollback: fix "cannot read properties of undefined" (wikimedia-gadgets#2071)

hotfix

https://en.wikipedia.org/wiki/Wikipedia_talk:Twinkle#Problems_with_WP%3ATwinkle

* eslint: apply autofixes 2 (wikimedia-gadgets#2069)

* turn off no-alert. lots of alerts in Twinkle

* no-multiple-empty-lines

* no-multiple-empty-lines

* no-multi-spaces

* quote-props

* dot-location

* new-parens

* Fix RM summary/log (wikimedia-gadgets#2085)

* Fix RM summary/log

* Link to WP:RM/TR

* eslint: apply autofixes 3 (wikimedia-gadgets#2079)

- apply all remaining autofixes with `npx eslint --fix .`
- turn off jsdoc/require-param because I didn't like the autofix. would just add params without any types or descriptions
- turn off jsdoc/require-returns for now. lots of docblocks that are just being used as comments, which is fine

* simplify IIFEs (wikimedia-gadgets#2074)

I don't see a reason to specify parameters for the IIFEs. The global variables will get into the closure even without giving the IIFE parameters.

* gadget.txt: remove requiresES6 (wikimedia-gadgets#2075)

Removed in MediaWiki 1.42. This option doesn't seem to do anything anymore.

https://phabricator.wikimedia.org/T75714#9443736

* twinkle.js: comments to docblocks (wikimedia-gadgets#2076)

* fix linter error no-jquery/variable-pattern (wikimedia-gadgets#2081)

* fix linter error jsdoc/no-undefined-types (wikimedia-gadgets#2082)

manual fixes. mostly capitalization errors

* fix linter error no-sequences (wikimedia-gadgets#2083)

manual fixes. I tested one fix in the console, worked as expected. All 4 fixes follow the pattern of `var1 = 'x', var2 = 'y'` -> `var1 = 'x'; 'var2 = 'y'`

* morebits: create capitalized aliases for classes (wikimedia-gadgets#2086)

related wikimedia-gadgets#2084

next patch will be switching to these capitalized aliases in other files, which will fix new-caps ESLint warnings

* capitalize Morebit class names (wikimedia-gadgets#2087)

related wikimedia-gadgets#2084

- case sensitive, all repo search and replace, excluding test files and the file morebits.js. will handle those in a later patch since messing with the morebits.js file may be risky

```js
Morebits.BatchOperation = Morebits.batchOperation;
Morebits.Date = Morebits.date;
Morebits.QuickForm = Morebits.quickForm;
Morebits.QuickForm.Element = Morebits.quickForm.element;
Morebits.SimpleWindow = Morebits.simpleWindow;
Morebits.Status = Morebits.status;
Morebits.TaskManager = Morebits.taskManager;
Morebits.Unbinder = Morebits.unbinder;
Morebits.UserspaceLogger = Morebits.userspaceLogger;
Morebits.wiki.Api = Morebits.wiki.api;
Morebits.wiki.Page = Morebits.wiki.page;
Morebits.wiki.Preview = Morebits.wiki.preview;
Morebits.wikitext.Page = Morebits.wikitext.page;
```

* fix some no-jquery/no-extend autofixes (wikimedia-gadgets#2088)

* revert some no-jquery/no-extend autofixes

Upstream, they caught a bug in the autofix algorithm. Basically, you should only change $.extend() to Object.assign() if you're sure the first argument isn't null or undefined. Else it will throw.

This patch changes a couple back to $.extend, out of an abundance of caution.

wikimedia/eslint-plugin-no-jquery@35d4489

Partial revert of wikimedia-gadgets#2079

* instead of reverting, add `|| {}`

* autofix some eslint unicorn/prefer-string-slice (wikimedia-gadgets#2089)

I removed a couple of the autofixes because I don't like how it added Math.max(), which is complicated to read. I kept the helpful ones.

* eslint: revert $.extend autofixes (wikimedia-gadgets#2107)

Manual revert. Partial revert.

There's an upstream bug in the autofix ( wikimedia/eslint-plugin-no-jquery#343 ). I don't want to take any chances.

Fixes wikimedia-gadgets#2106

* eslint: switch camelcase and underscore dangle from off to warn (wikimedia-gadgets#2108)

in preparation for fixing them

keep the camelcase warnings off for object keys. these could be API keys or something. needs further investigation before refactoring them

* delete disabled files

* delete tests for deleted modules

* fix package-lock

* eslint: fix prefer-const (wikimedia-gadgets#2099)

manual fixes

* eslint: fix no-useless-concat (wikimedia-gadgets#2100)

manual fixes

* eslint: fix no-throw-literal (wikimedia-gadgets#2102)

manual fixes

* welcome: change {{welcomeunsourced}} to {{welcome-unsourced}} as result of page move (wikimedia-gadgets#2091)

* change {{welcomeunsourced}} to {{welcome-unsourced}} as result of page move

* welcome: changed placement of {{welcome-unsourced}} to maintain alphabetization

* arv: refactor SPI report generation (wikimedia-gadgets#2070)

* arv: refactor SPI report generation

* fix linter error

---------

Co-authored-by: NovemLinguae <[email protected]>
Co-authored-by: NovemLinguae <[email protected]>

* tag: remove {{Now Commons}} (wikimedia-gadgets#2073)

{{Now Commons}} is a CSD, not a tag.

* warn: add {{uw-derogatory}} (wikimedia-gadgets#2104) (wikimedia-gadgets#2112)

* block: add regression test (wikimedia-gadgets#2110)

* block: add regression test

regression test for wikimedia-gadgets#2106

* shorten function name

* DEVELOPER.md: add checklist for CSD patches (wikimedia-gadgets#2113)

* DEVELOPER.md: add checklist for CSD patches

* mention defaultConfig

* eslint: fix no-underscore-dangle (wikimedia-gadgets#2114)

manual fixes

* build: run `npm update` (wikimedia-gadgets#2116)

mainly to fix this warning in my console:

* config: delete 14 year old comment (wikimedia-gadgets#2117)

I doubt TTO wants to be contacted directly with questions

* speedy: less sassy error message (wikimedia-gadgets#2118)

This error message can occur when a template is missing onwiki. But it acts like it is because the user intentionally did not type a reason. I replaced it with a more neutral message.

* tag: add tests for checkIncompatible() (wikimedia-gadgets#2120)

* tag: add tests for checkIncompatible()

Writing automated tests for this gives me more confidence that I didn't make a mistake in PR wikimedia-gadgets#2103

* expand docblock

* rename variable, extract variable

* eslint: fix no-return-assign (wikimedia-gadgets#2103)

* eslint: fix no-return-assign

manual fix

* use sum++ instead of ternary, easier to read

* use .filter() instead of .reduce()

* fix linter error

* add test

* eslint: fix some `camelcase` (wikimedia-gadgets#2111)

manual fixes using F2 (rename variable) in VS Code. just one module for now. easier to test, and so I can get some confidence in this way of doing fixes before I move on to other modules

* npm update

* npm install

* remove tests for removed functionality

* fix eslint errors

* deploy.pl: rm removed modules

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: NovemLinguae <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: anupvs77 <[email protected]>
Co-authored-by: earlt612 <[email protected]>
Co-authored-by: Red-tailed hawk <[email protected]>
Co-authored-by: NovemLinguae <[email protected]>
Co-authored-by: lomrjyo <[email protected]>
Co-authored-by: Siddharth VP <[email protected]>
Co-authored-by: Gonzom <[email protected]>
Co-authored-by: Nardog <[email protected]>
Co-authored-by: Trialpearswiki <[email protected]>
Co-authored-by: Monik <[email protected]>
Co-authored-by: HalHaynes <[email protected]>
Co-authored-by: Jon Robson <[email protected]>
Co-authored-by: Jan Drewniak <[email protected]>
Co-authored-by: Atreay Kukanur <[email protected]>
Co-authored-by: SUDHIR KUMAR <[email protected]>
Co-authored-by: Robert Sim <[email protected]>
Co-authored-by: Jonathan Ferreira <[email protected]>
Co-authored-by: darmanilink <[email protected]>
Co-authored-by: Asim Shrestha <[email protected]>
Co-authored-by: 9382 <[email protected]>
Co-authored-by: Rich Smith <[email protected]>
Co-authored-by: vanderwaalforces <[email protected]>
Co-authored-by: Tollens <[email protected]>
Co-authored-by: Matr1x-101 <[email protected]>
Co-authored-by: fredster33 <[email protected]>
Co-authored-by: Soni <[email protected]>
Co-authored-by: DR-WP <[email protected]>
Co-authored-by: Clive <[email protected]>
Co-authored-by: Rusty <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant