Giter Club home page Giter Club logo

sublimejsprettier's Introduction

JsPrettier

ci Package Control Installs Latest Release MIT License

JsPrettier is a Sublime Text Plug-in for Prettier, the opinionated code formatter.

Before and After JsPrettier

Watch a Quick Demo


Table of Contents

Installation

JsPrettier is compatible with both Sublime Text 2 and 3, and all supported Operating Systems.

Requirements

  • Sublime Text – Text editor for code
  • node.js – JavaScript runtime
    • yarn or npm – Package manager for JavaScript
      • Prettier – Opinionated code formatter (v3 or above)

Install Prettier

If you've already installed Prettier (using one of the yarn or npm commands below), you're all set... otherwise:

# yarn (local):
yarn add prettier --dev

# yarn (global):
yarn global add prettier

# npm (local):
npm install --save-dev prettier

# npm (global):
npm install --global prettier

Install JsPrettier via Package Control

The easiest and recommended way to install JsPrettier is using Package Control.

From the application menu, navigate to:

  • Tools -> Command Palette... -> Package Control: Install Package, type the word JsPrettier, then select it to complete the installation.

Install JsPrettier Manually

  1. Download and extract JsPrettier zip file to your Sublime Text Packages directory.
  2. Rename the extracted directory from SublimeJsPrettier-master to JsPrettier.

Default Sublime Text Packages Paths:

  • OS X: ~/Library/Application Support/Sublime Text [2|3]/Packages
  • Linux: ~/.Sublime Text [2|3]/Packages
  • Windows: %APPDATA%/Sublime Text [2|3]/Packages

NOTE Replace the [2|3] part with the appropriate Sublime Text version for your installation.

Install JsPrettier Using Git

If you're a Git user, you can install JsPrettier and keep it up-to-date by cloning the repository directly into your Sublime Text Packages directory.

TIP: You can locate your Sublime Text Packages directory by using the application menu Preferences -> Browse Packages....

git clone https://github.com/jonlabelle/SublimeJsPrettier.git "JsPrettier"

Usage

There are three available options to format code:

  1. Command Palette: From the command palette (ctrl/cmd + shift + p), type JsPrettier Format Code.
  2. Context Menu: Right-click anywhere in the file to bring up the context menu and select JsPrettier Format Code.
  3. Key Binding: There is no default key binding to run Prettier, but here's how to add your own.

Command Scope

JsPrettier will attempt to format selections of code first, then the entire file. When auto_format_on_save is true, the entire file will be formatted.

Custom Key Binding

To add a custom key binding, please reference the following example which binds the js_prettier command to ctrl + alt + f:

{ "keys": ["ctrl+alt+f"], "command": "js_prettier" }

Settings

Plug-in settings and Prettier options can be configured by navigating the application menu to:

  • Preferences
    • Package Settings
      • JsPrettier
        • Settings - Default (to view the defaults)
        • Settings - User (to override the defaults)

Sublime Text Settings

  • debug (default: false)
    When enabled (true), debug info will print to the console - useful for troubleshooting and inspecting generated commands passed to Prettier. Enabling debug mode also sets Prettier's --log-level option to debug (when not overridden by additional_cli_args), for printing additional debug information to the console.

  • prettier_cli_path (default: empty)
    If Sublime Text has problems automatically resolving a path to Prettier, you can set a custom path here. When the setting is empty, the plug-in will attempt to find Prettier by:

    1. Locally installed prettier relative to active view.
    2. Locally installed prettier relative to the Sublime Text Project file's root directory.
    3. The current user home directory.
    4. JsPrettier Sublime Text plug-in directory.
    5. Globally installed prettier.

    Examples:

    {
        // macOS and Linux examples:
        "prettier_cli_path": "/usr/local/bin/prettier"
        "prettier_cli_path": "/some/absolute/path/to/node_modules/.bin/prettier"
        "prettier_cli_path": "./node_modules/.bin/prettier"
        "prettier_cli_path": "~/bin/prettier"
        "prettier_cli_path": "$HOME/bin/prettier"
        "prettier_cli_path": "${project_path}/bin/prettier"
        "prettier_cli_path": "$ENV/bin/prettier"
        "prettier_cli_path": "$NVM_BIN/prettier"
    
        // Windows examples:
        "prettier_cli_path": "C:/path/to/prettier.cmd"
        "prettier_cli_path": "%USERPROFILE%\\bin\\prettier.cmd"
    }
    
  • node_path (default: empty)
    If Sublime Text has problems resolving the absolute path to node, you can set a custom path here.

    Examples:

    {
        // macOS/Linux:
        "node_path": "/usr/local/bin/node"
        "node_path": "/some/absolute/path/to/node"
        "node_path": "./node"
        "node_path": "~/bin/node"
        "node_path": "$HOME/bin/node"
        "node_path": "${project_path}/bin/node"
        "node_path": "$ENV/bin/node"
        "node_path": "$NVM_BIN/node"
    
        // Windows:
        "node_path": "C:/path/to/node.exe"
        "node_path": "%USERPROFILE%\\bin\\node.exe"
    }
    
  • auto_format_on_save (default: false)
    Automatically format the file on save.

  • auto_format_on_save_excludes (default: [])
    File exclusion patterns to ignore when auto_format_on_save is enabled.

    Example:

    {
        "auto_format_on_save_excludes": [
            "*/node_modules/*",
            "*/file.js",
            "*.json"
        ]
    }
  • auto_format_on_save_requires_prettier_config (default: false)
    Enable auto format on save only when a Prettier config file is (or isn't) found.

    The Prettier config file is resolved by first checking if a --config </path/to/prettier/config> is specified in the additional_cli_args setting, then by searching the location of the file being formatted, and finally navigating up the file tree until a config file is (or isn't) found.

  • allow_inline_formatting (default: false)
    Enables the ability to format selections of in-lined code. For example, to format a selection of JavaScript code within a PHP or HTML file. When true, the JsPrettier command is available for use across all Sublime Text syntaxes.

  • custom_file_extensions (default: [])
    There's built-in support already for js, jsx, cjs, mjs, json, jsonc, json5, html, graphql/gql, ts, tsx, cts, mts, css, scss, less, md, mdx, yml, yaml, vue and component.html (angular html) files.

    Put additional file extensions here, and be sure not to include the leading dot in the file extension.

  • max_file_size_limit (default: -1)
    The max allowed file size to format in bytes. For performance reasons, files with a greater file size than the specified max_file_size_limit will not format. Setting the max_file_size_limit value to -1 disables the file size checking (default).

  • disable_tab_width_auto_detection (default: false)
    Whether or not to disable the plug-in from automatically setting Prettier's "tabWidth / --tab-width" option, and adhere to the Prettier configured setting.

  • disable_prettier_cursor_offset (default: false)
    There's an apparent (and nasty) defect in Prettier that seems to occur during Prettier's cursor offset calculation, and when attempting to format large or minimized files (but not limited to just these cases). The issue effectively results in the CPU spiking to a constant 100%... indefinitely, or until the node executable/process running Prettier is forcefully terminated.

    To avoid this problematic behavior, or until the defect is resolved, you can disable the plug-in (JsPrettier) from ever passing the cursor offset position to Prettier by setting the disable_prettier_cursor_offset value to true.

  • additional_cli_args (default: {})
    A key-value pair of arguments to append to the prettier command.

    Examples:

    {
        "additional_cli_args": {
            "--config": "~/.prettierrc",
            "--config": "$HOME/.prettierrc",
            "--config": "${project_path}/.prettierrc",
            "--config": "/some/absolute/path/to/.prettierrc",
    
            "--config-precedence": "file-override",
            "--ignore-path": "${file_path}/.prettierignore",
            "--with-node-modules": "",
            "--plugin-search-dir": "$folder"
        }
    }

Prettier Options

  • useTabs (internally set by the translate_tabs_to_spaces setting)
    Indent lines with tabs.

  • printWidth (default: 80)
    Specifies that the formatted code should fit within this line limit.

  • tabWidth (default: 2)
    Specify the number of spaces per indentation-level.

    IMPORTANT: By default, "tabWidth" is automatically set using the SublimeText configured value for "tab_size". To disable this behavior, you must first change the disable_tab_width_auto_detection value from false, to true.

  • singleQuote (default: false)
    Format code using single or double-quotes.

  • trailingComma (default: "all")
    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)
  • bracketSpacing (default: true)
    Controls the printing of spaces inside object literals.

  • bracketSameLine (default: false)
    Put the > of a multi-line HTML (HTML, JSX, Vue, Angular) element at the end of the last line instead of being alone on the next line (does not apply to self closing elements).

  • jsxSingleQuote (default: false)
    Use single quotes instead of double quotes in JSX.

  • parser (default: "babel")
    The parser is automatically set by the plug-in (JsPrettier), based on the contents of current file or selection.

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

  • requirePragma (default: false)
    Prettier can ignore formatting files that contain a special comment, called a pragma at the top of the file. This is useful when gradually transitioning large, unformatted codebases to prettier.

    For example, a file with its first comment specified below, and the --require-pragma option:

    /**
     * @prettier
     */

    or

    /**
     * @format
     */
  • proseWrap (default: "preserve")
    (Markdown and YAML Only) By default, Prettier will wrap Markdown and YAML text as-is since some services use a linebreak-sensitive renderer, e.g. GitHub comment and BitBucket. In some cases you may want to rely on SublimeText soft wrapping instead, so this option allows you to opt out with "never".

    Valid Options:

    • "always" - Wrap prose if it exceeds the print width.
    • "never" - Do not wrap prose.
    • "preserve" (default) - Wrap prose as-is. available in v1.9.0+
  • arrowParens (default: "always")
    Include parentheses around a sole arrow function parameter.

    Valid Options:

    • "avoid" - Omit parentheses when possible. Example: x => x
    • "always" (always) - Always include parentheses. Example: (x) => x
  • htmlWhitespaceSensitivity (default: "css")
    (HTML Only) Specify the global whitespace sensitivity for HTML files, see whitespace-sensitive formatting for more info.

    Valid Options:

    • "css" (default) - Respect the default value of CSS display property.
    • "strict" - Whitespaces are considered sensitive.
    • "ignore" - Whitespaces are considered insensitive.
  • quoteProps (default: "as-needed")
    Change when properties in objects are quoted. Requires Prettier v1.17+.

    Valid options:

    • "as-needed" (default) - Only add quotes around object properties where required.
    • "consistent" - If at least one property in an object requires quotes, quote all properties.
    • "preserve" - Respect the input use of quotes in object properties.
  • vueIndentScriptAndStyle (default: false)
    (Vue files Only) Whether or not to indent the code inside <script> and <style> tags in Vue files. Some people (like the creator of Vue) don't indent to save an indentation level, but this might break code folding in Sublime Text.

    Valid Options:

    • false (default) - Do not indent script and style tags in Vue files.
    • true - Indent script and style tags in Vue files.
  • embeddedLanguageFormatting (default: "auto")
    Control whether Prettier formats quoted code embedded in the file.

    When Prettier identifies cases where it looks like you've placed some code it knows how to format within a string in another file, like in a tagged template in JavaScript with a tag named html or in code blocks in Markdown, it will by default try to format that code.

    Sometimes this behavior is undesirable, particularly in cases where you might not have intended the string to be interpreted as code. This option allows you to switch between the default behavior (auto) and disabling this feature entirely (off).

    See example.

    Valid Options:

    • "auto" (default) - Format embedded code if Prettier can automatically identify it.
    • "off" - Never automatically format embedded code.
  • editorconfig (default: true)
    Whether to take into account .editorconfig files when parsing configuration.

    If editorconfig is true and an .editorconfig file is in your project, Prettier will parse it and convert its properties to the corresponding Prettier configuration. This configuration will be overridden by .prettierrc, etc. Currently, the following EditorConfig properties are supported:

    • end_of_line
    • indent_style
    • indent_size/tab_width
    • max_line_length
  • singleAttributePerLine (default: false)
    Enforce single attribute per line in HTML, Vue and JSX.

    Valid Options:

    • false (default) Do not enforce single attribute per line.
    • true Enforce single attribute per line.

See the Prettier Options doc page for more details and examples.

Project-level Settings

JsPrettier supports project-level settings, specified in <project_name>.sublime-project files.

In order for your project-level settings to override previous configurations, you'll need to add a new js_prettier key and section under settings, as seen below.

Example Sublime Text Project File

{
    "folders": [
        {
            "path": "."
        }
    ],
    "settings": {
        "js_prettier": {
            "debug": false,
            "prettier_cli_path": "",
            "node_path": "",
            "auto_format_on_save": false,
            "auto_format_on_save_excludes": [],
            "auto_format_on_save_requires_prettier_config": false,
            "allow_inline_formatting": false,
            "custom_file_extensions": [],
            "max_file_size_limit": -1,
            "disable_tab_width_auto_detection": false,
            "disable_prettier_cursor_offset": false,
            "additional_cli_args": {},
            "prettier_options": {
                "printWidth": 80,
                "tabWidth": 2,
                "singleQuote": false,
                "trailingComma": "all",
                "bracketSpacing": true,
                "bracketSameLine": false,
                "jsxSingleQuote": false,
                "parser": "babel",
                "semi": true,
                "requirePragma": false,
                "proseWrap": "preserve",
                "arrowParens": "always",
                "htmlWhitespaceSensitivity": "css",
                "quoteProps": "as-needed",
                "vueIndentScriptAndStyle": false,
                "embeddedLanguageFormatting": "auto",
                "editorconfig": true,
                "singleAttributePerLine": false
            }
        }
    }
}

Prettier Configuration Files

When Prettier configuration files are detected, options defined in Sublime Text are ignored, except for parser, tabWidth, and useTabs. These options are automatically set based on syntax settings of the current file or selection(s) defined in Sublime Text.

Custom Prettier Config File Path

To specify a custom Prettier config path, simply add a --config <path> key-value item to additional_cli_args. Here's an example:

{
    "additional_cli_args":
    {
        "--config": "~/some/path/from/my/home/.prettierrc",
        "--config-precedence": "prefer-file",
        "--ignore-path": "${project_path}/.prettierignore"
    }
}

Disable Prettier Config File Discovery

You can also add the --no-config option to the additional_cli_args setting, and tell Prettier not to attempt to find config files.

{
    "additional_cli_args": {
        "--no-config": ""
    }
}

Prettier Ignore Config File Discovery (.prettierignore)

When the --ignore-path option is NOT specified in additional_cli_args, the plug-in will search for a .prettierignore file in the same directory of the source file, then the active Sublime Text project's root directory. If neither path can be resolved, search up the directory tree, and finally look in the user's home directory.

Prettier Plugin Support

Prettier PHP

In most cases, Prettier PHP works as drop-in replacement for Prettier. However, JsPrettier only detects if you're formatting a PHP file (or PHP selection), and sets the --parser to php accordingly. Aside from that, it's up to you ensure your config(s) conform to Prettier PHP options.

To install Prettier PHP in your project root, and use it as a drop-in replacement for Prettier:

cd to/project/directory
npm install @prettier/plugin-php

Prettier Community Plugins

Here's an example SublimeText project (posted in Issue #239) that uses the Prettier Community Plugin NiklasPor/prettier-plugin-go-template to format *.gohtml files.

And another example project that uses @trivago/prettier-plugin-sort-imports to sort imports (posted in Issue #240).

Issues

To report a bug or a make suggestion, please open a new issue selecting the appropriate Issue Template (Bug report or Feature request). Be sure to follow the guidelines outlined in each template... otherwise your submission will be subject to immediate closure.

Changes

Please visit the Changelog page for a complete list of changes.

Author

Jon LaBelle

License

MIT License

sublimejsprettier's People

Contributors

alecmev avatar bluefuton avatar crisfole avatar davidalejandroaguilar avatar dependabot[bot] avatar drewhamlett avatar gornostal avatar gregsadetsky avatar hudochenkov avatar jakubmazanec avatar jfcherng avatar jgjp avatar jlc467 avatar jonlabelle avatar jylertones avatar k15a avatar kaste avatar lendar avatar markalfred avatar mlunoe avatar mohitsinghs avatar moox avatar nsfmc avatar pedronfigueiredo avatar percyhanna avatar queengooborg avatar rkoval avatar serhiipalash avatar sgerace avatar viankakrisna avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

sublimejsprettier's Issues

Allow scope: source.js in all file extensions

The plugin is disabled on .vue and .tag files, which are similar to JSX files in vuejs and riotjs projects. The sublime syntax for .vue and .tag files mark script block as source.js

Add support for project-specific "prettier_options"

Code style standards vary from project to project, so it would be helpful for the "prettier_options" setting to be configurable per-project, by including the settings in the .sublime-project file.

Example:

{
	"folders":
	[
		{
			"path": "."
		}
	],
	"settings":
	{
		// not here - this section overrides core Sublime Text settings
	},
	"prettier_options": {
		"singleQuote": true,
		"trailingComma": true
	}
}

Settings in the project file should override both the package default settings and the user settings file.

The JSON of the project file may be accessed via the Sublime Text API with window.project_data().

Enhancement: Exclude folders from `auto_format_on_save`

Use case

Sometimes I have to dive into the node_modules, placing console.log commands to debug. Having the auto_format_on_save to true will format that file which is somewhat undesirable.

Alternatively, an include option would also work too.

Cheers! 👍

JsPrettier - [Errno 13] Permission denied

I am trying to use this library in SublimeText, but I always get a Permission denied. I have change already ther permision of /usr/bin/prettier but still got the same permission error. The error is this:

/usr/lib/nodejs /usr/bin/prettier --stdin --color=false --print-width 80 --single-quote=true --trailing-comma es5 --bracket-spacing=true --jsx-bracket-same-line=false --parser babylon --semi=true --tab-width 4 --use-tabs=false
error: JsPrettier - [Errno 13] Permission denied
Traceback (most recent call last):
  File "/opt/sublime_text/sublime_plugin.py", line 574, in run_
    return self.run(edit)
  File "/home/user-/.config/sublime-text-3/Packages/JsPrettier/JsPrettier.py", line 192, in run
    source, node_path, prettier_cli_path, prettier_args)
  File "/home/user-/.config/sublime-text-3/Packages/JsPrettier/JsPrettier.py", line 271, in run_prettier
    shell=self.is_windows())
  File "./python3.3/subprocess.py", line 819, in __init__
  File "./python3.3/subprocess.py", line 1448, in _execute_child
PermissionError: [Errno 13] Permission denied

Prettier version: 1.3.1
JsPrettier version: 1.7.8
Platform: Ubuntu 16.04
Node version: 6.10.0
Sublime version: 3
Sublime build: 3114

This is my sublime settings

{
	"debug": true,
	"prettier_cli_path": "/usr/bin/prettier",
	"node_path": "/usr/lib/nodejs",
	"auto_format_on_save": true,
	"allow_inline_formatting": false,
	"prettier_options": {
		"printWidth": 80,
		"singleQuote": true,
		"trailingComma": "es5",
		"bracketSpacing": true,
		"jsxBracketSameLine": false,
		"parser": "babylon",
		"useTabs": true,
		"tabWidth": 4,
	}
}

Removes new line at EOF when file has been reformatted

Looks like the trim_trailing_line_breaks is also removing the newline at EOF. I had originally filed an issue on the main Prettier repo prettier/prettier#708 but ended up tracking it down to that function.

I noticed a few commits around removing line breaks, so I'm not quite sure what the solution would be for leaving the EOF new line.

I attempted to change \Z to \z which seemed to work, but not sure what the fallout is for the other line breaks you were seeing.

Add an option to include files with auto save

I'd like to propose a new option to include files (e.g. auto_format_on_save_includes).

In the case of a project I'm working on it would be more convenient to have an opt-in behavior instead of the currently available opt-out auto_format_on_save_excludes.

As using prettier has a potentially destructive behavior, I would feel safer if I could add a file to prettier on save when I notice it's not being prettified.

In case this option is not specified, the behavior would be as it is currently - all supported files would be autosaved.

prettier_cli_path not being picked up

Prettier version
1.1.0

JsPrettier version (package.json)
"version": "1.7.4",

My Prettier.sublime-settings file looks like:

{
  "prettier_cli_path": "$HOME/.nvm/versions/node/v7.9.0/bin/prettier"
}

(which exists and executes fine)

however when running the installed plugin it get the following in the sublime console

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 818, in run_
    return self.run(edit)
  File "/Users/callum.rogan/Library/Application Support/Sublime Text 3/Packages/sublime-prettier/prettier.py", line 67, in run
    prettify_code(edit, self.view, region)
  File "/Users/callum.rogan/Library/Application Support/Sublime Text 3/Packages/sublime-prettier/prettier.py", line 45, in prettify_code
    shell=IS_WINDOWS
  File "./python3.3/subprocess.py", line 819, in __init__
  File "./python3.3/subprocess.py", line 1448, in _execute_child
FileNotFoundError: [Errno 2] No such file or directory: 'prettier'

[Errno 24] Too many open files

Explain the issue

JsPrettier sometimes throws an error that there are too many open files.

Explain the issue with as much detail as possible...

The issue seems to happen after Sublime has been open for a while, and after I have opened / saved / closed a lot of files, though I couldn't say exactly how long it takes for the error to occur.

The error presents as a pop-up window:

screen shot 2017-05-19 at 12 24 00

Once the error has occurred, Prettier will not run again (the error will happen every time) until Sublime has been restarted.

Prettier version (command line)

1.1.0

JsPrettier version (package.json)

"name": "sublime-js-prettier",
"version": "1.7.8",

Platform details

- Sublime Text Version: 3
- Sublime Text Build: 3126
- Operating System Name: Mac OS X
- Operating System Version: 10.12.5 (issue also observed on 10.10.x)

Prettier arguments

"auto_format_on_save": true,
"singleQuote": true,
"trailingComma": "es5",
"bracketSpacing": true

Otherwise I use the defaults.

Is the same behavior observed when run against Prettier directly?

N/A

Steps to reproduce the behavior

  1. Use JsPrettier for a while, ensuring it runs on lots of files in the same session (?)

Debug output


-----------------------------------------
 JsPrettier DEBUG - Prettier CLI Command 
-----------------------------------------

/Users/edavies/npm-global/bin/prettier --stdin --color=false --print-width 80 --single-quote=true --trailing-comma es5 --bracket-spacing=true --jsx-bracket-same-line=false --parser babylon --semi=true --tab-width 2 --use-tabs=false
error: JsPrettier - [Errno 24] Too many open files
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 812, in run_
    return self.run(edit, **args)
  File "/Users/edavies/Library/Application Support/Sublime Text 3/Packages/JsPrettier/JsPrettier.py", line 192, in run
    source, node_path, prettier_cli_path, prettier_args)
  File "/Users/edavies/Library/Application Support/Sublime Text 3/Packages/JsPrettier/JsPrettier.py", line 271, in run_prettier
    shell=self.is_windows())
  File "./python3.3/subprocess.py", line 784, in __init__
  File "./python3.3/subprocess.py", line 1281, in _get_handles
OSError: [Errno 24] Too many open files

bracketSpacing option not working

Hi, thanks for the plugin!

I have a little issue with the bracketSpacing option that's not working, it stays at true.

My config:

{
    //
    // @prettier_cli_path { string | default = "" }
    //
    // It's strongly recommended to leave the "prettier_cli_path" value
    // empty "", however if Sublime Text has problems resolving the path
    // to the `prettier` cli executable, you can explicitly specify the
    // value here.
    //
    // Examples:
    //
    //     - macOS/Linux...: "/path/to/node_modules/.bin/prettier"
    //     - Windows.......: "C:/path/to/npm/prettier"

    "debug": true,

    "prettier_cli_path": "/usr/local/Cellar/node/6.8.1/bin/prettier",

    //
    // @auto_format_on_save { bool | default = false }
    //
    // Run js_prettier command automatically
    // when JavaScript files are saved.

    "auto_format_on_save" : false,

    //
    // For a complete list of supported options and acceptable values,
    // please reference the `prettier` documentation at https://github.com/jlongster/prettier

    "prettier_options": {
        // Fit code within this line limit
        "printWidth": 99,

        // Number of spaces it should use per tab
        "tabWidth": 4,

        // If true, will use single instead of double quotes
        "singleQuote": false,

        // 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)
        //
        // NOTE: Above is only available in 0.19.0 and above. Previously this was
        // a boolean argument.
        "trailingComma": "es5",

        // Controls the printing of spaces inside object literals
        "bracketSpacing": false,

        // 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
        "jsxBracketSameLine": true,

        // Which parser to use. Valid options are 'flow' and 'babylon'
        "parser": "babylon",
    }
}

CLI output:

-----------------------------------------
 JsPrettier DEBUG - Prettier CLI Command 
-----------------------------------------

/usr/local/Cellar/node/6.8.1/bin/prettier --stdin --color=false --print-width 99 --single-quote=false --trailing-comma es5 --bracket-spacing=true --jsx-bracket-same-line=true --parser babylon --tab-width 4

I looked at the source but couldn't find any typo. Any ideas?

Project-level Settings based on .eslintrc

I know you can now use .sublime-project file but it would be nice if this plugin tried first to look it up in .eslintrc:

  • is prettier plugin used -> format on on save
  • used the rules...

Doesn't work with prettier 1.6

Doesn't work with the latest 1.6.0 version of Prettier (works great with previous versions).

Here is the error in ST console:

------------------
 JsPrettier ERROR 
------------------

Prettier reported the following error:

Ignored unknown option: --single-quote=false
Ignored unknown option: --bracket-spacing=true
Ignored unknown option: --jsx-bracket-same-line=false
Ignored unknown option: --semi=true
Ignored unknown option: --use-tabs=false

Thank you very much for your work.

stdin: RangeError: Invalid string length and mangled formatting

Using Sublime Text dev 3125. OS X 10.11.6.

Most files, when running jsPrettier I get this in the console:

------------------
 JsPrettier Error 
------------------

stdin: RangeError: Invalid string length

The files it does run on are formatting crazy. Below is some sample code. This is how it was typed in sublime:

var TopNav = function () {
    var swiper, topNavPref;
    function ready () {
        Settings.SetItem("topnav-hidden", { /*description: "Cross-sell navigation is hidden by default",*/ storage: "local", type: "Boolean"});
        topNavPref = Settings.GetItem("topnav-hidden");

        if(topNavPref) {
            document.body.removeAttribute("data-topnav");
        } else {
             document.body.setAttribute("data-topnav", "");
        }

        document.body.addEventListener("touchstart", function (e) {
            if(e.touches[0].clientY < 90) {
                startSwipe(e);
            }
        });

        setUpClicks();
    };
};

And this is how it looks after running jsPrettier on it via Sublime (note: had to delete some from the bottom of the output because of the length restriction here):

var TopNav = function() {
    var swiper, topNavPref;
    function ready() {
                                            Settings.SetItem(
                                                                                                                                                                                                                                                                                                                                                                                                                                                            "topnav-hidden",
                                                                                                                                                                                                                                                                                                                                                                                                                                                            {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            /*description: "Cross-sell navigation is hidden by default",*/
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            storage: "local",
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            type: "Boolean"
                                                                                                                                                                                                                                                                                                                                                                                                                                                            }
                                            );

And here is the same code run through the online version:

var TopNav = function() {
  var swiper, topNavPref;
  function ready() {
    Settings.SetItem("topnav-hidden", {
      /*description: "Cross-sell navigation is hidden by default",*/
      storage: "local",
      type: "Boolean"
    });
    topNavPref = Settings.GetItem("topnav-hidden");

    if (topNavPref) {
      document.body.removeAttribute("data-topnav");
    } else {
      document.body.setAttribute("data-topnav", "");
    }

    document.body.addEventListener("touchstart", function(
      e
    ) {
      if (e.touches[0].clientY < 90) {
        startSwipe(e);
      }
    });

    setUpClicks();
  }

};

If there is anything further I can do to help diagnose let me know :)

Not reading node_path

When trying to run the plugin it appears that the plugin is not reading the node_path in the settings to retrieve the correct location of node (I'm using nvm). I get the same message whether I put the location in the default, or user settings file. I also get the same error when the node_path field is left empty.

OS: macOS 10.11.6
Sublime build: 3126

For reference, the node_path value is:

 "node_path": ":/Users/Tim/.nvm/versions/node/v6.4.0/bin"

Here is the error output in the console:

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 818, in run_
    return self.run(edit)
  File "/Users/Tim/Library/Application Support/Sublime Text 3/Packages/JsPrettier/JsPrettier.py", line 50, in run
    if not self.is_global_prettier_installed():
  File "/Users/Tim/Library/Application Support/Sublime Text 3/Packages/JsPrettier/JsPrettier.py", line 148, in is_global_prettier_installed
    if which('prettier', self.get_node_path()) is None:
  File "/Users/Tim/Library/Application Support/Sublime Text 3/Packages/JsPrettier/JsPrettier.py", line 142, in get_node_path
    if os.path.isdir(node_path):
  File "./python3.3/genericpath.py", line 41, in isdir
TypeError: can't specify None for path argument

JsPrettier Error: Use of const in strict mode

This is the error I get when I run the command:

/usr/local/lib/node_modules/prettier/bin/prettier.js:4
const fs = require("fs");
^^^^^
SyntaxError: Use of const in strict mode.

Any help?

Clearer documentation about setting node environment for sublime to what prettier was installed with

After installing prettier and following the instructions I was hitting this issue:

/Users/ml/.nvm/versions/node/v4.4.4/lib/node_modules/prettier/bin/prettier.js:5
const fs = require("fs");
^^^^^
SyntaxError: Use of const in strict mode.
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:935:3

I wasn't sure what the problem was. After some digging, I found that I needed to have my node environment for sublime (for me project specific) as prettier was installed with. Setting this in my .sublime-project file solved it for me:

  "settings": {
    "js_prettier": {
      "prettier_cli_path": "/Users/ml/.nvm/versions/node/v4.4.4/bin/prettier",
      "node_path": "/Users/ml/.nvm/versions/node/v4.4.4/bin/node"
    }
  }

This was not super obvious to me. Could this be documented clearer somewhere?

Related issue: prettier/prettier#99 (comment)

Add option to format entire file only?

When saving a js file while having the auto-format-on-save flag set to true, the plug-in does its job wonderfully.

Now, if the save action was initiated while having a piece of code selected/highlighted, the plug-in for some reason overwrite the whole thing before formatting it and cause it to break. I find this issue to be very frustrating, it would be great if there was a workaround it.

Example:

Before:
screen shot 2017-02-02 at 4 52 15 am
After:
screen shot 2017-02-02 at 4 52 23 am

This is specific to the plug-in and not to the formatter itself.

Support upcoming prettier cosmiconfig

First of all, thanks for integrating prettier in Sublime Text.

As it turns out prettier is going to support (not released as of today) its own editor-independent configuration soon: prettier/prettier#2434

Would be great if SublimeJsPrettier would support this as its main configuration source. Thus the prettier configuration that should apply for a project would only need to be defined in a single place and it would not be necessary for each developer to configure its own editor/IDE to use prettier with the right options (e.g. not every developer might use Sublime Text).

I'm not sure though how this would be best implemented in SublimeJsPrettier.
Not sure if doing a backwards-incompatible change of only using prettier's config would be a possible way to go. Would probably be the easiest way in the long run as it would involve less maintenance on SublimeJsPrettier side (e.g. when new prettier options are introduced).

Format selection

In most cases I can not re-format the whole file. I would however like to format code that I've just added to a file, in other words, select that code and format the selection.

KeyError: 'bracketSpacing'

When I run JsPrettier nothing happens and I get an error in the console.

I installed JsPrettier using npm install -g prettier

My config:

{
  "prettier_cli_path": "/Users/nils/.nvm/versions/node/v6.5.0/bin/prettier",
  "prettier_options": {
    "printWidth": 80,
    "singleQuote": true,
    "trailingComma": true
  }
}

The error I get:

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 818, in run_
    return self.run(edit)
  File "/Users/nils/Library/Application Support/Sublime Text 3/Packages/JsPrettier/JsPrettier.py", line 60, in run
    prettier_options)
  File "/Users/nils/Library/Application Support/Sublime Text 3/Packages/JsPrettier/JsPrettier.py", line 99, in run_prettier
    prettier_cli_opts = self.parse_prettier_option_cli_map(prettier_options)
  File "/Users/nils/Library/Application Support/Sublime Text 3/Packages/JsPrettier/JsPrettier.py", line 250, in parse_prettier_option_cli_map
    option = prettier_options[mapping['option']]
KeyError: 'bracketSpacing'

Any idea what could cause this?

There's no option to silence pop-up errors

jsprettier-error

With a project without prettier installed, and auto_format_on_save: true I get pop-ups every time I save until I set auto_format_on_save: false. I understand the errors are helpful when debugging, but I'd rather have them appear in the console bar, hidden entirely, or somewhere less intrusive.

Is it possible to add an option to silence errors?

Maybe:

error_volume: dialog|console|silent

Versions

Prettier version: 1.5.3
JS Prettier version: 1.12.0
Sublime: Stable Channel, Build 3126
OS: Mac: Sierra 10.12.6

Project Settings:

	"js_prettier":
	{
		"auto_format_on_save": true,
		"prettier_options":
		{
			"printWidth": 120,
			"singleQuote": true,
			"trailingComma": "all"
		}
	},

Steps to reproduce:

  1. Set auto_format_on_save: true
  2. Don't include prettier in your project
  3. Save a JS file

JSPrettier doesn't automatically infer Typescript parsing

Explain the issue

When working in TypeScript, with auto_format_on_save on, the Prettier plugin has a hard time formatting certain lines of my code. For example:

require<any>('version-sort');

becomes

require < any > 'version-sort';

which then throws compiler errors.

When I add "parser": "typescript",, the issue is fixed, but I expected it to automatically know it was a Typescript file because of:

Prettier automatically infers the parser from the input file path, so you shouldn't have to change this setting. -- from Parser Options

Prettier version

[email protected]

JsPrettier Plug-in Version

1.10.0

Platform Details

- Sublime Text Version: 3
- Sublime Text Build: 3126
- Operating System Name: macOS Sierra 
- Operating System Version: 10.12.5

The contents of your <project_name>.sublime-project file (if applicable)

        "prettier_cli_path": "node_modules/.bin/prettier",
        "js_prettier": {
            "auto_format_on_save": true,
            "prettier_options": {
                "printWidth": 120,
                "singleQuote": true,
                "trailingComma": "all",
            }
        }

Steps to reproduce the behavior

  1. Use the same settings as above
  2. Create a typescript file
  3. Write an inline type, like require<any>('version-sort');
  4. Save the file
require<any>('version-sort');

becomes

require < any > 'version-sort';

when it should have stayed the same

Ignored unknown option: --jsx-bracket-same-line=false

Seems like an issue with the update of the Prettier CLI, but it affects this plugin.
The sublime console is returning this error

## Prettier CLI Error Output:
Ignored unknown option: --jsx-bracket-same-line=false
## Prettier CLI Return Code:
    0

support formatting json with --parser json

With prettier 1.5.2 we can now format json by using --parser json

It would be great if this fantastic plugin could support formatting json files through prettier by using the --parser json option

Explain the issue

As a user, I want my json files to be formatted to the same standard as my js files

Prettier version

1.5.2

JsPrettier Plug-in Version

1.10.12

Error: Cannot find module 'prettier'

I haven't gotten a chance to really dive into debugging this yet, but simply running through the install instructions is giving me an error when I try and run the command for the first time.

I verified Prettier was installed and restarted sublime with the same issue.

Also, upon opening the package settings for the first time both the default and user files are empty.

screen shot 2017-01-18 at 7 47 11 pm

EDIT: I forgot to mention that prettier is working via the CLI if that helps.

Request: file size limit for auto formatting

I have auto_format_on_save enabled in one of my projects, and was tweaking a transpiled bundle.js file, only to find that prettier (unsurprisingly) choked on the 300,000 line file. While such cases are rare, they are not nonexistent.
I would propose a solution along the lines of that found in the Trailing Spaces package's trailing_spaces_file_max_size option. Please consider it if you have some time.

Formatting is Incorrect

Sublime Text 3 (Build 3126), default JsPrettier.sublime-settings are used

  1. Two newlines are added to the EOF.
  2. console.log() formatted incorrectly.

prettier git

Note:
To make sure this was not a prettier issue i tried from the CLI it's formatting the file correctly.

Prettier arguments not recognized, possible 1.6 issue

Explain the issue

I upgraded prettier to 1.6.0 and tried to run JsPrettier. It didn't format and I got this error:

------------------
 JsPrettier ERROR 
------------------

Prettier reported the following error:
Ignored unknown option: --single-quote=true
Ignored unknown option: --bracket-spacing=true
Ignored unknown option: --jsx-bracket-same-line=false
Ignored unknown option: --semi=true
Ignored unknown option: --use-tabs=true

Process finished with exit code 0

This may be related to prettier's adoption of a .prettierrc file in version 1.6 to replace other configuration options, possibly including these arguments.

Prettier version

1.6.0

JsPrettier Plug-in Version

1.12.12

Platform Details

- Sublime Text Build: 3126
- Operating System Name: Mac OS
- Operating System Version: 10.11.6 El Capitan

Generated Prettier command line arguments

-----------------------------------------
 JsPrettier DEBUG - Prettier CLI Command 
-----------------------------------------

/usr/local/bin/prettier --stdin --print-width 80 --single-quote=true --trailing-comma none --bracket-spacing=true --jsx-bracket-same-line=false --parser babylon --semi=true --tab-width 4 --use-tabs=false

Is the same behavior observed when run against Prettier directly?

I get the ignored parameters warnings, but Prettier also outputs the formatted file.

The contents of your User/JsPrettier.sublime-settings file

{
	"prettier_options": {
		"singleQuote": true
	}
}

Steps to reproduce the behavior

1. Upgrade prettier
2. Run JsPrettier on a file

Expected behavior: it formats the file.

Actual behavior: It doesn't, outputs an error.

ignored unknown options

node v 7.10.1
npm 5.3

ubuntu 16.04

sublime 3, latest build


JsPrettier DEBUG - Prettier CLI Command

/usr/bin/prettier --stdin --print-width 80 --single-quote=false --trailing-comma none --bracket-spacing=true --jsx-bracket-same-line=false --parser babylon --semi=true --tab-width 2 --use-tabs=false


JsPrettier ERROR

Prettier reported the following error:

Ignored unknown option: --single-quote=false

Ignored unknown option: --bracket-spacing=true

Ignored unknown option: --jsx-bracket-same-line=false

Ignored unknown option: --semi=true

Ignored unknown option: --use-tabs=false

Process finished with exit code 0

trailing Comma option

Setting trailing comma to none does not turn off trailing commas. The off command is a boolean value. Seems to be an issue in prettier itself.

CLI args:
['--print-width', '80', '--single-quote=true', '--trailing-comma', 'none', '--bracket-spacing=true', '--jsx-bracket-same-line=false', '--parser', 'babylon', '--tab-width', '4']

FIX args:
['--print-width', '80', '--single-quote=true', '--trailing-comma=false', '--bracket-spacing=true', '--jsx-bracket-same-line=false', '--parser', 'babylon', '--tab-width', '4']

FYI only.

Less aggressive error reporting?

Firstly, thank you for jumping on making prettier work with sublime. Much appreciated!

However, currently if there is something that can't be parsed in the source file then this package will throw up a dialog with the entire prettier traceback. That traceback is largely useless to understand where the code doesn't parse, but pretty annoying, especially when the package is set to run prettier on save. I'm wondering if there's a more subtle alternative?

Option for format on save?

Thanks for creating this plugin 👍

I wonder if a future release might have a format on save option?

Disabling CSS/SASS support

The recent support for CSS has made this plugin unusable for me. I have custom .SASS files and it's formatting them incorrectly. I only want it to run on JS and JSX but that apparently isn't an option now.

Throw a error when the .vue file has "@"

Reporting an Issue

When reporting an issue, please include the following information in your post:

  • Explain the issue
    The .vue file

Prettier CLI Error Output:

stdin: SyntaxError: Unexpected token (4:30)



<div class="z-modal-wrap" @click="handleMask">
^


<button class="z-modal-close" v-show="closable" @click="handleCancel">

Prettier CLI Return Code: 2

  • Prettier version

  • JsPrettier version
    1.7.0

  • Platform details

  • The generated Prettier command line arguments

  • Steps to reproduce the behavior
    just format the .vue file in sublime

  • Is the same behavior observed when run against Prettier directly?
    Yes

Invalid JSONs

Trailing commas (regardless of your setting) should not be enabled for JSON files because it creates invalid JSONs. This is an issue when you have "auto_format_on_save": true

Request: configurable file extensions for autosave formatting

Right now, JsPrettier only formats files that end in .js or .jsx. That's totally cool for probably most people, but a good chunk of those in the Rails community are using jsx with interpolated ERB, still. Such filenames look like component.js.jsx.erb. ERB doesn't affect prettier's ability to format the code at all, and it works completely out of the box. In my project, I run something like:

prettier --write "app/assets/javascripts/components/*.jsx*" to format exactly the files in question.

Would it be possible to allow an option to pick which file extensions are formatted on save to JsPrettier?

Add keyboard shortcut

Hi! Thank you for the plugin, it works great! Could you add a shortcut key? Invoking Prettier through the menu is pretty slow. Thanks!

Make it possible to use relative paths in `prettier_cli_path`

In JavaScript projects with prettier as dev-dependency (package.json) inside the node_modules folder of the project, it would be great to use this version of prettier.

Something like this in a *.sublime-project file:

{
  "folders": [{ "path": "." }],
  "settings" : {
    "js_prettier": {
      "auto_format_on_save": true,
      "prettier_cli_path": "./node_modules/.bin/prettier"
    }
}

Or maybe its possible to automatically find the first node_modules folder inside a project and use that prettier, otherwise use the globally installed version of prettier.

Formatting JavaScript empties file

Example

Explain the issue

Running Format JavaScript empties file.

Prettier version (command line)

$ prettier --version
1.4.2

JsPrettier version (package.json)

...
"name": "sublime-js-prettier",
"version": "1.4.2",
...

Platform details

- Sublime Text Version: 3
- Sublime Text Build: 3133
- Sublime Text Architecture: What is this?
- Operating System Name: Ubuntu
- Operating System Version: 16.04
- Operating System Architecture: 64bit

Prettier command line arguments (enable the debug setting and open the Sublime Text console to view the cli args passed to Prettier)

/usr/bin/nodejs /home/phil/.npm-global/lib/node_modules/prettier \
    --stdin \
    --color=false \
    --print-width 80 \
    --single-quote=false \
    --trailing-comma none \
    --bracket-spacing=true \
    --jsx-bracket-same-line=false \
    --parser babylon \
    --semi=true \
    --tab-width 4 \
    --use-tabs=false

Is the same behavior observed when run against Prettier directly? For example, to pass the contents of file path_to_js_file.js to Prettier from the command line.

No, nothing happens. The file is not transformed at all.

Steps to reproduce the behavior

A file x.js containing the following will be emptied upon formatting.

function hello() {
    console.log("x")
}

Add support for nvm

Currently figuring out where I should point "node_path", but thinking that needing to update that whenever I wanted to switch node versions seems pretty annoying.

Any reason it can't just pick up prettier from my current $PATH?

Merge Default & User Settings

After a fresh installation of the plug-in and a fresh installation of prettier (0.11.0) as well, executing the formatting command doesn't work, the code is not formatted at all. This has nothing to do with finding prettier path, I am pretty sure of it.

The following message is displayed in the sublime console:

Traceback (most recent call last):
  File "/Applications/Sublime.app/Contents/MacOS/sublime_plugin.py", line 818, in run_
    return self.run(edit)
  File "/Users/a/Library/Application Support/Sublime Text 3/Packages/JsPrettier/JsPrettier.py", line 60, in run
    prettier_options)
  File "/Users/a/Library/Application Support/Sublime Text 3/Packages/JsPrettier/JsPrettier.py", line 98, in run_prettier
    prettier_cli_opts = self.parse_prettier_option_cli_map(prettier_options)
  File "/Users/a/Library/Application Support/Sublime Text 3/Packages/JsPrettier/JsPrettier.py", line 222, in parse_prettier_option_cli_map
    option = prettier_options[mapping['option']]
KeyError: 'printWidth'

doesn't respect my syntax-specific tab_size setting

Prettier version

$ prettier --version
1.1.0

JsPrettier version (package.json)

"name": "sublime-js-prettier",
"version": "1.7.4",

Prettier command line arguments (enable the debug setting and open the ST console)

/usr/local/bin/prettier --stdin --color=false --print-width 80 --single-quote=false --trailing-comma none --bracket-spacing=true --jsx-bracket-same-line=false --parser babylon --semi=true --tab-width 4 --use-tabs=false

Is the same behavior observed when run against Prettier directly from the
command line? For example, to pass the contents of file path_to_js_file.js to
Prettier from the command line.

Yes, but the issue is with what's being sent, not the output.

Steps to reproduce the behavior

1. Open a JavaScript file. Under the Sublime Text menu, select Preferences then Settings – Syntax Specific
2. Set or verify tab_size equal to 2
3. Under Sublime Text Default or User settings, verify that tab_size is equal to a value other than 2.
4. Run the JsPrettier sublime command on the JavaScript file from the command palette
5. The tab_size value from the default/user settings is used instead of the value from the syntax specific settings.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.