Skip to content

Instantly share code, notes, and snippets.

@sreevardhanreddi
Created February 10, 2023 06:42
Show Gist options
  • Save sreevardhanreddi/b6cd3c8c24cad34068fb8340e9ca20af to your computer and use it in GitHub Desktop.
Save sreevardhanreddi/b6cd3c8c24cad34068fb8340e9ca20af to your computer and use it in GitHub Desktop.
common js configs for nodejs

.prettierrc

{
  "useTabs": false,
  "tabWidth": 2,
  "endOfLine": "lf",
  "singleQuote": false,
  "printWidth": 80,
  "semi": true
}

.eslintrc.json

{
  "env": {
    "node": true,
    "browser": true,
    "commonjs": true,
    "es2021": true,
    "jest": true
  },
  "extends": ["eslint:recommended", "prettier"],
  "overrides": [],
  "parserOptions": {
    "ecmaVersion": "latest"
  },
  "rules": {
    "indent": ["error", 2],
    "linebreak-style": ["error", "unix"],
    "quotes": ["error", "double"],
    "semi": ["error", "always"]
  },
  "plugins": ["jest"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment