From c6f23648a300f08e544bb5c2e8b8e9cb4d501e8b Mon Sep 17 00:00:00 2001 From: Lens0021 / Leslie Date: Tue, 12 Nov 2024 21:21:21 +0900 Subject: [PATCH] prettier: Set trailingComman to es5 (#211) --- .github/workflows/apply.yml | 2 ++ .github/workflows/gadget-lint.yaml | 2 ++ ...{update_mirrors.yml => update-mirrors.yml} | 0 .prettierrc.yml | 1 + .../bookflap/mediawiki%3Agadget-bookflap.js | 6 +++--- .../mediawiki%3Agadget-create-redirect.js | 8 ++++---- ...mediawiki%3Agadget-hide-insulting-names.js | 2 +- .../imageview/mediawiki%3Agadget-imageview.js | 8 ++++---- gadgets/mute/mediawiki%3Agadget-mute.js | 8 ++++---- .../mediawiki%3Agadget-rc-lazy-load.js | 6 +++--- ...iki%3Agadget-visual-editor-for-femiwiki.js | 20 +++++++++---------- 11 files changed, 34 insertions(+), 29 deletions(-) rename .github/workflows/{update_mirrors.yml => update-mirrors.yml} (100%) diff --git a/.github/workflows/apply.yml b/.github/workflows/apply.yml index 15de3fe..2fa2212 100644 --- a/.github/workflows/apply.yml +++ b/.github/workflows/apply.yml @@ -15,6 +15,8 @@ jobs: with: fetch-depth: 30 + - uses: actions/setup-node@v4 + - uses: actions/setup-python@v5 with: python-version: '3.x' diff --git a/.github/workflows/gadget-lint.yaml b/.github/workflows/gadget-lint.yaml index e075452..ea4c5db 100644 --- a/.github/workflows/gadget-lint.yaml +++ b/.github/workflows/gadget-lint.yaml @@ -17,6 +17,8 @@ jobs: steps: - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + - name: Get yarn cache id: yarn-cache run: echo "::set-output name=dir::$(yarn cache dir)" diff --git a/.github/workflows/update_mirrors.yml b/.github/workflows/update-mirrors.yml similarity index 100% rename from .github/workflows/update_mirrors.yml rename to .github/workflows/update-mirrors.yml diff --git a/.prettierrc.yml b/.prettierrc.yml index 467e467..00a628c 100644 --- a/.prettierrc.yml +++ b/.prettierrc.yml @@ -1,4 +1,5 @@ singleQuote: true +trailingComma: es5 overrides: - files: "gadgets/**/{G,g}adget_definition:*" options: diff --git a/gadgets/bookflap/mediawiki%3Agadget-bookflap.js b/gadgets/bookflap/mediawiki%3Agadget-bookflap.js index af82561..27ad7a2 100644 --- a/gadgets/bookflap/mediawiki%3Agadget-bookflap.js +++ b/gadgets/bookflap/mediawiki%3Agadget-bookflap.js @@ -32,13 +32,13 @@ $raws.each(function () { var $title = $(this).find( - '.book-flap-title a, .book-flap-title .mw-selflink', + '.book-flap-title a, .book-flap-title .mw-selflink' ); var $slideBookFlap = $('
') .addClass('book-flap-slide') .html($(this).find('book-flap-raw book-flap-title')) .append( - $(this).find('.book-flap-body').clone().addClass('mw-parser-output'), + $(this).find('.book-flap-body').clone().addClass('mw-parser-output') ) .appendTo($overlay); @@ -85,7 +85,7 @@ .addClass('book-flap-side') .html($(this).find('book-flap-raw book-flap-title')) .append( - $(this).find('.book-flap-body').clone().addClass('mw-parser-output'), + $(this).find('.book-flap-body').clone().addClass('mw-parser-output') ) .appendTo($(this).hasClass('book-flap-left') ? $leftside : $rightside) .hide() diff --git a/gadgets/create-redirect/mediawiki%3Agadget-create-redirect.js b/gadgets/create-redirect/mediawiki%3Agadget-create-redirect.js index 289e589..94a3274 100644 --- a/gadgets/create-redirect/mediawiki%3Agadget-create-redirect.js +++ b/gadgets/create-redirect/mediawiki%3Agadget-create-redirect.js @@ -11,8 +11,8 @@ '#', '여기로 넘겨주기', 'p-createRedirect', - '이 문서로 오는 넘겨주기 문서를 만듭니다.', - ), + '이 문서로 오는 넘겨주기 문서를 만듭니다.' + ) ).on('click', function (e) { e.preventDefault(); target = mw.config.get('wgPageName').replace(/_/g, ' '); @@ -62,7 +62,7 @@ title + '" 문서에서 "' + target + - '" 문서로 넘겨주기를 만드시겠습니까?', + '" 문서로 넘겨주기를 만드시겠습니까?' ) .done(function (confirmed) { if (confirmed) { @@ -75,7 +75,7 @@ '" 문서에서 ' + '"' + target + - '" 문서로 넘겨주기 문서가 생성되었습니다.', + '" 문서로 넘겨주기 문서가 생성되었습니다.' ); }) .fail(function (e) { diff --git a/gadgets/hide-insulting-names/mediawiki%3Agadget-hide-insulting-names.js b/gadgets/hide-insulting-names/mediawiki%3Agadget-hide-insulting-names.js index 211e985..a8bb631 100644 --- a/gadgets/hide-insulting-names/mediawiki%3Agadget-hide-insulting-names.js +++ b/gadgets/hide-insulting-names/mediawiki%3Agadget-hide-insulting-names.js @@ -17,7 +17,7 @@ if (isLinkToSanction) { $(this).html( - '사용자:' + substitute + ' 님에 대한 부적절한 사용자명 변경 건의', + '사용자:' + substitute + ' 님에 대한 부적절한 사용자명 변경 건의' ); } }); diff --git a/gadgets/imageview/mediawiki%3Agadget-imageview.js b/gadgets/imageview/mediawiki%3Agadget-imageview.js index 14bf3f5..b292daf 100644 --- a/gadgets/imageview/mediawiki%3Agadget-imageview.js +++ b/gadgets/imageview/mediawiki%3Agadget-imageview.js @@ -17,9 +17,9 @@ $('') .attr( 'src', - 'https://upload.wikimedia.org/wikipedia/commons/d/de/Ajax-loader.gif', + 'https://upload.wikimedia.org/wikipedia/commons/d/de/Ajax-loader.gif' ) - .addClass('loading-spinner'), + .addClass('loading-spinner') ); $('body').css('overflow', 'hidden'); @@ -29,7 +29,7 @@ titles: decodeURI( $(this) .attr('href') - .match(/\/([^/]+)$/)[1], + .match(/\/([^/]+)$/)[1] ), prop: 'imageinfo', iiprop: 'url', @@ -42,7 +42,7 @@ }); overlay.append( - $('').attr('src', imageSource).addClass('image'), + $('').attr('src', imageSource).addClass('image') ); }); }); diff --git a/gadgets/mute/mediawiki%3Agadget-mute.js b/gadgets/mute/mediawiki%3Agadget-mute.js index 871944b..292e9db 100644 --- a/gadgets/mute/mediawiki%3Agadget-mute.js +++ b/gadgets/mute/mediawiki%3Agadget-mute.js @@ -13,7 +13,7 @@ ' 여러 브라우저로 페미위키를 이용하시는 분들은 각 브라우저별로' + ' 키워드를 등록해주시기 바랍니다.' + '

' + - '', + '' ); function _initUI() { @@ -25,8 +25,8 @@ '#', '뮤트', 'p-mute', - '금지어를 설정합니다.', - ), + '금지어를 설정합니다.' + ) ).on('click', function (e) { e.preventDefault(); $editorEl.show(); @@ -58,7 +58,7 @@ $('#mw-content-text').prepend( '
' + '가림 단어가 포함된 문서입니다. 이 문서의 제목 또는 본문에 한 개 이상의 가림 단어가 있습니다.' + - '
', + '' ); } diff --git a/gadgets/rc-lazy-load/mediawiki%3Agadget-rc-lazy-load.js b/gadgets/rc-lazy-load/mediawiki%3Agadget-rc-lazy-load.js index cc79bc3..cc2e52a 100644 --- a/gadgets/rc-lazy-load/mediawiki%3Agadget-rc-lazy-load.js +++ b/gadgets/rc-lazy-load/mediawiki%3Agadget-rc-lazy-load.js @@ -9,7 +9,7 @@ // 바뀐글 링크를 limit가 0인 링크로 바꿉니다. $('#site-navigation .changes a').attr( 'href', - $('#site-navigation .changes a').attr('href') + '?limit=0', + $('#site-navigation .changes a').attr('href') + '?limit=0' ); if ( @@ -46,12 +46,12 @@ // limit를 50으로 변경하는 버튼 var btn = $( - '.mw-rcfilters-ui-changesLimitPopupWidget .oo-ui-buttonSelectWidget a', + '.mw-rcfilters-ui-changesLimitPopupWidget .oo-ui-buttonSelectWidget a' ).eq(limitButtonIndex); // 버튼을 누르는 동작을 흉내냅니다. 즉 limit를 50으로 다시 설정합니다. btn.trigger( - jQuery.Event('mousedown', { which: OO.ui.MouseButtons.LEFT }), + jQuery.Event('mousedown', { which: OO.ui.MouseButtons.LEFT }) ); btn[0].dispatchEvent(new MouseEvent('mouseup')); }); diff --git a/gadgets/visual-editor-for-femiwiki/mediawiki%3Agadget-visual-editor-for-femiwiki.js b/gadgets/visual-editor-for-femiwiki/mediawiki%3Agadget-visual-editor-for-femiwiki.js index ec7812b..265c7b6 100644 --- a/gadgets/visual-editor-for-femiwiki/mediawiki%3Agadget-visual-editor-for-femiwiki.js +++ b/gadgets/visual-editor-for-femiwiki/mediawiki%3Agadget-visual-editor-for-femiwiki.js @@ -12,7 +12,7 @@ var AddReferencesListCommand = function () { AddReferencesListCommand.parent.call( this, - 'addReferencesList', // Command name + 'addReferencesList' // Command name ); }; OO.inheritClass(AddReferencesListCommand, ve.ui.Command); @@ -46,7 +46,7 @@ isResponsive: mw.config.get('wgCiteResponsiveReferences'), }, }) - .concat({ type: '/mwReferencesList' }), + .concat({ type: '/mwReferencesList' }) ) .collapseToEnd() .select(); @@ -61,8 +61,8 @@ 'addReferencesList', // Sequence name 'addReferencesList', // Command name '=r', - 2, - ), + 2 + ) ); ve.ui.commandHelpRegistry.register('insert', 'addReferencesList', { @@ -86,7 +86,7 @@ // Parent constructor AddNotesSectionCommand.parent.call( this, - 'addNotesSection', // Command name + 'addNotesSection' // Command name ); }; OO.inheritClass(AddNotesSectionCommand, ve.ui.Command); @@ -130,7 +130,7 @@ }, }, }) - .concat({ type: '/mwTransclusionBlock' }), + .concat({ type: '/mwTransclusionBlock' }) ) .collapseToEnd() .select(); @@ -145,8 +145,8 @@ 'addNotesSection', // Sequence name 'addNotesSection', // Command name '=n', - 2, - ), + 2 + ) ); ve.ui.commandHelpRegistry.register('insert', 'addNotesSection', { @@ -203,8 +203,8 @@ 'dash', 'bulletWrapOnce', [{ type: 'paragraph' }, '-', ' '], - 2, - ), + 2 + ) ); ve.ui.commandHelpRegistry.register('formatting', 'listBullet', {