VS CODE – ESLINT INSTALL & CONFIG

		
		
			

yarn global add eslint

ALSO, ADD ESLINT VS CODE EXTENSION.

JSON FILE:
———-
{
“name”: “js-press”,
“version”: “1.0.0”,
“description”: “A Mini WordPress with JS”,
“main”: “index.js”,
“scripts”: {
“start”: “node index.js”
},
“repository”: “https://github.com/ahmedmusawir/js-press.git”,
“author”: “The Moose”,
“license”: “MIT”,
“private”: false,
“devDependencies”: {
“eslint”: “^5.6.0”,
“nodemon”: “^1.18.4”
},
“dependencies”: {
“cookie-parser”: “^1.4.3”,
“eslint-config-airbnb”: “^17.1.0”,
“eslint-plugin-import”: “^2.14.0”,
“eslint-plugin-jsx-a11y”: “^6.1.1”,
“eslint-plugin-react”: “^7.11.1”,
“express”: “^4.16.3”,
“express-session”: “^1.15.6”,
“global”: “^4.3.2”,
“mongoose”: “^5.2.17”,
“passport”: “^0.4.0”,
“passport-google-oauth20”: “^1.0.0”
}
}

.eslintrc.js FILE:
——————
module.exports = {
extends: ‘airbnb’,
plugins: [‘react’, ‘jsx-a11y’, ‘import’],
rules: {
‘react/jsx-filename-extension’: 0,
‘no-use-before-define’: 0,
‘import/newline-after-import’: ‘off’,
},
};

VS CODE USER SETTING JSON FILE:
——————————-
{
“editor.fontSize”: 14,
“editor.wordWrap”: “on”,
“editor.tabSize”: 2,
“editor.formatOnSave”: true,
“prettier.singleQuote”: true,
“liveServer.settings.donotShowInfoMsg”: true,
“explorer.confirmDelete”: true,
“emmet.includeLanguages”: {
“javascript”: “javascriptreact”
},
“emmet.syntaxProfiles”: {
“javascript”: “jsx”,
“javascript”: “html”
},
“window.zoomLevel”: 1,
“editor.minimap.enabled”: false,
“javascript.updateImportsOnFileMove.enabled”: “always”,
“eslint.alwaysShowStatus”: true,
“prettier.eslintIntegration”: true,
“prettier.arrowParens”: “always”,
“eslint.autoFixOnSave”: true
}