Before you start any project follow this guideline to setup ECMAScript Linting for your project
- Initialize Package
npm init -y
- Install linting Packages
npm i -D eslint eslint-config-airbnb eslint-config-airbnb-base eslint-plugin-import
-
To install eslint in your editor VS Code visit the plugin page: https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint
-
Create a
.editorconfig
file
# top-most EditorConfig file
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true
- Create a
.eslintrc.js
file
module.exports = {
"extends": "airbnb-base",
"rules": {
"no-undef": "off",
"no-alert": "off",
"quote-props": "off",
"brace-style": 2,
"object-shorthand": "off",
"no-console": "off"
}
};