Files
shields/.eslintrc.yml
Paul Melnikow 4bd16f93e8 Sort imports and requires (#3056)
This will definitely save time, and ensure more uniformity.

It moves the `createServiceTester()` calls to a different place from where I'd like them, though I'm happy to have them checked by the linter.

Closes #2701
2019-02-21 22:14:40 -05:00

59 lines
1.5 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'
overrides:
files:
- gatsby-browser.js
parserOptions:
sourceType: 'module'
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 }]
new-cap: ['error', { 'capIsNew': true }]
import/order: ['error', { 'newlines-between': 'never' }]
# 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'