Skip to content

Instantly share code, notes, and snippets.

@kuronekomichael
Created August 13, 2018 06:33
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 kuronekomichael/b7dcfe3614d3ec69648e33a8de0775a7 to your computer and use it in GitHub Desktop.
Save kuronekomichael/b7dcfe3614d3ec69648e33a8de0775a7 to your computer and use it in GitHub Desktop.
Cloud Functions boilerplate with Node6 + Babel + ESLint + Prettier + AVA
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "6.11.5"
}
}
]
]
}
# Required for certain syntax usages
parserOptions:
ecmaVersion: 6
# for babel
parser: "babel-eslint"
plugins:
- promise
extends:
- "eslint:recommended"
- "plugin:prettier/recommended"
rules:
# Removed rule "disallow the use of console" from recommended eslint rules
no-console: off
# Removed rule "disallow multiple spaces in regular expressions" from recommended eslint rules
no-regex-spaces: off
# Removed rule "disallow the use of debugger" from recommended eslint rules
no-debugger: off
# Removed rule "disallow unused variables" from recommended eslint rules
no-unused-vars: off
# Removed rule "disallow mixed spaces and tabs for indentation" from recommended eslint rules
no-mixed-spaces-and-tabs: off
# Removed rule "disallow the use of undeclared variables unless mentioned in /*global */ comments" from recommended eslint rules
no-undef: off
# Warn against template literal placeholder syntax in regular strings
no-template-curly-in-string: warn
# Warn if return statements do not either always or never specify values
consistent-return: warn
# Warn if no return statements in callbacks of array methods
array-callback-return: warn
# Require the use of === and !==
eqeqeq: error
# Disallow the use of alert, confirm, and prompt
no-alert: error
# Disallow the use of arguments.caller or arguments.callee
no-caller: error
# Disallow null comparisons without type-checking operators
no-eq-null: error
# Disallow the use of eval()
no-eval: error
# Warn against extending native types
no-extend-native: warn
# Warn against unnecessary calls to .bind()
no-extra-bind: warn
# Warn against unnecessary labels
no-extra-label: warn
# Disallow leading or trailing decimal points in numeric literals
no-floating-decimal: error
# Warn against shorthand type conversions
no-implicit-coercion: warn
# Warn against function declarations and expressions inside loop statements
no-loop-func: warn
# Disallow new operators with the Function object
no-new-func: error
# Warn against new operators with the String, Number, and Boolean objects
no-new-wrappers: warn
# Disallow throwing literals as exceptions
no-throw-literal: error
# Require using Error objects as Promise rejection reasons
prefer-promise-reject-errors: error
# Enforce “for” loop update clause moving the counter in the right direction
for-direction: error
# Enforce return statements in getters
getter-return: error
# Disallow await inside of loops
no-await-in-loop: off
# Disallow comparing against -0
no-compare-neg-zero: error
# Warn against catch clause parameters from shadowing variables in the outer scope
no-catch-shadow: warn
# Disallow identifiers from shadowing restricted names
no-shadow-restricted-names: error
# Enforce return statements in callbacks of array methods
callback-return: error
# Require error handling in callbacks
handle-callback-err: error
# Warn against string concatenation with __dirname and __filename
no-path-concat: warn
# Prefer using arrow functions for callbacks
prefer-arrow-callback: warn
# Return inside each then() to create readable and reusable Promise chains.
# Forces developers to return console logs and http calls in promises.
promise/always-return: error
# Enforces the use of catch() on un-returned promises
promise/catch-or-return: error
# Warn against nested then() or catch() statements
promise/no-nesting: warn
prettier/prettier:
- error
- trailingComma: es5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment