Skip to content

Instantly share code, notes, and snippets.

@wmakeev
Last active August 28, 2023 15:23
Show Gist options
  • Save wmakeev/b25404c1b4fb2a2158c0cc9b02730591 to your computer and use it in GitHub Desktop.
Save wmakeev/b25404c1b4fb2a2158c0cc9b02730591 to your computer and use it in GitHub Desktop.
[02 - ESLint (JavaScript)] #template #eslint

ESLint JavaScript template

npm i -D eslint eslint-config-prettier eslint-plugin-node eslint-plugin-import eslint-plugin-unicorn
{
"extends": [
"eslint:recommended",
"plugin:node/recommended",
"plugin:unicorn/recommended",
"plugin:import/recommended",
"prettier"
],
"plugins": ["node", "prettier", "unicorn", "import"],
"rules": {
"array-callback-return": "error",
"prettier/prettier": "error",
"block-scoped-var": "error",
"eqeqeq": [2, "allow-null"],
"no-var": "error",
"prefer-const": "error",
"eol-last": "error",
"prefer-arrow-callback": "error",
"no-constant-condition": [
"error",
{
"checkLoops": false
}
],
"no-trailing-spaces": "error",
"quotes": [
"warn",
"single",
{
"avoidEscape": true
}
],
"no-restricted-properties": [
"error",
{
"object": "describe",
"property": "only"
},
{
"object": "it",
"property": "only"
}
],
"node/no-unpublished-import": "off"
}
}
// See https://github.com/import-js/eslint-plugin-import/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment