SlideShare a Scribd company logo
1 of 15
Download to read offline
ESLint is the best
linter for JavaScript
now
中島 滋 a.k.a ledsun
2015/11/24 第1回 Machida Tech Night
Self Introduction
中島 滋 a.k.a ledsun
• Luxiar co.,ltd
• Frontend JavaScript programer
• 忍者式テスト(Ninja Test)
• text annotation editor
• graph editor
Why is the ESLint the best
Introduce reasons for that ESLint is the best linter for
JavaScript.
1. Great feature : ESLint can fix source code itself
2. Reason 1 : Support ES6
3. Reason 2 : Error / Warning
4. Reason 3 : Readable rule name
5. Reason 4 : Nice Document
6. Reason 5 : Nice API
7. Extra : I Made a help tool
Great feature : ESLint can fix
source code itself
Sometimes fixing source codes is too expensive to start
using linters.
ESLint can fix source code itself(not all rules).
I recommend "indent", "quotes" and "semi".
Styleが混在している時、途中で変えた時に便利
Fixable rules is marked "(fixable)" in List of available
rules
JSCS, too.
Fixable rules below:
• no-extra-semi
• eqeqeq
• no-multi-spaces
• array-bracket-spacing
• block-spacing
• comma-spacing
• computed-property-spacing
• eol-last
Reason 1 : Support ES6
The ESLint support ES6.
JSCS support.
The JSHint does not support ES6.
Reason 2 : Error / Warning
The ESLint enable to customize error level error or
warning.
This is editor friendly. I want to know hints of the linter
must be fixed before running the program or not during
programing.
Reason 3 : Readable rule
name
Names of lint rule of the ESLint is readable. For
example:
• comma-dangle
• no-cond-assign
• no-console
• no-constant-condition
• no-control-regex
• no-debugger
How about JSHint:
• E001
• E002
oops!
Reason 4 : Nice Document
All rule is documented at http://eslint.org/docs/rules/
Every document for rules has sample code. cf. http://
eslint.org/docs/rules/comma-dangle
Reason 5 : Nice API
A Result of linting of the ESLint has "ruleId".
{
fatal: false,
severity: 2,
ruleId: "semi",
severity: 2,
line: 1,
column: 23,
message: "Expected a semicolon.",
fix: {
range: [1, 15],
text: ";"
}
}
How about JSHint:
[
{
id: '(error)',
raw: 'Read only.',
code: 'W020',
evidence: 'foo = 3;',
line: 2,
character: 1,
scope: '(main)',
a: undefined,
b: undefined,
c: undefined,
d: undefined,
reason: 'Read only.'
}
]
code!?
Extra : I Made a help tool
I made a help tool for ESLint as "eslint-evaluator".
The "eslint-evaluator" count error per rules.
Tools using ESLint is easy to make for "Nice API".
------ Rules have errors -------
[ [ 5,
'no-extra-parens',
'http://eslint.org/docs/rules/no-extra-parens' ],
[ 14, 'no-console', 'http://eslint.org/docs/rules/no-console' ],
[ 17,
'comma-dangle',
'http://eslint.org/docs/rules/comma-dangle' ] ]
------ Rules no errors -------
{
"no-dupe-args": 2,
"no-extra-boolean-cast": 2,
"no-constant-condition": 2,
"no-control-regex": 2,
"no-debugger": 2,
"no-cond-assign": 2,
"no-duplicate-case": 2,
"no-empty-character-class": 2,
"no-empty": 2,
"no-ex-assign": 2
}
Thank you!

More Related Content

What's hot

Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...
Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...
Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...
OdessaJS Conf
 
DevTools
DevToolsDevTools
DevTools
boucher
 
.NET Unit Testing w/ Microsoft Fakes (TechCamp Memphis Spring 2012)
.NET Unit Testing w/ Microsoft Fakes (TechCamp Memphis Spring 2012).NET Unit Testing w/ Microsoft Fakes (TechCamp Memphis Spring 2012)
.NET Unit Testing w/ Microsoft Fakes (TechCamp Memphis Spring 2012)
lancehilliard
 

What's hot (20)

A guide to getting started with WebdriverIO
A guide to getting started with WebdriverIOA guide to getting started with WebdriverIO
A guide to getting started with WebdriverIO
 
Barcamp Bangkhen :: Robot Framework
Barcamp Bangkhen :: Robot FrameworkBarcamp Bangkhen :: Robot Framework
Barcamp Bangkhen :: Robot Framework
 
Understanding & analyzing obfuscated malicious web scripts by Vikram Kharvi
Understanding & analyzing obfuscated malicious web scripts by Vikram KharviUnderstanding & analyzing obfuscated malicious web scripts by Vikram Kharvi
Understanding & analyzing obfuscated malicious web scripts by Vikram Kharvi
 
Testing of React JS app
Testing of React JS appTesting of React JS app
Testing of React JS app
 
Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...
Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...
Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...
 
Server-side template injection- Slides
Server-side template injection- Slides Server-side template injection- Slides
Server-side template injection- Slides
 
AngularJS and Protractor
AngularJS and ProtractorAngularJS and Protractor
AngularJS and Protractor
 
Introduction to cypress in Angular (Chinese)
Introduction to cypress in Angular (Chinese)Introduction to cypress in Angular (Chinese)
Introduction to cypress in Angular (Chinese)
 
Cypress - Best Practices
Cypress - Best PracticesCypress - Best Practices
Cypress - Best Practices
 
DevTools
DevToolsDevTools
DevTools
 
Cypress first impressions
Cypress first impressionsCypress first impressions
Cypress first impressions
 
Meetup React Sanca - 29/11/18 - React Testing
Meetup React Sanca - 29/11/18 - React TestingMeetup React Sanca - 29/11/18 - React Testing
Meetup React Sanca - 29/11/18 - React Testing
 
Breaking The Framework's Core #PHPKonf 2016
Breaking The Framework's Core #PHPKonf 2016Breaking The Framework's Core #PHPKonf 2016
Breaking The Framework's Core #PHPKonf 2016
 
Cypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil Tayar
Cypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil TayarCypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil Tayar
Cypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil Tayar
 
Cypress workshop for JSFoo 2019
Cypress  workshop for JSFoo 2019Cypress  workshop for JSFoo 2019
Cypress workshop for JSFoo 2019
 
.NET Unit Testing w/ Microsoft Fakes (TechCamp Memphis Spring 2012)
.NET Unit Testing w/ Microsoft Fakes (TechCamp Memphis Spring 2012).NET Unit Testing w/ Microsoft Fakes (TechCamp Memphis Spring 2012)
.NET Unit Testing w/ Microsoft Fakes (TechCamp Memphis Spring 2012)
 
Robot Framework : Lord of the Rings By Asheesh M
Robot Framework : Lord of the Rings By Asheesh MRobot Framework : Lord of the Rings By Asheesh M
Robot Framework : Lord of the Rings By Asheesh M
 
Testing Storm components with Groovy and Spock
Testing Storm components with Groovy and SpockTesting Storm components with Groovy and Spock
Testing Storm components with Groovy and Spock
 
Can you TDD Rails?
Can you TDD Rails?Can you TDD Rails?
Can you TDD Rails?
 
How to go about testing in React?
How to go about testing in React? How to go about testing in React?
How to go about testing in React?
 

Similar to 20151117 es lint

Orthogonality: A Strategy for Reusable Code
Orthogonality: A Strategy for Reusable CodeOrthogonality: A Strategy for Reusable Code
Orthogonality: A Strategy for Reusable Code
rsebbe
 
Speed geeking-lotusscript
Speed geeking-lotusscriptSpeed geeking-lotusscript
Speed geeking-lotusscript
Bill Buchan
 
Dev buchan 30 proven tips
Dev buchan 30 proven tipsDev buchan 30 proven tips
Dev buchan 30 proven tips
Bill Buchan
 
gdscWorkShopJavascriptintroductions.pptx
gdscWorkShopJavascriptintroductions.pptxgdscWorkShopJavascriptintroductions.pptx
gdscWorkShopJavascriptintroductions.pptx
sandeshshahapur
 

Similar to 20151117 es lint (20)

Build testable react app
Build testable react appBuild testable react app
Build testable react app
 
C++ Restrictions for Game Programming.
C++ Restrictions for Game Programming.C++ Restrictions for Game Programming.
C++ Restrictions for Game Programming.
 
Static Code Analysis and AutoLint
Static Code Analysis and AutoLintStatic Code Analysis and AutoLint
Static Code Analysis and AutoLint
 
Aspect j introduction for non-programmers
Aspect j introduction for non-programmersAspect j introduction for non-programmers
Aspect j introduction for non-programmers
 
How to set up es lint for react projects
How to set up es lint for react projectsHow to set up es lint for react projects
How to set up es lint for react projects
 
Introduction to Python for Security Professionals
Introduction to Python for Security ProfessionalsIntroduction to Python for Security Professionals
Introduction to Python for Security Professionals
 
Writing code for people
Writing code for peopleWriting code for people
Writing code for people
 
presentation
presentationpresentation
presentation
 
Add-On Development: EE Expects that Every Developer will do his Duty
Add-On Development: EE Expects that Every Developer will do his DutyAdd-On Development: EE Expects that Every Developer will do his Duty
Add-On Development: EE Expects that Every Developer will do his Duty
 
Add-On Development: EE Expects that Every Developer will do his Duty
Add-On Development: EE Expects that Every Developer will do his DutyAdd-On Development: EE Expects that Every Developer will do his Duty
Add-On Development: EE Expects that Every Developer will do his Duty
 
presentation
presentationpresentation
presentation
 
The Good, the Bad and the Ugly things to do with android
The Good, the Bad and the Ugly things to do with androidThe Good, the Bad and the Ugly things to do with android
The Good, the Bad and the Ugly things to do with android
 
12 Step Guide to Lotuscript
12 Step Guide to Lotuscript12 Step Guide to Lotuscript
12 Step Guide to Lotuscript
 
JS-formatter
JS-formatterJS-formatter
JS-formatter
 
How to write good quality code
How to write good quality codeHow to write good quality code
How to write good quality code
 
Best Practices for Building WordPress Applications
Best Practices for Building WordPress ApplicationsBest Practices for Building WordPress Applications
Best Practices for Building WordPress Applications
 
Orthogonality: A Strategy for Reusable Code
Orthogonality: A Strategy for Reusable CodeOrthogonality: A Strategy for Reusable Code
Orthogonality: A Strategy for Reusable Code
 
Speed geeking-lotusscript
Speed geeking-lotusscriptSpeed geeking-lotusscript
Speed geeking-lotusscript
 
Dev buchan 30 proven tips
Dev buchan 30 proven tipsDev buchan 30 proven tips
Dev buchan 30 proven tips
 
gdscWorkShopJavascriptintroductions.pptx
gdscWorkShopJavascriptintroductions.pptxgdscWorkShopJavascriptintroductions.pptx
gdscWorkShopJavascriptintroductions.pptx
 

More from Nakajima Shigeru (6)

Introduction of ES2015
Introduction of ES2015Introduction of ES2015
Introduction of ES2015
 
ChakraCore is what?
ChakraCore is what?ChakraCore is what?
ChakraCore is what?
 
東京Node学園祭飛び込みLT
東京Node学園祭飛び込みLT東京Node学園祭飛び込みLT
東京Node学園祭飛び込みLT
 
Why js
Why jsWhy js
Why js
 
Ninja Testing at Toteka03
Ninja Testing at Toteka03Ninja Testing at Toteka03
Ninja Testing at Toteka03
 
Ninja Testing at XP Matsuri
Ninja Testing at XP MatsuriNinja Testing at XP Matsuri
Ninja Testing at XP Matsuri
 

Recently uploaded

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 

20151117 es lint

  • 1. ESLint is the best linter for JavaScript now 中島 滋 a.k.a ledsun 2015/11/24 第1回 Machida Tech Night
  • 2. Self Introduction 中島 滋 a.k.a ledsun • Luxiar co.,ltd • Frontend JavaScript programer • 忍者式テスト(Ninja Test) • text annotation editor • graph editor
  • 3. Why is the ESLint the best Introduce reasons for that ESLint is the best linter for JavaScript. 1. Great feature : ESLint can fix source code itself 2. Reason 1 : Support ES6 3. Reason 2 : Error / Warning 4. Reason 3 : Readable rule name 5. Reason 4 : Nice Document 6. Reason 5 : Nice API 7. Extra : I Made a help tool
  • 4. Great feature : ESLint can fix source code itself Sometimes fixing source codes is too expensive to start using linters. ESLint can fix source code itself(not all rules). I recommend "indent", "quotes" and "semi". Styleが混在している時、途中で変えた時に便利 Fixable rules is marked "(fixable)" in List of available rules JSCS, too.
  • 5. Fixable rules below: • no-extra-semi • eqeqeq • no-multi-spaces • array-bracket-spacing • block-spacing • comma-spacing • computed-property-spacing • eol-last
  • 6. Reason 1 : Support ES6 The ESLint support ES6. JSCS support. The JSHint does not support ES6.
  • 7. Reason 2 : Error / Warning The ESLint enable to customize error level error or warning. This is editor friendly. I want to know hints of the linter must be fixed before running the program or not during programing.
  • 8. Reason 3 : Readable rule name Names of lint rule of the ESLint is readable. For example: • comma-dangle • no-cond-assign • no-console • no-constant-condition • no-control-regex • no-debugger
  • 9. How about JSHint: • E001 • E002 oops!
  • 10. Reason 4 : Nice Document All rule is documented at http://eslint.org/docs/rules/ Every document for rules has sample code. cf. http:// eslint.org/docs/rules/comma-dangle
  • 11. Reason 5 : Nice API A Result of linting of the ESLint has "ruleId". { fatal: false, severity: 2, ruleId: "semi", severity: 2, line: 1, column: 23, message: "Expected a semicolon.", fix: { range: [1, 15], text: ";" } }
  • 12. How about JSHint: [ { id: '(error)', raw: 'Read only.', code: 'W020', evidence: 'foo = 3;', line: 2, character: 1, scope: '(main)', a: undefined, b: undefined, c: undefined, d: undefined, reason: 'Read only.' } ] code!?
  • 13. Extra : I Made a help tool I made a help tool for ESLint as "eslint-evaluator". The "eslint-evaluator" count error per rules. Tools using ESLint is easy to make for "Nice API".
  • 14. ------ Rules have errors ------- [ [ 5, 'no-extra-parens', 'http://eslint.org/docs/rules/no-extra-parens' ], [ 14, 'no-console', 'http://eslint.org/docs/rules/no-console' ], [ 17, 'comma-dangle', 'http://eslint.org/docs/rules/comma-dangle' ] ] ------ Rules no errors ------- { "no-dupe-args": 2, "no-extra-boolean-cast": 2, "no-constant-condition": 2, "no-control-regex": 2, "no-debugger": 2, "no-cond-assign": 2, "no-duplicate-case": 2, "no-empty-character-class": 2, "no-empty": 2, "no-ex-assign": 2 }