VSCode = Visual Studio Code 에서 사용할 수 있는 확장(Extension) 입니다.


VSCode 에서 코드를 이쁘게 변경해 주는 확장입니다.


링크 : https://marketplace.visualstudio.com/items?itemName=HookyQR.beautify




Visual Studio Code 에서 javascript, JSON, CSS, Sass 와 HTML 의 코드를 이쁘게 변경해 줍니다.


CSS 변경전


CSS 변경후


.jsbeautifyrc settingVS Code setting
eolfiles.eol
tab_sizeeditor.tabSize
indent_with_tabs (inverted)editor.insertSpaces
wrap_line_lengthhtml.format.wrapLineLength
wrap_attributeshtml.format.wrapAttributes
unformattedhtml.format.unformatted
indent_inner_htmlhtml.format.indentInnerHtml
preserve_newlineshtml.format.preserveNewLines
max_preserve_newlineshtml.format.maxPreserveNewLines
indent_handlebarshtml.format.indentHandlebars
end_with_newlinehtml.format.endWithNewline (html)
end_with_newlinefile.insertFinalNewLine (css, js)
extra_linershtml.format.extraLiners
space_after_anon_functionjavascript.format
.insertSpaceAfterFunctionKeywordForAnonymousFunctions
space_in_parenjavascript.format
.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis

Note that the html.format settings will ONLY be used when the document is html. javascript.format settings are included always.

Also runs html and css beautify from the same package, as determined by the file extension. The schema indicates which beautifier each of the settings pertains to.

The .jsbeautifyrc config parser accepts sub elements of htmljs and css so that different settings can be used for each of the beautifiers (like sublime allows). Note that this will cause the config file to be incorrectly structured for running js-beautify from the command line.

Settings are inherited from the base of the file. Thus:

{
  "indent_size": 4,
  "indent_char": " ",
  "css": {
    "indent_size": 2
  }
}

Will result in the indent_size being set to 4 for JavaScript and HTML, but set to 2 for CSS. All will get the same indent_char setting.

If the file is unsaved, or the type is undetermined, you'll be prompted for which beautifier to use.

You can control which file types, extensions, or specific file names should be beautified with the beautify.languagesetting.

{
  "beautify.language": {
    "js": {
      "type": ["javascript", "json"],
      "filename": [".jshintrc", ".jsbeautifyrc"]
      // "ext": ["js", "json"]
      // ^^ to set extensions to be beautified using the javascript beautifier
    },
    "css": ["css", "scss"],
    "html": ["htm", "html"]
    // ^^ providing just an array sets the VS Code file type
  }
}

Beautify on save will be enabled when "editor.formatOnSave" is true.

Beautification on particular files using the built in Format Document (which includes formatting on save) can be skipped with the beautify.ignore option. Using the Beautify file and Beautify selection will still work. For files opened from within the workspace directory, the glob patterns will match from the workspace root. For files opened from elsewhere, or when no workspace is open, the patterns will match from the system root.

Examples:

/* ignore all files named 'test.js' not in the root folder,
   all files directly in any 'spec' directory, and
   all files in any 'test' directory at any depth
*/
"beautify.ignore": ["*/test.js", "**/spec/*", "**/test/**/*"]

/* ignore all files ending in '_test.js' anywhere */
"beautify.ignore": "**/*_test.js"

Note that the glob patterns are not used to test against the containing folder. You must match the filename as well.

Embedded version of js-beautify is v1.8.4

Use the following to embed a beautify shortcut in keybindings.json. Replace with your preferred key bindings.

{
  "key": "cmd+b",
  "command": "HookyQR.beautify",
  "when": "editorFocus"
}


VSCode = Visual Studio Code 에서 사용할 수 있는 확장(Extension) 입니다.


prettier/prettier 를 사용한 코드 포맷터 ( JavaScript / TypeScript / Css / HTML 등 지원 )


링크 : https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode





Respects editor.formatOnSave setting.

설정 범위를 지정하여 언어별 저장시 포맷을 사용하도록 설정할 수 있습니다.

// Set the default
"editor.formatOnSave": false,
// Enable per-language
"[javascript]": {
    "editor.formatOnSave": true
}


Settings will be read from (우선순위로 나열):

  1. Prettier configuration file
  2. .editorconfig

Or if no prettier configuration file exist

  1. .editorconfig
  2. VSCode prettier's settings (기본값은 아래 설명되어 있음)

Fit code within this line limit

Number of spaces it should use per tab

If true, will use single instead of double quotes

Controls the printing of trailing commas wherever possible. Valid options:

  • "none" - No trailing commas
  • "es5" - Trailing commas where valid in ES5 (objects, arrays, etc)
  • "all" - Trailing commas wherever possible (function arguments)

Controls the printing of spaces inside object literals

If true, puts the > of a multi-line jsx element at the end of the last line instead of being alone on the next line

Which parser to use. Valid options are 'flow' and 'babylon'.

Whether to add a semicolon at the end of every line (semi: true), or only at the beginning of lines that may introduce ASI failures (semi: false)

If true, indent lines with tabs

(Markdown) wrap prose over multiple lines.

Include parentheses around a sole arrow function parameter

Use single quotes instead of double quotes in JSX.

Specify the global whitespace sensitivity for HTML files. Learn more here

Specify the end of line used by prettier. Learn more here

These settings are specific to VSCode and need to be set in the VSCode settings file. See the documentation for how to do that.

Use prettier-eslint instead of prettier. Other settings will only be fallbacks in case they could not be inferred from ESLint rules.

Use prettier-tslint instead of prettier. Other settings will only be fallbacks in case they could not be inferred from TSLint rules.

Use prettier-stylelint instead of prettier. Other settings will only be fallbacks in case they could not be inferred from stylelint rules.

Require a 'prettierconfig' to format

Supply the path to an ignore file such as .gitignore or .prettierignore. Files which match will not be formatted. Set to null to not read ignore files. Restart required.

A list of languages IDs to disable this extension on. Restart required. Note: Disabling a language enabled in a parent folder will prevent formatting instead of letting any other formatter to run

This extension will use prettier from your project's local dependencies. Should prettier not be installed locally with your project's dependencies, a copy will be bundled with the extension.

VSCode = Visual Studio Code 에서 사용할 수 있는 확장(Extension) 입니다.


ftp/sftp 동기화 확장입니다.


링크 : https://marketplace.visualstudio.com/items?itemName=liximomo.sftp




매우 강력하고 스마트한 기능. 매우 간단하고, 세 줄의 설정 만 필요합니다! 매우 빠르며 눈 깜짝할 사이 끝납니다.


  • 원격 탐색기로 원격 브라우저
  • 로컬 및 원격 비교
  • 디렉토리 동기화
  • 업로드 / 다운로드
  • 저장시 업로드
  • 파일 감시자
  • 다중 구성
  • 전환 가능한 프로필


{
  "host": "host",
  "username": "username",
  "remotePath": "/remote/workspace"
}
{
  "username": "username",
  "password": "password",
  "remotePath": "/remote/workspace/a",
  "watcher": {
    "files": "dist/*.{js,css}",
    "autoUpload": false,
    "autoDelete": false
  },
  "profiles": {
    "dev": {
      "host": "dev-host",
      "remotePath": "/dev",
      "uploadOnSave": true
    },
    "prod": {
      "host": "prod-host",
      "remotePath": "/prod"
    }
  },
  "defaultProfile": "dev"
}

Note: context and watcher are only avaliable at root level.

Use SFTP: Set Profile to swtich profile.

[
  {
    "name": "server1",
    "context": "/project/build",
    "host": "host",
    "username": "username",
    "password": "password",
    "remotePath": "/remote/project/build"
  },
  {
    "name": "server2",
    "context": "/project/src",
    "host": "host",
    "username": "username",
    "password": "password",
    "remotePath": "/remote/project/src"
  }
]

Note: name is required in this mode.

You can connection to a target server through a proxy with ssh protocol.

Note: Variable substitution is not working in a hop config.

local -> hop -> target

{
  "name": "target",
  "host": "targetHost",
  "username": "targetUsername",
  "privateKeyPath": "~/.ssh/id_rsa",
  "remotePath": "/path/in/target",
  "hop": {
    "host": "hopHost",
    "username": "hopUsername",
    "privateKeyPath": "/Users/hopUsername/.ssh/id_rsa" // The key file is assumed on the hop.
  }
}

local -> hopA -> hopB -> target

{
  "name": "target",
  "host": "targetHost",
  "username": "targetUsername",
  "privateKeyPath": "~/.ssh/id_rsa",
  "remotePath": "/path/in/target",
  "hop": [
    {
      "host": "hopAHost",
      "username": "hopAUsername",
      "privateKeyPath": "/Users/hopAUsername/.ssh/id_rsa"
    },
    {
      "host": "hopBHost",
      "username": "hopBUsername",
      "privateKeyPath": "/Users/hopBUsername/.ssh/id_rsa"
    }
  ]
}

You can use remote to tell sftp to get the config from remote-fs.

In User Setting:

"remotefs.remote": {
  "dev": {
    "scheme": "sftp",
    "host": "host",
    "username": "username",
    "rootPath": "/path/to/somewhere"
  },
  "projectX": {
    "scheme": "sftp",
    "host": "host",
    "username": "username",
    "privateKeyPath": "/Users/xx/.ssh/id_rsa",
    "rootPath": "/home/foo/some/projectx"
  }
}

In sftp.json:

{
  "remote": "dev",
  "remotePath": "/home/xx/",
  "uploadOnSave": true,
  "ignore": [".vscode", ".git", ".DS_Store"]
}




자세한 설정 및 명령어는 WIKI ( https://github.com/liximomo/vscode-sftp/wiki ) 를 참고하세요.

VSCode = Visual Studio Code 에서 사용할 수 있는 확장(Extension) 입니다.


package.json 파일에 정의된 실행중인 npm 스크립트를 지원하고, 설치된 모듈에 대해 유효성을 검사하는 확장입니다.


링크 : https://marketplace.visualstudio.com/items?itemName=eg2.vscode-npm-script




package.json 검증 모듈에 대한 경고를보고합니다

  • package.json 에 정의되어 있지만 설치되지 않은 패키지
  • 설치되어 있지만 package.json 에 정의되어 있지 않은 패키지
  • 설치되어 있지만 package.json 에 정의 된 버전을 충족시키지 못한 패키지


보고된 경고에 대해 실행 가능한 빠른 수정이 제공됩니다.


아래와 같은 npm 명령을 사용할 수 있습니다.


 

'언어 > Script' 카테고리의 다른 글

Node Debug - Node.js 디버그  (0) 2018.12.06
npm Intellisense - npm 자동 완성  (1) 2018.11.15
JavaScript (ES6) code snippets - ES6용 코드 스니펫  (0) 2018.10.08

+ Recent posts