Files
shields/.eslintrc.yml
Paul Melnikow 8dc8afeb55 Avoid func declarations using function keyword (#2813)
We had only a few function expressions declared with the function keyword; almost everything is using function declarations.

This came up after this discussion: https://github.com/badges/shields/pull/2803#discussion_r249011621 though is actually not related ot that example.

What’s being removed is a third option, which is assigning to a variable a function expression using the `function` keyword. There’s still room for the programmer to choose between arrow function expressions and function declarations.
2019-01-21 15:33:43 -05:00

51 lines
1.3 KiB
YAML

extends:
- standard
- prettier
env:
node: true
mocha: true
parserOptions:
# Override eslint-config-standard, which incorrectly sets this to "module",
# though that setting is only for ES6 modules, not CommonJS modules.
sourceType: 'script'
plugins:
- mocha
- no-extension-in-require
- 'chai-friendly'
rules:
# Disable some rules from eslint:recommended.
no-console: 'off'
no-empty: ['error', { 'allowEmptyCatch': true }]
# Allow unused parameters. In callbacks, removing them seems to obscure
# what the functions are doing.
no-unused-vars: ['error', { 'args': 'none' }]
# These should be disabled by eslint-config-prettier, but are not.
spaced-comment: 'off'
standard/object-curly-even-spacing: 'off'
one-var: 'off'
# Shields additions.
no-var: 'error'
prefer-const: 'error'
strict: 'error'
arrow-body-style: ['error', 'as-needed']
no-extension-in-require/main: 'error'
object-shorthand: ['error', 'properties']
prefer-template: 'error'
promise/prefer-await-to-then: 'error'
func-style: ['error', 'declaration', { 'allowArrowFunctions': true }]
# Mocha-related.
mocha/no-exclusive-tests: 'error'
mocha/no-mocha-arrows: 'error'
mocha/prefer-arrow-callback: 'error'
# Chai friendly.
no-unused-expressions: 'off'
chai-friendly/no-unused-expressions: 'error'