Skip to content
baltasarb edited this page Sep 26, 2018 · 11 revisions

Table of Contents

Express

Express Generator

Install express generator globally:

npm install express-generator -g

Display command options with:

npm install express-generator -g

Create the application skeleton with:

express --view=selectedViewEngine appName

To finish, change the directory to appName and run:

npm install

Eslint

Install esling locally with google configuration:

npm install --save-dev eslint eslint-config-google

Create a configuration file with:

eslint --init

Issues

Unexpected console statement no-console

In the .eslintrc file add the rule:

rules: {
    'no-console': 'off'
}

The keyword 'const' is reserved

Add to .eslintrc file:

"parserOptions": {
    "ecmaVersion": 6
}

Or the following which produces the same effect:

"env": {
    "es6":true
}

Expected linebreaks to be 'LF' but found 'CRLF'

If the following rule is present and the current os is windows:

eslint linebreak-style: ["error", "unix"]

Change to:

eslint linebreak-style: ["error", "windows"]