Slide 1

Slide 1 text

Formatting TypeScript

Slide 2

Slide 2 text

せ⵸: @brn (ꫬꅿ⨳ⵃ) 耵噟: ؿٗٝزؒٝسؒٝآص،٥ط؎ذ؍ـؒٝآص، ⠓爡: Cyberagent ،سذؙأةآؔRightSegment٥AI Messenger ـؚٗ: http://abcdef.gets.b6n.ch/ Twitter: https://twitter.com/brn227 GitHub: https://github.com/brn

Slide 3

Slide 3 text

鳞ְֿה ؝٦ر؍ؚٝ鋉秈⡲׶׋ֻזְկ ٖؽُ٦׃׋ֻזְկ

Slide 4

Slide 4 text

tslintָ֮׷ ֽוְׇ׈ְfixתד׃ַ׃גֻ׸זְկ

Slide 5

Slide 5 text

prettier ׅ׀ֻؿؓ٦وحز׃גֻ׸תׅיկ

Slide 6

Slide 6 text

Conflict ֮ծֽוֿֿtslintהעאַ׏גתׅי…

Slide 7

Slide 7 text

tslint-plugin-prettier conflictׅ׷ٕ٦ٕכ搀⸬ח׃ת׃׳ֲկ׉ֲ׃ת׃׳ֲկ

Slide 8

Slide 8 text

tslint׃䘌׸׷ ➂꟦דַׅ׵יկ pre-commitؿحؙ剅ֹת׃׳ֲ

Slide 9

Slide 9 text

#!/bin/sh! ! for file in $(git diff --cached --name-only --diff- filter=ACM | grep '\.tsx\?$' | tr '\n' ' ')! do! echo "prettier $file";! # Prettify all staged .js files! ./node_modules/.bin/tslint $file -c ./tslint.json -- exclude 'src/**/*.css' --project tsconfig.json --fix! ! # Add back the modified/prettified files to staging! git add $file! ! done!

Slide 10

Slide 10 text

husky and lint-staged 荈ⴓד剅ֻ״׶嚂דׅיկ huskyדpre-commit鏣㹀׃גlint-stagedדlint׾剅ֻ

Slide 11

Slide 11 text

TypeScriptFormatter https://github.com/vvakame/typescript-formatter @vvakameׁ׿ָ⡲׏׋װא LanguageService⢪׏גؿؓ٦وحز׃תׅ

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

תה׭ ؝٦سךؿؓ٦وحزכⰋג荈⹛⻉ׅ׷׿װד