vscode的更漂亮的设置 [英] prettier settings for vscode

查看:335
本文介绍了vscode的更漂亮的设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近切换到一台新计算机,但在设置更漂亮的设置时遇到了困难。 (我认为这可能更漂亮,可以保留)。

I recently switched to a new computer, and am having difficulty with a prettier setting. (I think it's prettier, could be eslint).

此gif说明发生了什么:
http://g.recordit.co/H871hfT9Sv.gif

This gif illustrates what's happening: http://g.recordit.co/H871hfT9Sv.gif

有人知道这个设置叫什么吗?我希望所有导入都在一行上,除非长度扩展了 printWidth 设置。

Anyone know what this setting is called? I would prefer all imports to be on a single line unless the length extends the printWidth setting.

这是我的VS代码中的相关用户设置:

Here are my relevant User Settings from VS Code:

{
  "prettier.printWidth": 100,
  "prettier.semi": false,
  "prettier.singleQuote": true,
  "prettier.trailingComma": "all"
}

谢谢!

编辑:
直观描述,您不必

Visual depiction so you don't need to watch the gif.

预期:

import React from 'react'
import { Dimensions, StyleSheet, View } from 'react-native'
import LinearGradient from 'react-native-linear-gradient'
import { isIphoneX } from 'react-native-iphone-x-helper'

行为:(不需要)

import React from 'react'
import {
  Dimensions,
  StyleSheet,
  View
} from 'react-native'
import LinearGradient from 'react-native-linear-gradient'
import {
  isIphoneX
} from 'react-native-iphone-x-helper'


推荐答案

对于那些试图快速更改VS Code的更漂亮设置的人。步骤如下:

For those trying to quickly change Prettier settings for VS Code. Here are the steps:


  1. 转到文件->偏好设置->设置。 (VS代码菜单)

  2. 应该打开设置窗口。在(顶部)上方有一个搜索。键入漂亮

  3. 您应该看到可用的漂亮设置。您可以修改它们:)

这篇关于vscode的更漂亮的设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆