one-key-formatting - Fix duplicate formatting#9865
Conversation
|
This works but I'll have to look for more such instances. |
|
Apparently just these refined-github/source/features/unclip-checks.tsx Lines 9 to 16 in c313f23 refined-github/source/features/suggest-commit-title-limit.tsx Lines 41 to 53 in c313f23 |
|
@copilot extract those 2 "feature" delegate functions to the top level of their file |
…commit-title-limit
Done in the latest commit. Both callbacks are now named top-level functions:
|
| }], | ||
| 'byo/no-inline-functions': ['error', { | ||
| selector: | ||
| "CallExpression[callee.name='delegate'] > :matches(ArrowFunctionExpression, FunctionExpression, CallExpression)", |
There was a problem hiding this comment.
I had initially considered observe too, but:
- even if it adds two
animationstartlisteners, only one is fired - we still have a number of features (like
closing-remarks) that have one-off observe() calls and would need a refactoring
| type TextField = HTMLTextAreaElement | HTMLInputElement; | ||
| type KeydownHandler = DelegateEventHandler<KeyboardEvent, TextField>; | ||
|
|
||
| function onFieldKeydown(selector: string | readonly string[], callback: KeydownHandler, signal: AbortSignal): void { |
There was a problem hiding this comment.
Dropped internal onFieldKeydown helper because it made deduplication more difficult. A memoized callback filter is slightly easier to follow.
|
All good. It's might drop the lint rule once feature unloading is restored, but I still think it makes sense as a general rule regardless of that. |
Mentioned in #9860 (comment)
Test URLs
*Before
After