Last active
February 13, 2019 13:57
-
-
Save joshdcuneo/642fa9586c4f54c082b195b4deffc20c to your computer and use it in GitHub Desktop.
Javascript Linting Setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"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 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"printWidth": 120, | |
"semi": true, | |
"bracketSpacing": true | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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