GithubHelp home page GithubHelp logo

isabella232 / plugin-swift Goto Github PK

View Code? Open in Web Editor NEW

This project forked from prettier/plugin-swift

0.0 0.0 0.0 221 KB

[DEPRECATED] Prettier Swift Plugin - WARNING: The AST parser is not stable yet

JavaScript 76.40% Shell 2.08% Swift 21.52%

plugin-swift's Introduction

DEPRECATED

prettier/plugin-swift is deprecated. It hasn’t been updated since early 2018, and the Swift community seems to have moved towards Apple’s swift-format and Nick Lockwood’s SwiftFormat instead.

We hope to someday have plugins for one or both of these tools, but the Prettier team has no current plans to develop such an integration. If you do make something, let us know by opening an issue on the main Prettier repository, and we will consider adding a link to this README.


Prettier Swift

Swift Plugin for the Opinionated Code Formatter

Gitter Travis npm version code style: prettier Follow+Prettier+on+Twitter

What does it do?

⚠️ Warning ⚠️ This plugin might eat your homework in its early stage. It also depends on Swift's lib/Syntax which is in flux. Please stage or commit your code before performing any in-place formatting.

You can check out how it formatted Artsy's Eidolon.

Prerequisites

You need one of the following:

  1. A snapshot from March 30, 2018 or later,
  2. a recent manual build from Swift's master, or
  3. Swift 4.2 (once it's available as a beta or released completely).

Assuming you picked (1) please follow the installation instructions, which recommend updating your PATH at the end:

TOOLCHAIN=swift-DEVELOPMENT-SNAPSHOT-2018-03-30-a.xctoolchain
export PATH=/Library/Developer/Toolchains/${TOOLCHAIN}/usr/bin/:"${PATH}"

Alternatively you can pass the full path to the swiftc binary via the environment variable PRETTIER_SWIFT_SWIFTC:

TOOLCHAIN=swift-DEVELOPMENT-SNAPSHOT-2018-03-30-a.xctoolchain
export PRETTIER_SWIFT_SWIFTC=/Library/Developer/Toolchains/${TOOLCHAIN}/usr/bin/swiftc

Contributing

If you're interested in contributing to the development of Prettier for Swift, you can follow the CONTRIBUTING guide from Prettier, as it all applies to this repository too.

To test it out on a Swift file:

  • Clone this repository.
  • Run yarn.
  • Create a file called test.swift.
  • Run yarn prettier test.swift to check the output.

Install

yarn add --dev --exact prettier prettier/plugin-swift

Use

prettier --write "**/*.swift"

Maintainers


Marcel Jackwerth

plugin-swift's People

Contributors

azz avatar geektree0101 avatar j-f1 avatar mrcljx avatar

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.