🎨 Format SnackPlayer code snippets#1752
🎨 Format SnackPlayer code snippets#1752cHaLkdusT wants to merge 1 commit intofacebook:masterfrom cHaLkdusT:consistent-SnackPlayer-code-snippets
Conversation
|
Deploy preview for react-native ready! Built with commit 3f0f4e7 https://deploy-preview-1752--react-native.netlify.com Changes to Thank you for your contributions. |
nearestnabors
left a comment
There was a problem hiding this comment.
Could you see about updating the config so imports are not multi-lined? I hate seeing a third of the Snack window consumed by importing View, Input, Text, etc..
|
IMO this PR should be in hold until Component Docs Drive (#1579) is finished. |
|
Hi @rachelnabors, I've checked Prettier config, unfortunately, there's no option to make imports not multi-lined. There's an on-going discussion here: prettier/prettier#5995 Would you like revert files with multi-lined imports instead? |
| </TouchableOpacity> | ||
| ) | ||
| } | ||
| export default (App = () => { |
There was a problem hiding this comment.
Curly braces after export default are unnecessary (and a bit confusing). It will be nice to omit them if config allows to.
There was a problem hiding this comment.
I'm not seeing where we can add that: https://prettier.io/docs/en/options.html
There was a problem hiding this comment.
It's look like for me as ESLint/Prettier issue with this particular construction. Expo Snack editor also adds those brackets on autoformat. I'm not sure why though since export is an expression/directive not a function or variable.
|
|
||
| import React, { useState, useEffect } from "react"; | ||
| import { AccessibilityInfo, View, Text, StyleSheet } from "react-native"; | ||
| import React, {useState, useEffect} from 'react'; |
There was a problem hiding this comment.
As long as I'm looking of this I'm not sure if disabling bracket spacing is a good change.
I think that having those spaces improves overall readability of the code (especially when function uses object as a parameter).
|
Sorry to close this... I updated Prettier to be a little more readable based on the conversation here and am landing redundant updates. But THANK YOU for bringing this conversation to light! Sometimes discussions themselves are worth the PR :) |
Make all SnackPlayer code snippets consistent with our Prettier config