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.
- Speaking JavaScript: Why JavaScript?
- Eloquent JavaScript: Introduction
- 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:
Go to root folder of the project and install npm
modules
npm install
To validate your files in terminal run next command
npm run lint
- Install EsLint Plugin
- Use Code Inspector
Code Inspector
allows you to see allEsLint
concerns in one place
- Exclude 'node_modules/' folder from the scope of the project
You have to make sure that linter is turned on in your IDE and grabs EsLint
project's configuration.
- JavaScript for Web Developers: What Is JavaScript
- JavaScript for Web Developers: Javascript in HTML
- Douglas Crockford: Section 8: Programming Style and Your Brain [1:06:45]
- Popular Coding Convention on Github
Don't try to read it all at once, bookmark it and use as a reference
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])
- Run CLI command to get list of errors
- inspect code in IDE
- directly in code editor
- in code inspector
- Make sure that you read about those concerns at
EsLint
documentation - 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