Upgrade to Pro — share decks privately, control downloads, hide ads and more …

LintオタクによるLint解説 / Introduction to Lints

Kuniwak
November 18, 2022

LintオタクによるLint解説 / Introduction to Lints

Kuniwak

November 18, 2022
Tweet

More Decks by Kuniwak

Other Decks in Programming

Transcript

  1. 22 ߏจղੳ -JOUίϯύΠϧ࣌ݕࠪ ୯ମɾ݁߹ςετϨϏϡʔ γεςϜςετ ຊ൪؀ڥͰͷΤϥʔऩू Ϣʔβʔ͔Βͷ͓໰͍߹Θͤ ໰୊9 ໰୊: ্ͷํͷखஈͰࢭ·Δͱ

    ௿ίετͰ໰୊Λݕग़Ͱ͖Δ ಛघͳ໰୊͸Լͷํͷ खஈͰ͔͠ݕग़Ͱ͖ͳ͍ ໰ ୊ Λ ݕ ग़ ͢ Δ ͨ Ί ͷ ख ஈ
  2. 28 -JOUΛ࢖࣮ͬͨݱํ๏ͷྫ w ܕΤϥʔͷݕग़ ‎ ੩తܕݕࠪͷͰ͖Δ-JOUΛಋೖ͢Δ w ίʔσΟϯάελΠϧҧ൓ͷݕग़ ‎ -JOUͷઃఆΛڞ༗͢Δ͜ͱͰ࣮ݱͰ͖Δ

    w ϓϩδΣΫτ಺Ͱ࣮૷͞Εͨػೳͷޡ༻ͷݕग़ ‎ -JOUͷϧʔϧΛ࣮૷࣮ͯ͠ݱͰ͖Δ ͜ͷͨΊʹ͸-JOUͷ ߏ଄Λ஌Δඞཁ͕͋Δ
  3. 31 -JOUͷ୅දతͳߏ଄ ݕࠪϧʔϧΛԣஅ͢Δॲཧ ʢ$-*ͷఏڙɺݕࠪ༰қͳσʔλ΁ͷม׵ɺݕࠪϧʔϧͷ࣮ߦʣ ݕࠪ ϧʔϧ ݕࠪ ϧʔϧ ݕࠪ ϧʔϧ

    ݕࠪ ϧʔϧ ݕࠪϧʔϧ͝ͱʹݸผͷ ίϯϙʔωϯτͱ࣮ͯ͠૷͠ɺ ԣஅॲཧΛݕࠪϧʔϧʹ ґଘͤ͞ͳ͍ߏ଄͕΄ͱΜͲɻ ͳ͓-JOUͷίʔυΛಡΉ ࡍʹ͸ɺίʔυྔͷগͳ͍ ݕࠪϧʔϧ͔Β͕͓͢͢Ίɻ ґ ଘ ݩ ґ ଘ ઌ
  4. 35 ݕ͍ࠪͨ͠ ιʔείʔυ ݕग़ͨ͠ ໰୊ͷҰཡ ॲཧͷྲྀΕͷൺֱ ࣈ۟ ղੳ ݕࠪ τʔΫϯྻ

    ʢޙड़ʣ ݕ͍ࠪͨ͠ ιʔείʔυ ݕग़ͨ͠ ໰୊ͷҰཡ ݕࠪ ந৅ߏจ໦ ʢޙड़ʣ ߏจ ղੳ ͜ͷ෦෼͕ҟͳΔ͚ͩ
  5. 37 τʔΫϯྻ τʔΫϯྻ function helloWorld ( ) { console .

    log τʔΫϯͱ͸ɺιʔείʔυͷ จࣈྻʹग़ݱ͢ΔҙຯΛ࣋ͬͨ ࠷খ୯Ґͷ͜ͱ
  6. 38 /** ϋϩʔϫʔϧυΛදࣔ͢Δ */ function helloWorld() { console.log("Hello, World!"); }

    τʔΫϯྻ τʔΫϯྻ function helloWorld ( ) { console . log ؆୯ͳ+BWB4DSJQUͷιʔείʔυ ͷτʔΫϯΛݟͯΈΑ͏ ͜ͷίʔυͷઌ಄͔ΒॱʹԿ͕ τʔΫϯʹͳΔͷ͔Λݟ͍ͯ͘
  7. 39 /** ϋϩʔϫʔϧυΛදࣔ͢Δ */ function helloWorld() { console.log("Hello, World!"); }

    τʔΫϯྻ τʔΫϯྻ function helloWorld ( ) { console . log τʔΫϯ
  8. 40 /** ϋϩʔϫʔϧυΛදࣔ͢Δ */ function helloWorld() { console.log("Hello, World!"); }

    τʔΫϯྻ τʔΫϯྻ function helloWorld ( ) { console . log τʔΫϯ
  9. 41 /** ϋϩʔϫʔϧυΛදࣔ͢Δ */ function helloWorld() { console.log("Hello, World!"); }

    τʔΫϯྻ τʔΫϯྻ function helloWorld ( ) { console . log τʔΫϯ
  10. 42 /** ϋϩʔϫʔϧυΛදࣔ͢Δ */ function helloWorld() { console.log("Hello, World!"); }

    τʔΫϯྻ τʔΫϯྻ function helloWorld ( ) { console . log τʔΫϯ
  11. 43 /** ϋϩʔϫʔϧυΛදࣔ͢Δ */ function helloWorld() { console.log("Hello, World!"); }

    τʔΫϯྻ τʔΫϯྻ function helloWorld ( ) { console . log τʔΫϯ
  12. 48 τʔΫϯྻ τʔΫϯྻ with ( obj ) { console .

    log XJUIจͷར༻Λݕग़͢Δ-JOUͷ ॲཧͷྲྀΕΛΈͯΈΑ͏
  13. 49 τʔΫϯྻ τʔΫϯྻ with ( obj ) { console .

    log // ېࢭ͞Ε͍ͯΔ with จΛ࢖͍ͬͯΔ with (obj) { console.log(obj); }
  14. 50 τʔΫϯྻ τʔΫϯྻ with ( obj ) { console .

    log // ېࢭ͞Ε͍ͯΔ with จΛ࢖͍ͬͯΔ with (obj) { console.log(obj); }
  15. 51 τʔΫϯྻ τʔΫϯྻ with ( obj ) { console .

    log // ېࢭ͞Ε͍ͯΔ with จΛ࢖͍ͬͯΔ with (obj) { console.log(obj); } τʔΫϯྻͷઌ಄͔Βॱʹɺ τʔΫϯ͕XJUIΩʔϫʔυ͔ Ͳ͏͔ௐ΂Δ͜ͱͰɺXJUIจͷ ࢖༻Λݕग़Ͱ͖Δ
  16. 52 τʔΫϯྻ τʔΫϯྻ with ( obj ) { console .

    log // ېࢭ͞Ε͍ͯΔ with จΛ࢖͍ͬͯΔ with (obj) { console.log(obj); } XJUIΩʔϫʔυͷൃݟʹΑΓ XJUIจͷ࢖༻Λݕग़Ͱ͖ͨ
  17. 56 /** ϋϩʔϫʔϧυΛදࣔ͢Δ */ function helloWorld() { console.log("Hello, World!"); }

    ؆୯ͳ+BWB4DSJQUͷιʔείʔυ ͷந৅ߏจ໦ΛݟͯΈΑ͏ ந৅ߏจ໦ Program FuncDecl BlockStmt ExprStmt Identifier CallExpr Identifier Identifier MemExpr Literal ந৅ߏจ໦Λཧղ͢Δʹ͸ɺ༿͔Β ରԠ͢Δ෦෼ΛΈ͍ͯ͘ͱΑ͍
  18. 57 /** ϋϩʔϫʔϧυΛදࣔ͢Δ */ function helloWorld() { console.log("Hello, World!"); }

    ந৅ߏจ໦ Program FuncDecl BlockStmt ExprStmt Identifier CallExpr Identifier MemExpr Literal Identifier
  19. 58 /** ϋϩʔϫʔϧυΛදࣔ͢Δ */ function helloWorld() { console.log("Hello, World!"); }

    ந৅ߏจ໦ Program FuncDecl BlockStmt ExprStmt Identifier CallExpr MemExpr Identifier Literal Identifier
  20. 59 /** ϋϩʔϫʔϧυΛදࣔ͢Δ */ function helloWorld() { console.log("Hello, World!"); }

    ந৅ߏจ໦ Program FuncDecl BlockStmt ExprStmt Identifier CallExpr Literal MemExpr Identifier Identifier
  21. 60 /** ϋϩʔϫʔϧυΛදࣔ͢Δ */ function helloWorld() { console.log("Hello, World!"); }

    ந৅ߏจ໦ Program FuncDecl BlockStmt ExprStmt Identifier CallExpr Identifier MemExpr Identifier Literal
  22. 61 /** ϋϩʔϫʔϧυΛදࣔ͢Δ */ function helloWorld() { console.log("Hello, World!"); }

    ந৅ߏจ໦ Program FuncDecl BlockStmt ExprStmt Identifier CallExpr Literal MemExpr Identifier Identifier
  23. 62 /** ϋϩʔϫʔϧυΛදࣔ͢Δ */ function helloWorld() { console.log("Hello, World!"); }

    ந৅ߏจ໦ Program FuncDecl BlockStmt ExprStmt Identifier CallExpr Literal MemExpr Identifier Identifier
  24. 63 /** ϋϩʔϫʔϧυΛදࣔ͢Δ */ function helloWorld() { console.log("Hello, World!"); }

    ந৅ߏจ໦ Program FuncDecl BlockStmt Identifier CallExpr ExprStmt Literal MemExpr Identifier Identifier
  25. 64 /** ϋϩʔϫʔϧυΛදࣔ͢Δ */ function helloWorld() { console.log("Hello, World!"); }

    ந৅ߏจ໦ Program FuncDecl BlockStmt Identifier CallExpr ExprStmt Literal MemExpr Identifier Identifier
  26. 75 ந৅ߏจ໦ Identifier Identifier MemExpr Literal Program FuncDecl Identifier BlockStmt

    ExprStmt CallExpr $BMM&YQSΛൃݟͨ͠Βɺ͜ͷ ؔ਺ݺͼग़͕͠DPOTPMFMPHͷ ݺͼग़͠Ͱ͋Δ͜ͱΛ֬ೝ͢Δ ۩ମతʹ͸ɺݺͼग़͠ର৅͕ DPOTPMF͔ΒMPHϓϩύςΟΛ ࢀর͢Δ.FN&YQSͰ͋Δ͜ͱΛ ֬ೝ͢Ε͹ྑ͍
  27. 76 ந৅ߏจ໦ Literal Program FuncDecl Identifier BlockStmt ExprStmt CallExpr Identifier

    Identifier MemExpr /** ϋϩʔϫʔϧυΛදࣔ͢Δ */ function helloWorld() { console.log("Hello, World!"); } ݺͼग़͠ର৅͕DPOTPMFMPHͰ͋Δ͜ͱΛ֬ೝ
  28. 77 ந৅ߏจ໦ Literal Program FuncDecl Identifier BlockStmt ExprStmt CallExpr Identifier

    Identifier MemExpr /** ϋϩʔϫʔϧυΛදࣔ͢Δ */ function helloWorld() { console.log("Hello, World!"); } DPOTPMFMPHͷؔ਺ݺͼग़͠Λݕग़Ͱ͖ͨ