{"id":14984142,"url":"https://github.com/jonlabelle/sublimejsprettier","last_synced_at":"2025-05-15T01:04:26.990Z","repository":{"id":37677718,"uuid":"78929009","full_name":"jonlabelle/SublimeJsPrettier","owner":"jonlabelle","description":"JsPrettier is a Sublime Text Plug-in for Prettier, the opinionated code formatter.","archived":false,"fork":false,"pushed_at":"2025-04-05T16:32:35.000Z","size":2766,"stargazers_count":420,"open_issues_count":2,"forks_count":63,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-06T17:12:10.062Z","etag":null,"topics":["beautify","format","javascript","plugin","prettier","python","sublime-text"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonlabelle.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-01-14T08:37:03.000Z","updated_at":"2025-04-05T17:05:02.000Z","dependencies_parsed_at":"2024-01-14T15:25:05.451Z","dependency_job_id":"3d2a60b5-eef2-44a3-8589-53b88cb8af30","html_url":"https://github.com/jonlabelle/SublimeJsPrettier","commit_stats":{"total_commits":1204,"total_committers":35,"mean_commits":34.4,"dds":"0.039036544850498345","last_synced_commit":"59831ef0e3ac4653974948ad1698d31a61172212"},"previous_names":[],"tags_count":310,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonlabelle%2FSublimeJsPrettier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonlabelle%2FSublimeJsPrettier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonlabelle%2FSublimeJsPrettier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonlabelle%2FSublimeJsPrettier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonlabelle","download_url":"https://codeload.github.com/jonlabelle/SublimeJsPrettier/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248787195,"owners_count":21161565,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["beautify","format","javascript","plugin","prettier","python","sublime-text"],"created_at":"2024-09-24T14:08:32.364Z","updated_at":"2025-04-13T21:32:38.850Z","avatar_url":"https://github.com/jonlabelle.png","language":"Python","readme":"# JsPrettier\n\n[![ci](https://github.com/jonlabelle/SublimeJsPrettier/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/jonlabelle/SublimeJsPrettier/actions/workflows/ci.yml)\n[![Package Control Installs](https://img.shields.io/packagecontrol/dt/JsPrettier.svg?label=installs)](https://packagecontrol.io/packages/JsPrettier)\n[![Latest Release](https://img.shields.io/github/v/tag/jonlabelle/SublimeJsPrettier.svg?label=version\u0026sort=semver)](https://github.com/jonlabelle/SublimeJsPrettier/tags)\n[![MIT License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/jonlabelle/SublimeJsPrettier/blob/master/LICENSE)\n\n\u003e [JsPrettier] is a Sublime Text Plugin for [Prettier], the opinionated code\n\u003e formatter.\n\n[![Before and After JsPrettier](https://github.com/jonlabelle/SublimeJsPrettier/blob/master/screenshots/before_and_after.gif?raw=true)](https://github.com/jonlabelle/SublimeJsPrettier/blob/master/screenshots/demo.gif)\n\n\u003e [Watch a Quick Demo]\n\n---\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eTable of Contents\u003c/strong\u003e\u003c/summary\u003e\n\n- [Installation](#installation)\n    - [Requirements](#requirements)\n    - [Install Prettier](#install-prettier)\n    - [Install JsPrettier via Package Control](#install-jsprettier-via-package-control)\n    - [Install JsPrettier Manually](#install-jsprettier-manually)\n    - [Install JsPrettier Using Git](#install-jsprettier-using-git)\n- [Usage](#usage)\n    - [Command Scope](#command-scope)\n- [Plugin Settings and Prettier Options](#plugin-settings-and-prettier-options)\n    - [Plugin Settings](#plugin-settings)\n    - [Prettier Options](#prettier-options)\n    - [Project-level Settings](#project-level-settings)\n    - [Prettier Configuration Files](#prettier-configuration-files)\n- [Prettier Plugin Support](#prettier-plugin-support)\n    - [Prettier PHP](#prettier-php)\n    - [Prettier Community Plugins](#prettier-community-plugins)\n- [Issues](#issues)\n- [Changes](#changes)\n- [License](#license)\n- [Author](#author)\n\n\u003c/details\u003e\n\n## Installation\n\n[JsPrettier] is compatible with both Sublime Text 2 and 3, and all supported\nOperating Systems.\n\n### Requirements\n\n- [Sublime Text]\n- [Node.js]\n    - [npm], [pnpm], or [yarn]\n        - [Prettier]\n\n### Install Prettier\n\nIf you've already installed [Prettier], you're all set... otherwise:\n\n```bash\n# npm (local)\nnpm install --save-dev prettier\n\n# npm (globally)\nnpm install --global prettier\n\n# or\n\n# pnpm (local)\npnpm add -D prettier\n\n# pnpm (globally)\npnpm add -g prettier\n\n# or\n\n# yarn (local)\nyarn add prettier --dev\n\n# yarn (globally)\nyarn global add prettier\n```\n\n### Install JsPrettier via Package Control\n\nThe recommended way to install JsPrettier is via [Package Control].\n\nFrom the main application menu:\n\n1. Open the **Tools** Menu\n2. Select **Command Palette...**\n3. Choose **Package Control: Install Package**\n4. Type **JsPrettier** and select it to complete the installation\n\n### Install JsPrettier Manually\n\n1. Download the JsPrettier [zip file] from the GitHub repository.\n2. Extract the downloaded zip file.\n3. Move the extracted directory to your [Sublime Text Packages directory].\n4. Rename the extracted directory from `SublimeJsPrettier-master` to `JsPrettier`.\n\n**Default Sublime Text Packages Paths:** \u003ca name=\"default-st-paths\"\u003e\u003c/a\u003e\n\n- **OS X:** `~/Library/Application Support/Sublime Text [2|3]/Packages`\n- **Linux:** `~/.Sublime Text [2|3]/Packages`\n- **Windows:** `%APPDATA%/Sublime Text [2|3]/Packages`\n\n\u003e [!NOTE]  \n\u003e Replace the `[2|3]` part with the appropriate Sublime Text version for your\n\u003e installation.\n\n### Install JsPrettier Using Git\n\nIf you're a Git user, you can install [JsPrettier] and keep it up-to-date by\ncloning the repository directly into your [Sublime Text Packages directory].\n\n\u003e **TIP:** You can locate your Sublime Text Packages directory by using the\n\u003e application menu `Preferences` -\u003e `Browse Packages...`.\n\n```bash\ngit clone https://github.com/jonlabelle/SublimeJsPrettier.git \"JsPrettier\"\n```\n\n## Usage\n\nJsPrettier allows you to format your code using Prettier directly within Sublime Text.\n\nThere are three available options to format code:\n\n1. **Command Palette:** From the command palette (\u003ckbd\u003ectrl/cmd + shift + p\u003c/kbd\u003e), type **JsPrettier Format Code**.\n2. **Context Menu:** Right-click anywhere in the file to bring up the context menu and select **JsPrettier Format Code**.\n3. **Key Binding:** There is no default key binding to run Prettier, but here's how to [add your own].\n\n## Command Scope\n\nJsPrettier formats selected code first; if no selection is made, it formats the\nentire file. When `auto_format_on_save` is enabled, the entire file will be\nformatted on save.\n\nTo add a [custom key binding], open the Sublime Text key bindings file by\nnavigating to `Preferences -\u003e Key Bindings` and add the following configuration:\n\n```json\n{ \"keys\": [\"ctrl+alt+f\"], \"command\": \"js_prettier\" }\n```\n\n## Plugin Settings and Prettier Options\n\nConfigure plugin settings and Prettier options via the application menu:\n\n- **Preferences**\n    - **Package Settings**\n        - **JsPrettier**\n            - **Settings - Default** (to view the defaults)\n            - **Settings - User** (to override the defaults)\n\n### Plugin Settings\n\n- **debug** (default: ***false***)  \n    When enabled (*true*), debug info will print to the console - useful for\n    troubleshooting and inspecting generated commands passed to Prettier.\n    Enabling debug mode also sets Prettier's [`--log-level`] option to `debug`\n    (when not overridden by `additional_cli_args`), for printing additional\n    debug information to the console.\n\n- **prettier_cli_path** (default: ***empty***)  \n    If Sublime Text has problems automatically resolving a path to [Prettier],\n    you can set a custom path here. When the setting is empty, the plugin will\n    attempt to find Prettier by:\n\n    1. Locally installed prettier relative to active view.\n    2. Locally installed prettier relative to the Sublime Text Project file's root directory.\n    3. The current user home directory.\n    4. JsPrettier Sublime Text plugin directory.\n    5. Globally installed prettier.\n  \n    **Examples:**\n  \n    ```jsonc\n    {\n        // macOS and Linux examples:\n        \"prettier_cli_path\": \"/usr/local/bin/prettier\",\n        \"prettier_cli_path\": \"/some/absolute/path/to/node_modules/.bin/prettier\",\n        \"prettier_cli_path\": \"./node_modules/.bin/prettier\",\n        \"prettier_cli_path\": \"~/bin/prettier\",\n        \"prettier_cli_path\": \"$HOME/bin/prettier\",\n        \"prettier_cli_path\": \"${project_path}/bin/prettier\",\n        \"prettier_cli_path\": \"$ENV/bin/prettier\",\n        \"prettier_cli_path\": \"$NVM_BIN/prettier\",\n\n        // Windows examples:\n        \"prettier_cli_path\": \"C:/path/to/prettier.cmd\",\n        \"prettier_cli_path\": \"%USERPROFILE%\\\\bin\\\\prettier.cmd\"\n    }\n    ```\n\n- **node_path** (default: ***empty***)  \n    If Sublime Text has problems resolving the absolute path to node, you can\n    set a custom path here.\n  \n    **Examples:**\n  \n    ```jsonc\n    {\n        // macOS/Linux:\n        \"node_path\": \"/usr/local/bin/node\",\n        \"node_path\": \"/some/absolute/path/to/node\",\n        \"node_path\": \"./node\",\n        \"node_path\": \"~/bin/node\",\n        \"node_path\": \"$HOME/bin/node\",\n        \"node_path\": \"${project_path}/bin/node\",\n        \"node_path\": \"$ENV/bin/node\",\n        \"node_path\": \"$NVM_BIN/node\",\n\n        // Windows:\n        \"node_path\": \"C:/path/to/node.exe\",\n        \"node_path\": \"%USERPROFILE%\\\\bin\\\\node.exe\"\n    }\n    ```\n\n- **auto_format_on_save** (default: ***false***)  \n    Automatically format the file on save.\n\n- **auto_format_on_save_excludes** (default: [])  \n    File exclusion patterns to ignore when `auto_format_on_save` is enabled.\n  \n    **Example:**\n  \n    ```json\n    {\n        \"auto_format_on_save_excludes\": [\n            \"*/node_modules/*\",\n            \"*/file.js\",\n            \"*.json\"\n        ]\n    }\n    ```\n\n- **auto_format_on_save_requires_prettier_config** (default: ***false***)  \n    Enable auto format on save *only* when a Prettier config file is (or isn't)\n    found.\n\n    The Prettier config file is resolved by first checking if a `--config \u003c/path/to/prettier/config\u003e`\n    is specified in the `additional_cli_args` setting, then by searching the\n    location of the file being formatted, and finally navigating up the file tree\n    until a config file is (or isn't) found.\n\n- **allow_inline_formatting** (default: ***false***)  \n    Enables the ability to format *selections* of in-lined code. For example, to\n    format a selection of JavaScript code within a PHP or HTML file. When\n    ***true***, the JsPrettier command is available for use across all Sublime\n    Text syntaxes.\n\n- **custom_file_extensions** (default: [])  \n    There's built-in support already for `js`, `jsx`, `cjs`, `mjs`, `json`,\n    `jsonc`, `json5`, `html`, `graphql/gql`, `ts`, `tsx`, `cts`, `mts`, `css`,\n    `scss`, `less`, `md`, `mdx`, `yml`, `yaml`, `vue` and `component.html`\n    (angular html) files.\n\n    Put additional file extensions here, and be sure not to include the\n    leading dot in the file extension.\n\n- **max_file_size_limit** (default: ***-1***)  \n    The max allowed file size to format in bytes. For performance reasons,\n    files with a greater file size than the specified `max_file_size_limit` will\n    not format. Setting the `max_file_size_limit` value to ***-1*** disables the\n    file size checking (default).\n\n- **disable_tab_width_auto_detection** (default: ***false***)  \n    Whether or not to disable the plugin from automatically setting Prettier's\n    [--tab-width](https://prettier.io/docs/en/options.html#tab-width)\n    option, and adhere to the Prettier configured setting.\n\n- **disable_prettier_cursor_offset** (default: ***false***)  \n    There's an apparent (and nasty) defect in Prettier that seems to occur\n    during Prettier's [cursor offset](https://prettier.io/docs/en/api.html#prettierformatwithcursorsource--options)\n    calculation, and when attempting to format large or minimized files (but not limited to just these cases).\n    The issue effectively results in the CPU spiking to a constant 100%...\n    indefinitely, or until the node executable/process running Prettier is\n    forcefully terminated.\n\n    To avoid this problematic behavior, or until the defect is resolved, you can\n    disable the plugin (JsPrettier) from ever passing the cursor offset\n    position to Prettier by setting the `disable_prettier_cursor_offset` value\n    to `true`.\n\n    - See related issues: [#147](https://github.com/jonlabelle/SublimeJsPrettier/issues/147), [#168](https://github.com/jonlabelle/SublimeJsPrettier/issues/168)\n    - [Prettier Cursor Offset Documentation](https://prettier.io/docs/en/api.html#prettierformatwithcursorsource--options)\n\n- **additional_cli_args** (default: {})  \n    A key-value pair of arguments to append to the prettier command.\n\n    **Examples:**\n\n    ```jsonc\n    {\n        \"additional_cli_args\": {\n            \"--config\": \"~/.prettierrc\",\n            // or\n            \"--config\": \"$HOME/.prettierrc\",\n            // or\n            \"--config\": \"${project_path}/.prettierrc\",\n            // or\n            \"--config\": \"/some/absolute/path/to/.prettierrc\",\n\n            \"--config-precedence\": \"file-override\",\n            \"--ignore-path\": \"${file_path}/.prettierignore\",\n            \"--with-node-modules\": \"\",\n            \"--plugin-search-dir\": \"$folder\"\n        }\n    }\n    ```\n\n### Prettier Options\n\n- **useTabs** (internally set by the [***translate_tabs_to_spaces***] setting)  \n    Indent lines with tabs.\n\n- **printWidth** (default: ***80***)  \n    Specifies that the formatted code should fit within this line limit.\n\n- **tabWidth**  (default: ***2***)  \n    Specify the number of spaces per indentation-level.\n\n    **IMPORTANT:** By default, \"tabWidth\" is automatically set using the\n    SublimeText configured value for \"[tab_size]\". To disable this behavior, you\n    must first change the `disable_tab_width_auto_detection` value from `false`,\n    to `true`.\n\n- **singleQuote** (default: ***false***)  \n    Format code using single or double-quotes.\n\n- **trailingComma** (default: \"***all***\")  \n   Controls the printing of trailing commas wherever possible. Valid options:\n    - \"***none***\" - No trailing commas\n    - \"***es5***\" - Trailing commas where valid in ES5 (objects, arrays, etc)\n    - \"***all***\" - Trailing commas wherever possible (function arguments)\n\n- **bracketSpacing** (default: ***true***)  \n    Controls the printing of spaces inside object literals.\n\n- **bracketSameLine** (default: ***false***)  \n    Put the `\u003e` of a multi-line HTML (HTML, JSX, Vue, Angular) element at the\n    end of the last line instead of being alone on the next line\n    (does not apply to self closing elements).\n\n- **jsxSingleQuote** (default: ***false***)  \n    Use single quotes instead of double quotes in JSX.\n\n- **parser** (default: \"***babel***\")  \n    The [`parser`] is automatically set by the plugin (JsPrettier), based\n    on the contents of current file or selection.\n  \n- **semi** (default: ***true***)  \n    ***true*** to add a semicolon at the end of every line, or ***false*** to\n    add a semicolon at the beginning of lines that may introduce ASI failures.\n\n- **requirePragma** (default: ***false***)  \n    Prettier can ignore formatting files that contain a special comment, called\n    a *pragma* at the top of the file. This is useful when gradually\n    transitioning large, unformatted codebases to prettier.\n\n    For example, a file with its first comment specified below, and the\n    `--require-pragma` option:\n\n    ```javascript\n    /**\n     * @prettier\n     */\n    ```\n\n    or\n\n    ```javascript\n    /**\n     * @format\n     */\n    ```\n\n- **proseWrap** (default: \"***preserve***\")  \n    (*Markdown and YAML Only*) By default, Prettier will wrap Markdown and YAML\n    text as-is since some services use a linebreak-sensitive renderer, e.g.\n    GitHub comment and BitBucket. In some cases you may want to rely on\n    SublimeText soft wrapping instead, so this option allows you to opt out with\n    \"never\".\n\n    Valid Options:\n\n    - \"***always***\" - Wrap prose if it exceeds the print width.\n    - \"***never***\" - Do not wrap prose.\n    - \"***preserve***\" (default) - Wrap prose as-is. available in v1.9.0+\n\n- **arrowParens** (default: \"***always***\")  \n    Include parentheses around a sole arrow function parameter.\n\n    Valid Options:\n\n    - \"***avoid***\" - Omit parentheses when possible. Example: `x =\u003e x`\n    - \"***always***\" (always) - Always include parentheses. Example: `(x) =\u003e x`\n\n- **htmlWhitespaceSensitivity** (default: \"***css***\")  \n    (*HTML Only*) Specify the global whitespace sensitivity for HTML files,\n    see [whitespace-sensitive formatting] for more info.\n\n    Valid Options:\n\n    - \"***css***\" (default) - Respect the default value of CSS display property.\n    - \"***strict***\" - Whitespaces are considered sensitive.\n    - \"***ignore***\" - Whitespaces are considered insensitive.\n\n- **quoteProps** (default: \"***as-needed***\")  \n    Change when properties in objects are quoted. Requires [Prettier v1.17+].\n\n    Valid options:\n\n    - \"***as-needed***\" (default) - Only add quotes around object properties where required.\n    - \"***consistent***\" - If at least one property in an object requires quotes, quote all properties.\n    - \"***preserve***\" - Respect the input use of quotes in object properties.\n\n- **vueIndentScriptAndStyle** (default: ***false***)  \n    (*Vue files Only*) Whether or not to indent the code inside `\u003cscript\u003e`\n    and `\u003cstyle\u003e` tags in Vue files. Some people (like [the creator of Vue](https://github.com/prettier/prettier/issues/3888#issuecomment-459521863))\n    don't indent to save an indentation level, but this might break code\n    folding in Sublime Text.\n\n    Valid Options:\n\n    - ***false*** (default) - Do not indent script and style tags in Vue files.\n    - ***true*** - Indent script and style tags in Vue files.\n\n- **embeddedLanguageFormatting** (default: \"***auto***\")  \n    Control whether Prettier formats quoted code embedded in the file.\n\n    When Prettier identifies cases where it looks like you've placed some code\n    it knows how to format within a string in another file, like in a tagged\n    template in JavaScript with a tag named `html` or in code blocks in\n    Markdown, it will by default try to format that code.\n\n    Sometimes this behavior is undesirable, particularly in cases where you\n    might not have intended the string to be interpreted as code. This option\n    allows you to switch between the default behavior (`auto`) and disabling\n    this feature entirely (`off`).\n\n    See [example](https://prettier.io/blog/2020/08/24/2.1.0.html#add---embedded-language-formattingautooff-option-7875httpsgithubcomprettierprettierpull7875-by-bakkothttpsgithubcombakkot-8825httpsgithubcomprettierprettierpull8825-by-fiskerhttpsgithubcomfiskers).\n\n    Valid Options:\n\n    - \"***auto***\" (default) - Format embedded code if Prettier can automatically identify it.\n    - \"***off***\" - Never automatically format embedded code.\n\n- **editorconfig** (default: ***true***)  \n    Whether to take into account [\\.editorconfig] files when parsing configuration.\n\n    If `editorconfig` is `true` and an .editorconfig file is in your project,\n    Prettier will parse it and convert its properties to the corresponding\n    Prettier configuration. This configuration will be overridden by\n    .prettierrc, etc. Currently, the following EditorConfig properties\n    are supported:\n\n    - `end_of_line`\n    - `indent_style`\n    - `indent_size/tab_width`\n    - `max_line_length`\n\n- **singleAttributePerLine** (default: ***false***)  \n    Enforce single attribute per line in HTML, Vue and JSX.\n\n    Valid Options:\n\n    - ***false*** (default) Do not enforce single attribute per line.\n    - ***true*** Enforce single attribute per line.\n\nSee the Prettier Options [doc page] for more details and examples.\n\n### Project-level Settings\n\nJsPrettier supports [project-level settings], specified in `\u003cproject_name\u003e.sublime-project` files.\n\nTo override [previous configurations](#plugin-settings-and-prettier-options) with your project-level settings,\nadd a new `js_prettier` key and section under `settings` as shown in the [example below](#example-sublime-text-project-file).\n\n#### Example Sublime Text Project File\n\n```json\n{\n    \"folders\": [\n        {\n            \"path\": \".\"\n        }\n    ],\n    \"settings\": {\n        \"js_prettier\": {\n            \"debug\": false,\n            \"prettier_cli_path\": \"\",\n            \"node_path\": \"\",\n            \"auto_format_on_save\": false,\n            \"auto_format_on_save_excludes\": [],\n            \"auto_format_on_save_requires_prettier_config\": false,\n            \"allow_inline_formatting\": false,\n            \"custom_file_extensions\": [],\n            \"max_file_size_limit\": -1,\n            \"disable_tab_width_auto_detection\": false,\n            \"disable_prettier_cursor_offset\": false,\n            \"additional_cli_args\": {},\n            \"prettier_options\": {\n                \"printWidth\": 80,\n                \"tabWidth\": 2,\n                \"singleQuote\": false,\n                \"trailingComma\": \"all\",\n                \"bracketSpacing\": true,\n                \"bracketSameLine\": false,\n                \"jsxSingleQuote\": false,\n                \"parser\": \"babel\",\n                \"semi\": true,\n                \"requirePragma\": false,\n                \"proseWrap\": \"preserve\",\n                \"arrowParens\": \"always\",\n                \"htmlWhitespaceSensitivity\": \"css\",\n                \"quoteProps\": \"as-needed\",\n                \"vueIndentScriptAndStyle\": false,\n                \"embeddedLanguageFormatting\": \"auto\",\n                \"editorconfig\": true,\n                \"singleAttributePerLine\": false\n            }\n        }\n    }\n}\n```\n\n### Prettier Configuration Files\n\nWhen [Prettier configuration files] are detected, options defined in *Sublime\nText* are ignored, except for `parser`, `tabWidth`, and `useTabs`.\nThese options are automatically set based on syntax settings of the current file\nor selection(s) defined in Sublime Text.\n\n#### Custom Prettier Config File Path\n\nTo specify a custom Prettier config path, simply add a `--config \u003cpath\u003e`\nkey-value item to `additional_cli_args`. Here's an example:\n\n```json\n{\n    \"additional_cli_args\": {\n        \"--config\": \"~/some/path/from/my/home/.prettierrc\",\n        \"--config-precedence\": \"prefer-file\",\n        \"--ignore-path\": \"${project_path}/.prettierignore\"\n    }\n}\n```\n\n#### Disable Prettier Config File Discovery\n\nYou can also add the `--no-config` option to the `additional_cli_args` setting,\nand tell Prettier not to attempt to find config files.\n\n```json\n{\n    \"additional_cli_args\": {\n        \"--no-config\": \"\"\n    }\n}\n```\n\n#### Prettier Ignore Config File Discovery (`.prettierignore`)\n\nWhen the [`--ignore-path`] option is NOT specified in `additional_cli_args`,\nthe plugin will search for a `.prettierignore` file in the same directory of\nthe source file, then the active Sublime Text project's root directory. If\nneither path can be resolved, search up the directory tree, and finally look\nin the user's home directory.\n\n## Prettier Plugin Support\n\n### Prettier PHP\n\nIn most cases, [Prettier PHP] works as a drop-in replacement for Prettier.\nHowever, JsPrettier only detects if you're formatting a PHP file (or PHP selection),\nand sets the `--parser` option to `php` accordingly. Aside from that, it's up to you ensure your\nconfig(s) conform to Prettier PHP [options](https://github.com/prettier/plugin-php#configuration).\n\nTo **install Prettier PHP** in your project root and use it as a drop-in\nreplacement for Prettier:\n\n```bash\ncd to/project/directory\nnpm install @prettier/plugin-php\n```\n\n### Prettier Community Plugins\n\nHere's an [example SublimeText project](https://github.com/jonlabelle/SublimeJsPrettier/files/6498394/jsprettier-and-prettier-community-plugin-example.zip)\nfrom [#239](https://github.com/jonlabelle/SublimeJsPrettier/issues/239)\nthat uses the Prettier Community Plugin [prettier-plugin-go-template](https://github.com/NiklasPor/prettier-plugin-go-template)\nto format `*.gohtml` files.\n\nAnd another [example project](https://github.com/jonlabelle/SublimeJsPrettier/files/6527323/jsprettier-and-prettier-plugin-sort-imports.zip)\nfrom [#240](https://github.com/jonlabelle/SublimeJsPrettier/issues/240) that\nuses [prettier-plugin-sort-imports](https://github.com/trivago/prettier-plugin-sort-imports)\nto sort imports.\n\n## Issues\n\nTo report a bug or make a suggestion, please [open a new issue] selecting the\nappropriate issue template: [Bug], [Feature], or [Question].\n\nBe sure to follow the guidelines outlined in each template; otherwise, your\nsubmission may be closed.\n\n## Changes\n\nPlease visit the [Changelog] page for a complete list of changes.\n\n## License\n\n[MIT]\n\n## Author\n\n[Jon LaBelle](https://github.com/jonlabelle)\n\n[Watch a Quick Demo]: https://github.com/jonlabelle/SublimeJsPrettier/blob/master/screenshots/demo.gif\n[Prettier]: https://prettier.io\n[Package Control]: https://packagecontrol.io/packages/JsPrettier\n[Sublime Text]: https://www.sublimetext.com\n[JsPrettier]: https://github.com/jonlabelle/SublimeJsPrettier\n[Node.js]: https://nodejs.org\n[project-level settings]: https://sublime-text-unofficial-documentation.readthedocs.io/en/latest/reference/projects.html\n[tab_size]: https://sublime-text-unofficial-documentation.readthedocs.io/en/latest/reference/settings.html#whitespace-and-indentation\n[***translate_tabs_to_spaces***]: https://sublime-text-unofficial-documentation.readthedocs.io/en/latest/reference/settings.html#whitespace-and-indentation\n[yarn]: https://yarnpkg.com\n[npm]: https://www.npmjs.com\n[pnpm]: https://pnpm.io\n[zip file]: https://github.com/jonlabelle/SublimeJsPrettier/archive/master.zip\n[Sublime Text Packages directory]: #default-st-paths\n[custom key binding]: https://sublime-text-unofficial-documentation.readthedocs.io/en/latest/customization/key_bindings.html\n[Prettier Configuration files]: https://prettier.io/docs/en/configuration.html\n[Changelog]: https://github.com/jonlabelle/SublimeJsPrettier/blob/master/CHANGELOG.md\n[MIT]: https://github.com/jonlabelle/SublimeJsPrettier/blob/master/LICENSE\n[doc page]: https://prettier.io/docs/en/options.html\n[`--ignore-path`]: https://prettier.io/docs/en/cli.html#--ignore-path\n[whitespace-sensitive formatting]: https://prettier.io/blog/2018/11/07/1.15.0.html#whitespace-sensitive-formatting\n[`parser`]: https://prettier.io/docs/en/options.html#parser\n[`--log-level`]: https://prettier.io/docs/en/cli.html#--log-level\n[Prettier PHP]: https://github.com/prettier/plugin-php\n[open a new issue]: https://github.com/jonlabelle/SublimeJsPrettier/issues/\n[Prettier v1.17+]: https://prettier.io/blog/2019/04/12/1.17.0.html\n[\\.editorconfig]: https://editorconfig.org/\n[Bug]: https://github.com/jonlabelle/SublimeJsPrettier/issues/new?assignees=jonlabelle\u0026labels=investigating\u0026projects=\u0026template=bug.yml\u0026title=%5BBug%5D+\n[Feature]: https://github.com/jonlabelle/SublimeJsPrettier/issues/new?assignees=jonlabelle\u0026labels=enhancement\u0026projects=\u0026template=feature.yml\u0026title=%5BEnhancement%5D+\n[Question]: https://github.com/jonlabelle/SublimeJsPrettier/issues/new?assignees=\u0026labels=question\u0026projects=\u0026template=question.yml\u0026title=%5BQuestion%5D+\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonlabelle%2Fsublimejsprettier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonlabelle%2Fsublimejsprettier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonlabelle%2Fsublimejsprettier/lists"}