Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Walking through the source code of an OSS libra...
Search
kkeeth
May 21, 2022
Programming
0
170
Walking through the source code of an OSS library(ESLint)
kkeeth
May 21, 2022
Tweet
Share
More Decks by kkeeth
See All by kkeeth
The history of Javascript frameworks: changes in front-end design philosophy
clown0082
2
110
Visually experience the beauty of mathematics with p5.js
clown0082
1
2.7k
Rediscover the joy of coding with Creative Coding
clown0082
0
1.4k
全員が意思決定する会社で開発者体験や生産性を見る大変さについて
clown0082
0
560
JavaScript × Mathematics go to Digital Art
clown0082
1
330
In-house study group at YUMEMI
clown0082
0
170
Playing Ionic Logo by p5.js
clown0082
0
220
Skills that employers recommend students to acquire
clown0082
1
260
Walking through the source code of an OSS Library(ESLint))
clown0082
0
360
Other Decks in Programming
See All in Programming
良いユニットテストを書こう
mototakatsu
5
2k
数十万行のプロジェクトを Scala 2から3に完全移行した
xuwei_k
0
270
17年周年のWebアプリケーションにTanStack Queryを導入する / Implementing TanStack Query in a 17th Anniversary Web Application
saitolume
0
250
クリエイティブコーディングとRuby学習 / Creative Coding and Learning Ruby
chobishiba
0
3.9k
Cloudflare MCP ServerでClaude Desktop からWeb APIを構築
kutakutat
1
540
range over funcの使い道と非同期N+1リゾルバーの夢 / about a range over func
mackee
0
110
暇に任せてProxmoxコンソール 作ってみました
karugamo
1
720
Go の GC の不得意な部分を克服したい
taiyow
2
770
短期間での新規プロダクト開発における「コスパの良い」Goのテスト戦略」 / kamakura.go
n3xem
2
170
急成長期の品質とスピードを両立するフロントエンド技術基盤
soarteclab
0
930
PHPとAPI Platformで作る本格的なWeb APIアプリケーション(入門編) / phpcon 2024 Intro to API Platform
ttskch
0
150
103 Early Hints
sugi_0000
1
230
Featured
See All Featured
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
Speed Design
sergeychernyshev
25
670
The Pragmatic Product Professional
lauravandoore
32
6.3k
Optimizing for Happiness
mojombo
376
70k
Done Done
chrislema
181
16k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
247
1.3M
Into the Great Unknown - MozCon
thekraken
33
1.5k
Thoughts on Productivity
jonyablonski
67
4.4k
Visualization
eitanlees
146
15k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
28
900
Transcript
Walking through the source code of an OSS library(ESLint)
'SPOUFOE&OHJOFFS-5 #FFS#BTI @kkeeth @kuwahara_jsri @kkeeth
Who am I const my_info = { Name: ‘Kuwahara KEETH
Kiyohito’, Company: ‘Yumemi Inc’, Position: ‘Servant Leader/Board’, Skills: ‘Riot.js/Next.js/Chit-chat’, }
Published
OQNKTDPNdLLFFUI
🙇 Sorry … 🙇 This slide is written in English.
However, I am still learning English, and there may be some inappropriate expressions. Plz feedback for me called “Masakari” about my talk!!
Let’s start 😆
one day in development 💁
*NDPODFSOFEBCPVUUIFCFIBWJPS PGUIJTEFQFOEFOUMJCSBSZ🤔 *TOUUIBUBIVSEMFUPCFHJOXJUI $BOZPVSFBMMZSFBEJU me my “inner voice” -FUTSFBEUIFDPEFPGUIJTMJCSBSZ
me
:FT CVU*EPOUVOEFSTUBOEXIBU UIJTMJCSBSZJTEPJOHBOE .BZCFZPVEPOUIBWFUIFUJNF *TUIBUFTTFOUJBMMZXIBUZPVXBOUUP TPMWF me my “inner
voice” *UEFQFOETPOUIFUIJOH CVU JOUFSJNTVQQPSUDBOCFBMJBCJMJUZ MBUFSPO me
#VUFWFOJGZPVVOEFSTUBOEUIF TPVSDFDPEF XIBUEPZPVEPXJUI JU my “inner voice” *GJUTBCVH JUTCFTUUPDSFBUFBO JTTVFPS13
me 8IFOEPZPVUIJOLUIBUXJMMCF SFTPMWFE %PZPVUIJOLJUXJMMCF EPOFPOUJNF my “inner voice”
*GOPU UIFXPSTUUIBUDBOIBQQFOJT UIBUXFGPSLUIFSFQPTJUPSZBOE MPBEUIFDIBOHFT 8IPJTHPJOHUPNBJOUBJOJU 8IBUTUIFDPTU me my “inner
voice” )NNN*HVFTTTP0LBZ MFUT KVTUBTTVNFUIBUTUIFEFTJHOJUT TVQQPTFEUPCF😅 me
*GOPU UIFXPSTUUIBUDBOIBQQFOJT UIBUXFGPSLUIFSFQPTJUPSZBOE MPBEUIFDIBOHFT 8IPJTHPJOHUPNBJOUBJOJU 8IBUTUIFDPTU me my “inner
voice” )NNN*HVFTTTP0LBZ MFUT KVTUBTTVNFUIBUTUIFEFTJHOJUT TVQQPTFEUPCF😅 me none of your business ʘ(^o^)ʗ
I feel like I could learn more from reading codes
😆
Then, let's read the source code of ESLint!
*NBHFCZIUUQTFTMJOUPSH
Basically, we start from the module written in the main
of package.json💁
Next, let’s look at “bin” dir.
Only 3 helper functions and an executable function here💁
None
Next, let’s look at “lib/cli.js” fi le.
None
“cli.js” depends on “ESLint” module “ESLint” module depends on “CLIEngine”
module
I found out later that...
There exists a dependency map💁 *NBHFCZIUUQTHJUIVCDPNFTMJOUFTMJOUCMPCNBJOEPDTTSDEFWFMPQFSHVJEFBSDIJUFDUVSFEFQFOEFODZTWH
Knowledge 1: Overall design
Unified format for writing each module📝
Uni fi ed format for writing each module
Uni fi ed format for writing each module
util objects rich in methods📝
w /PEFKTlVUJMzPCKFDU w MJCSVMFTVUJMTBTUVUJMT w MJCTIBSFETUSJOHVUJMT w MJCTIBSFETBTUVUJMT NFUIPET SFHHFYQBUUFSOT
w MJCTPVSDFDPEFUPLFOTUPSFVUJMT the number of using methods
Knowledge 2: Node.js’s “util” module is useful
w VUJMJOTQFDU w VUJMGPSNBU w VUJMJOIFSJUT w VUJMMQSPNJTJGZ ˡ8IBUTVSQSJTFENFXBTUIJT Methods
used by ESLint
*NBHFCZIUUQTOPEFKTPSHBQJVUJMIUNM
Knowledge 3: Generator functions in JavaScript
Do you understand the following code?💁
None
Let's take a look at some sample codes💁
None
None
None
more detail, show MDN👉
An afterthought
An afterthought w /PUXSJUUFOJOUZQFTDSJQU UZQFEF fi OJUJPOTBSFXSJUUFO w "OZXBZ
UIFEPDVNFOUBUJPOJTFYUFOTJWF w +4%PDJTXFMMEPDVNFOUFE BTJTNE w %PDVNFOUBUJPOJTVTJOH&MFWFOUZKT UZ w 5PPMTGPS44( w %PDVNFOUBUJPOBQQJTFBTJFSUPWJFXUIBOUIFP ff i DJBMTJUF w 5IFSFBSFBMTPDPODFQUTPGMBZPVUBOEDPNQPOFOUT
None
None
Thoughts💁
Thoughts w 8FEPOUIBWFUPVOEFSTUBOEJUUPUBMZ👍 w %FTJHOJOHGBNPVTMJCSBSJFTJTBHSFBUMFBSOJOHFYQFSJFODF👍 w 8FDBOJNQSPWFNZTLJMMTGPSTVSF👍 w *GZPV fi
OEJUEJ ff i DVMU ZPVDBOSFBEJUXJUITPNFPOFFMTF👍 w *GZPVIBWFUSPVCMF JU`THPPEUPSFBEGSPNUIFUFTUDPEF👍
None