Skip to content

Instantly share code, notes, and snippets.

@joshdcuneo
Last active February 13, 2019 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshdcuneo/642fa9586c4f54c082b195b4deffc20c to your computer and use it in GitHub Desktop.
Save joshdcuneo/642fa9586c4f54c082b195b4deffc20c to your computer and use it in GitHub Desktop.
Javascript Linting Setup
{
"extends": ["eslint:recommended", "eslint-config-prettier"],
"parserOptions": { "ecmaVersion": 2018 },
"rules": {
"no-console": "off",
"prefer-const": [
"error",
{
"destructuring": "any",
"ignoreReadBeforeAssign": false
}
],
"no-unused-vars": ["error", { "argsIgnorePattern": "^_" }]
},
"env": {
"node": true,
"es6": true,
"browser": true
}
}
{
"printWidth": 120,
"semi": true,
"bracketSpacing": true
}
{
"scripts": {
"lint": "eslint src",
"lint:fix": "eslint src --fix",
"format": "yarn prettier --write",
"prettier": "prettier \"**/*.+(js|jsx|json|yml|yaml|css|less|scss|ts|tsx|md|mdx|graphql|vue)\"",
"validate": "yarn lint && yarn format"
},
"devDependencies": {
"eslint": "^5.13.0",
"eslint-config-prettier": "^4.0.0",
"husky": "^1.3.1",
"lint-staged": "^8.1.3",
"prettier": "^1.16.4"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.js": [
"npm run validate",
"git add"
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment