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
99
Visually experience the beauty of mathematics with p5.js
clown0082
1
2.7k
Rediscover the joy of coding with Creative Coding
clown0082
0
1.3k
全員が意思決定する会社で開発者体験や生産性を見る大変さについて
clown0082
0
550
JavaScript × Mathematics go to Digital Art
clown0082
1
310
In-house study group at YUMEMI
clown0082
0
160
Playing Ionic Logo by p5.js
clown0082
0
210
Skills that employers recommend students to acquire
clown0082
1
260
Walking through the source code of an OSS Library(ESLint))
clown0082
0
350
Other Decks in Programming
See All in Programming
Make Impossible States Impossibleを 意識してReactのPropsを設計しよう
ikumatadokoro
0
230
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
1
100
Arm移行タイムアタック
qnighy
0
330
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
2k
Pinia Colada が実現するスマートな非同期処理
naokihaba
4
230
[Do iOS '24] Ship your app on a Friday...and enjoy your weekend!
polpielladev
0
110
Nurturing OpenJDK distribution: Eclipse Temurin Success History and plan
ivargrimstad
0
960
cmp.Or に感動した
otakakot
3
200
型付き API リクエストを実現するいくつかの手法とその選択 / Typed API Request
euxn23
8
2.2k
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
100
LLM生成文章の精度評価自動化とプロンプトチューニングの効率化について
layerx
PRO
2
190
Less waste, more joy, and a lot more green: How Quarkus makes Java better
hollycummins
0
100
Featured
See All Featured
Visualization
eitanlees
145
15k
Art, The Web, and Tiny UX
lynnandtonic
297
20k
Docker and Python
trallard
40
3.1k
Optimizing for Happiness
mojombo
376
70k
Documentation Writing (for coders)
carmenintech
65
4.4k
A better future with KSS
kneath
238
17k
Building Applications with DynamoDB
mza
90
6.1k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
How to Ace a Technical Interview
jacobian
276
23k
Fireside Chat
paigeccino
34
3k
Faster Mobile Websites
deanohume
305
30k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
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