Workaround for browser bugs in Range.prototype.getClientRects and Range.prototype.getBoundingClientRect.
Basic sandbox for playing around with content editable and discovering its crazy behaviour.
Control allowance of certain jQuery functions, and suggest or autofix alternatives.
Bookmarklet for creating w.wiki short URLs on Wikimedia sites (e.g. Wikipedia)
Automatically generate ESLint plugin documentation from rule metadata and test cases.
Script to delete branches which have been merged in gerrit, even if you don't have the latest patchset
Could we add back in a renamed flag to disable the feature, e.g. ALLOW_SELF_CLOSE_IN_ATTR (default is false)?
Downstream issue affecting Wikipedia: https://phabricator.wikimedia.org/T279215#8525105
Per the inline comment, this appears to be fixing an issue in an old version of jQuery, and previously could be disabled with a flag.
But, you can override that easily with a hook and then do what works in your context.
To work around this with a hook would require re-implementing all the transforms and checks that are done to see if the attribute is about to be removed (SAFE_FOR_TEMPLATES, isValidAttribute), unless I have missed something?
Yes - it's easy to workaround, but that requires modifying the file, which means you can't just install it using npm.
Also reported downstream: https://phabricator.wikimedia.org/T204816
Merge after #487
Duplicate of #479
Steps to replicate the issue (include links if applicable):
{
"extends": [
"wikimedia/language/es2022"
]
}
eslint <any-file>
What happens?:
Oops! Something went wrong! :(
ESLint: 8.28.0
ESLint couldn't find the config "plugin:es-x/restrict-to-es2022" to extend from. Please check that the name of the config is correct.
The config "plugin:es-x/restrict-to-es2022" was referenced from the config file in "node_modules/.pnpm/eslint-config-wikimedia@0.23.0/node_modules/eslint-config-wikimedia/language/es2022.json".
If you still have problems, please stop by https://eslint.org/chat/help to chat with the team.
The eslint-plugin-es-x version bundled with 0.23.0 is ^5.2.1, but "plugin:es-x/restrict-to-es2022" cannot be found from 5.2.1 to the latest released 5.4.0
Update OOUI to 0.46.1
Update linting dependencies
Update PHP dependencies
It just affected adjacent lines with #520
This re-introduces no-restricted-syntax, which was problematic to extend and inherit from, buy we'll cross that bridge if we come to it.
language: Replace es-x/no-array-prototype-keys/values with no-restricted-syntax
Fixes #488
I was also negatively surprised by
es-x/no-array-prototype-keys
andes-x/no-array-prototype-values
. I learned about the changes when I noticed noticed all three being disabled in https://gerrit.wikimedia.org/r/c/mediawiki/extensions/UploadWizard/+/838537.In particular,
es-x/no-array-prototype-keys
is triggered byObject.keys( foo )
, which is obviously not calling the method being disallowed.Back in the day, when we first disallowed some methods in 57b2fdc, we were actually smart enough to disallow
foo.keys()
without disallowingObject.keys( foo )
: 57b2fdc#diff-994979481b5e2ff41767c0b7f3485267ce7402a2c0f9a66945ff2785959927a0R88-R91 so I'm hopeful that this kind of solution can be restored.
Per https://ota-meshi.github.io/eslint-plugin-es-x/rules/no-symbol-prototype-description.html#es-x-no-symbol-prototype-description:
This rule is silent by default because it's hard to know types. You need to configure the aggressive mode or TypeScript in order to enable this rule.
Which means this triggers many false positives on any object property called description
.
Reported offline by @matmarex
Too many false positives with Object.keys, and no desire to fix the issue upstream.
Ping @ota-meshi .
To summarise: we get value from the Array.prototype.keys rules, but it should be able to easily ignore the obvious case of Object.keys
, otherwise it produces too many false positives.
Thus would make the "copy" wiki button work more as expected, and could also be displayed in the table (in some compact form).
Note this is just a warning, the linter still works.