]> cat aescling's git repositories - mastodon.git/commitdiff
[Glitch] Code style improvements in JavaScript
authorBèr Kessels <ber@berk.es>
Sun, 8 Mar 2020 15:02:36 +0000 (16:02 +0100)
committerThibaut Girka <thib@sitedethib.com>
Sun, 8 Mar 2020 19:43:53 +0000 (20:43 +0100)
Port fd76955f3942bbd7ec830ab535bc31621cac14a4 to glitch-soc

* JS-linter: fix trailing comma's

* Configure eslinter to ignore this onchange error.

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
16 files changed:
app/javascript/flavours/glitch/components/intersection_observer_article.js
app/javascript/flavours/glitch/features/blocks/index.js
app/javascript/flavours/glitch/features/compose/components/poll_form.js
app/javascript/flavours/glitch/features/domain_blocks/index.js
app/javascript/flavours/glitch/features/favourites/index.js
app/javascript/flavours/glitch/features/follow_requests/index.js
app/javascript/flavours/glitch/features/followers/index.js
app/javascript/flavours/glitch/features/following/index.js
app/javascript/flavours/glitch/features/lists/index.js
app/javascript/flavours/glitch/features/mutes/index.js
app/javascript/flavours/glitch/features/reblogs/index.js
app/javascript/flavours/glitch/features/status/components/card.js
app/javascript/flavours/glitch/reducers/notifications.js
app/javascript/flavours/glitch/reducers/timelines.js
app/javascript/flavours/glitch/selectors/index.js
app/javascript/flavours/glitch/store/configureStore.js

index 03b3700df4c9d31840358f417c9c3446e77d4796..88f29892e82209bb15d277b7c0311de43af66816 100644 (file)
@@ -45,7 +45,7 @@ export default class IntersectionObserverArticle extends React.Component {
     intersectionObserverWrapper.observe(
       id,
       this.node,
-      this.handleIntersection
+      this.handleIntersection,
     );
 
     this.componentMounted = true;
index 9eb6fe02ed5df8820ab60f348a9412dc022cf149..4992689ff571ca50d370c06b3f1582f1427c55c5 100644 (file)
@@ -66,7 +66,7 @@ class Blocks extends ImmutablePureComponent {
           bindToDocument={!multiColumn}
         >
           {accountIds.map(id =>
-            <AccountContainer key={id} id={id} />
+            <AccountContainer key={id} id={id} />,
           )}
         </ScrollableList>
       </Column>
index 3d818ea20ac76a8c8470d931df41b9d1b6326690..2dce5441806743b733483b1d32edc0cf30705ec9 100644 (file)
@@ -143,6 +143,7 @@ class PollForm extends ImmutablePureComponent {
             <option value='true'>{intl.formatMessage(messages.multiple_choices)}</option>
           </select>
 
+          {/* eslint-disable-next-line jsx-a11y/no-onchange */}
           <select value={expiresIn} onChange={this.handleSelectDuration}>
             <option value={300}>{intl.formatMessage(messages.minutes, { number: 5 })}</option>
             <option value={1800}>{intl.formatMessage(messages.minutes, { number: 30 })}</option>
index cd105a49bdebfe1d0c605dafdcc0100694c180fd..c53d32ebbd996ffca919c418033e4d7cf5c6dfdc 100644 (file)
@@ -67,7 +67,7 @@ class Blocks extends ImmutablePureComponent {
           bindToDocument={!multiColumn}
         >
           {domains.map(domain =>
-            <DomainContainer key={domain} domain={domain} />
+            <DomainContainer key={domain} domain={domain} />,
           )}
         </ScrollableList>
       </Column>
index 953bf171f9ffcf4525def3c5b990ce9d066883e2..bd6f782ce10dc8aa4aee5677f83d25f7f3ecfb2b 100644 (file)
@@ -88,7 +88,7 @@ class Favourites extends ImmutablePureComponent {
           bindToDocument={!multiColumn}
         >
           {accountIds.map(id =>
-            <AccountContainer key={id} id={id} withNote={false} />
+            <AccountContainer key={id} id={id} withNote={false} />,
           )}
         </ScrollableList>
       </Column>
index 36770aaceed852c7626e44652272926df5aaf5b6..10522bf30f197cf80cd683501de5874cc2b973b0 100644 (file)
@@ -67,7 +67,7 @@ class FollowRequests extends ImmutablePureComponent {
           bindToDocument={!multiColumn}
         >
           {accountIds.map(id =>
-            <AccountAuthorizeContainer key={id} id={id} />
+            <AccountAuthorizeContainer key={id} id={id} />,
           )}
         </ScrollableList>
       </Column>
index c78dcc8e445d5b3c66b66e391bab1e614011105e..2b86cc805a2bac3ad538537214ec671a266fc1c6 100644 (file)
@@ -105,7 +105,7 @@ class Followers extends ImmutablePureComponent {
           bindToDocument={!multiColumn}
         >
           {accountIds.map(id =>
-            <AccountContainer key={id} id={id} withNote={false} />
+            <AccountContainer key={id} id={id} withNote={false} />,
           )}
         </ScrollableList>
       </Column>
index df7c19c22bb892485bfa0c0305b053b6b4fa8605..cf374e4941ddadbdbac377e39f52e836cd751f64 100644 (file)
@@ -105,7 +105,7 @@ class Following extends ImmutablePureComponent {
           bindToDocument={!multiColumn}
         >
           {accountIds.map(id =>
-            <AccountContainer key={id} id={id} withNote={false} />
+            <AccountContainer key={id} id={id} withNote={false} />,
           )}
         </ScrollableList>
       </Column>
index adde3dd5c81ccbc7ec347b622b35c6df77565218..e384f301b6e47fa7debf98765c0c1ee1daded78d 100644 (file)
@@ -73,7 +73,7 @@ class Lists extends ImmutablePureComponent {
           bindToDocument={!multiColumn}
         >
           {lists.map(list =>
-            <ColumnLink key={list.get('id')} to={`/timelines/list/${list.get('id')}`} icon='list-ul' text={list.get('title')} />
+            <ColumnLink key={list.get('id')} to={`/timelines/list/${list.get('id')}`} icon='list-ul' text={list.get('title')} />,
           )}
         </ScrollableList>
       </Column>
index c27a530d50b835e417ac00eef158702a45102c33..62dccd971b365d7790c1f340336f73417da11c2f 100644 (file)
@@ -66,7 +66,7 @@ class Mutes extends ImmutablePureComponent {
           bindToDocument={!multiColumn}
         >
           {accountIds.map(id =>
-            <AccountContainer key={id} id={id} />
+            <AccountContainer key={id} id={id} />,
           )}
         </ScrollableList>
       </Column>
index 25807035828be3891fc8c0034d0c801a3853df6f..d88916d19e0ea681f72ff2df1fd79579b21223ad 100644 (file)
@@ -89,7 +89,7 @@ class Reblogs extends ImmutablePureComponent {
           bindToDocument={!multiColumn}
         >
           {accountIds.map(id =>
-            <AccountContainer key={id} id={id} withNote={false} />
+            <AccountContainer key={id} id={id} withNote={false} />,
           )}
         </ScrollableList>
       </Column>
index 7352dc6b48121ff80fec66c78d26615d47a86a9b..e3ee7dadaf4a3213f308dc0af9e87c3af55f8faf 100644 (file)
@@ -90,7 +90,7 @@ export default class Card extends React.PureComponent {
           },
         },
       ]),
-      0
+      0,
     );
   };
 
index d0eb7bb5ab1aee365f0ee12bb531dec108ce99a2..31d9611a327ac56199649bbdf82d5efeb027d3d9 100644 (file)
@@ -91,11 +91,11 @@ const expandNormalizedNotifications = (state, notifications, next, isLoadingRece
 
       mutable.update(usePendingItems ? 'pendingItems' : 'items', list => {
         const lastIndex = 1 + list.findLastIndex(
-          item => item !== null && (compareId(item.get('id'), items.last().get('id')) > 0 || item.get('id') === items.last().get('id'))
+          item => item !== null && (compareId(item.get('id'), items.last().get('id')) > 0 || item.get('id') === items.last().get('id')),
         );
 
         const firstIndex = 1 + list.take(lastIndex).findLastIndex(
-          item => item !== null && compareId(item.get('id'), items.first().get('id')) > 0
+          item => item !== null && compareId(item.get('id'), items.first().get('id')) > 0,
         );
 
         return list.take(firstIndex).concat(items, list.skip(lastIndex));
index 1ea9ed645f583fec2c65d075520ee810e4493007..be7b2441b1e1f201ceabbde9dc4b05e2575fa8d1 100644 (file)
@@ -53,7 +53,7 @@ const expandNormalizedTimeline = (state, timeline, statuses, next, isPartial, is
 
         return oldIds.take(firstIndex + 1).concat(
           isPartial && oldIds.get(firstIndex) !== null ? newIds.unshift(null) : newIds,
-          oldIds.skip(lastIndex)
+          oldIds.skip(lastIndex),
         );
       });
     }
@@ -171,7 +171,7 @@ export default function timelines(state = initialState, action) {
     return state.update(
       action.timeline,
       initialTimeline,
-      map => map.set('online', false).update(action.usePendingItems ? 'pendingItems' : 'items', items => items.first() ? items.unshift(null) : items)
+      map => map.set('online', false).update(action.usePendingItems ? 'pendingItems' : 'items', items => items.first() ? items.unshift(null) : items),
     );
   default:
     return state;
index ab7dac66ae5a833ae0d9659a1c2b06eee1e49db4..4a3303c362262943162082f0aac92b889b21372b 100644 (file)
@@ -146,7 +146,7 @@ export const makeGetStatus = () => {
         map.set('account', accountBase);
         map.set('filtered', filtered);
       });
-    }
+    },
   );
 };
 
index 7e7472841aa74676e2ca6b6c62f556f4f2292af2..e18af842ff9e1d8e5beafbb8986b7d2d77c50a8b 100644 (file)
@@ -10,6 +10,6 @@ export default function configureStore() {
     thunk,
     loadingBarMiddleware({ promiseTypeSuffixes: ['REQUEST', 'SUCCESS', 'FAIL'] }),
     errorsMiddleware(),
-    soundsMiddleware()
+    soundsMiddleware(),
   ), window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__() : f => f));
 };