Skip to content

Latest commit

 

History

History
100 lines (60 loc) · 3.2 KB

File metadata and controls

100 lines (60 loc) · 3.2 KB

Intro

<= Back * * * Next =>

So, during bootcamp you have to work with javascript even without deep understanding it's parts. Right now it's time to start learn it in details.

Books for the Course

  1. Eloquent JavaScript
  2. Speaking JavaScript
  3. JavaScript for Web Developers

Theory

  1. Speaking JavaScript: Why JavaScript?
  2. Eloquent JavaScript: Introduction
  3. Speaking JavaScript: A Meta Code Style Guide

To establish code style rules we would follow next coding styleguide:

Don't try to understand all parts at once, give it a time and use as a reference

To validate our code we would use next JavaScript linter tool:

Setup

Install EsLint

Go to root folder of the project and install npm modules

npm install

Validate your Javascript

To validate your files in terminal run next command

npm run lint

Configure IDE

You have to make sure that linter is turned on in your IDE and grabs EsLint project's configuration.

Additional

  1. JavaScript for Web Developers: What Is JavaScript
  2. JavaScript for Web Developers: Javascript in HTML
  3. Douglas Crockford: Section 8: Programming Style and Your Brain [1:06:45]
  4. Popular Coding Convention on Github

References

Don't try to read it all at once, bookmark it and use as a reference

  1. AirBnb Styleguide
  2. EsLint Rules

Practice

Exercise: Fix code styling issues

Copy next code to codeStyle.js

var foo = 1,bar = foo;

if (bar) console.log(foo, bar);
  
var array = [1,3,3]
  
for (var i=0; i < array.length, i++)
console.log(arrayp[i])
  1. Run CLI command to get list of errors
  2. inspect code in IDE
    • directly in code editor
    • in code inspector
  3. Make sure that you read about those concerns at EsLint documentation
  4. List them in your issue with description of why it's important to fix them

If you don't see a reason behind concern, just say that in description, don't spend a lot of time on research

<= Back * * * Next =>