From 836137488d3a7250dfa6773bfb63551cb8e61a9e Mon Sep 17 00:00:00 2001 From: Brent Guffens Date: Fri, 19 Jan 2018 13:59:05 +0100 Subject: [PATCH 1/3] Curly braces section improvement --- 1-js/03-code-quality/02-coding-style/article.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/1-js/03-code-quality/02-coding-style/article.md b/1-js/03-code-quality/02-coding-style/article.md index 2ea6fb7b..c05f459c 100644 --- a/1-js/03-code-quality/02-coding-style/article.md +++ b/1-js/03-code-quality/02-coding-style/article.md @@ -42,9 +42,9 @@ Now let's discuss the rules and reasons for them in detail. Nothing is "carved in stone" here. Everything is optional and can be changed: these are coding rules, not religious dogmas. -### Figure brackets +### Curly braces -In most JavaScript projects figure brackets are written on the same line, not on the new line. A so-called "egyptian" style. There's also a space before an opening bracket. +In most JavaScript projects curly braces are written on the same line as the corresponding keyword, not on the new line, a so-called "Egyptian" style. There's also a space before an opening bracket. Like this: From 1fa9833832e26dbc9b63524e98ef35221d6fafdc Mon Sep 17 00:00:00 2001 From: Brent Guffens Date: Fri, 19 Jan 2018 14:07:51 +0100 Subject: [PATCH 2/3] npm clarification --- 1-js/03-code-quality/02-coding-style/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/03-code-quality/02-coding-style/article.md b/1-js/03-code-quality/02-coding-style/article.md index c05f459c..098e4271 100644 --- a/1-js/03-code-quality/02-coding-style/article.md +++ b/1-js/03-code-quality/02-coding-style/article.md @@ -295,7 +295,7 @@ Most linters are integrated with editors: just enable the plugin in the editor a For instance, for ESLint you should do the following: 1. Install [Node.JS](https://nodejs.org/). -2. Install ESLint with the command `npm install -g eslint` (npm is Node.JS package installer). +2. Install ESLint with the command `npm install -g eslint` (npm is a JavaScript package installer). 3. Create a config file named `.eslintrc` in the root of your JavaScript project (in the folder that contains all your files). Here's an example of `.eslintrc`: From 31bc5347c9cf3cd4c2820a63f8ba4c3507fec3a3 Mon Sep 17 00:00:00 2001 From: Brent Guffens Date: Fri, 19 Jan 2018 14:11:18 +0100 Subject: [PATCH 3/3] evade -> avoid --- 1-js/03-code-quality/02-coding-style/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/03-code-quality/02-coding-style/article.md b/1-js/03-code-quality/02-coding-style/article.md index 098e4271..ffcc654a 100644 --- a/1-js/03-code-quality/02-coding-style/article.md +++ b/1-js/03-code-quality/02-coding-style/article.md @@ -331,6 +331,6 @@ Also certain IDEs support built-in linting, that also may be good, but not so tu All syntax rules from this chapter and the style guides aim to increase readability, so all of them are debatable. -When we think about "how to write better?", the sole criterion is "what makes the code more readable and easier to understand? what helps to evade errors?" That's the main thing to keep in mind when choosing the style or discussing which one is better. +When we think about "how to write better?", the sole criterion is "what makes the code more readable and easier to understand? what helps to avoid errors?" That's the main thing to keep in mind when choosing the style or discussing which one is better. Read style guides to see the latest ideas about that and follow those that you find the best.