Name: plugin-swift
Owner: Prettier
Description: Prettier Swift Plugin
Created: 2018-01-05 09:45:44.0
Updated: 2018-05-09 18:50:56.0
Pushed: 2018-04-02 18:41:53.0
Homepage: null
Size: 239
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
:construction: Work in Progress! :construction:
:warning: Warning :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.
You need one of the following:
master
, orAssuming you picked (1) please follow the
installation instructions,
which recommend updating your PATH
at the end:
CHAIN=swift-DEVELOPMENT-SNAPSHOT-2018-03-30-a.xctoolchain
rt 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
:
CHAIN=swift-DEVELOPMENT-SNAPSHOT-2018-03-30-a.xctoolchain
rt PRETTIER_SWIFT_SWIFTC=/Library/Developer/Toolchains/${TOOLCHAIN}/usr/bin/swiftc
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:
yarn
.test.swift
.yarn prettier test.swift
to check the output. add --dev --exact prettier @prettier/plugin-swift
tier --write "**/*.swift"
Marcel Jackwerth |