mirror of
https://github.com/badges/shields.git
synced 2025-04-18 19:44:04 +03:00
* delete loads of really important stuff that we definitely need * v basic MVP smoosh docusaurus PoC into repo * TODO * delete more really important stuff * TODO * tidyup: use run-s * don't redirect images used in frontend to raster proxy * fix routing * preserve the /endpoint link * delete the blog (for now) I would quite like to re-add this at some point but its not really the top priority thing right now * content edits * appease the lint gods * update danger rules * remove placeholder * cypress tests * dockerhub --> ghcr * Revert "dockerhub --> ghcr" This reverts commit ef74cbb26b1c24ce987a8975e60313682f9161f8. * downgrade lockfile format * implement defs/BASE_URL * fix e2e build * actually fix cypress tests * always run cypress tests on build * this never worked * add command for docusaurus:clear * delete more code we don't need any more * update ESLint/prettier config * delete unsused exports * documentation updates * delete a fairly large chunk of our dependency tree * allow base_url as build arg to Dockerfile * fixup dockerfile * work out base url at runtime if not set doing this at image build time is not the right approach * remove gatsby monorepo from closebot * rename HomepageFeatures to homepage-features
190 lines
4.6 KiB
YAML
190 lines
4.6 KiB
YAML
extends:
|
|
- standard
|
|
- standard-jsx
|
|
- standard-react
|
|
- prettier
|
|
- eslint:recommended
|
|
|
|
globals:
|
|
JSX: 'readonly'
|
|
|
|
parserOptions:
|
|
# Override eslint-config-standard, which incorrectly sets this to "module",
|
|
# though that setting is only for ES6 modules, not CommonJS modules.
|
|
sourceType: 'script'
|
|
|
|
settings:
|
|
react:
|
|
version: '16.8'
|
|
jsdoc:
|
|
mode: typescript
|
|
|
|
plugins:
|
|
- chai-friendly
|
|
- jsdoc
|
|
- mocha
|
|
- icedfrisby
|
|
- no-extension-in-require
|
|
- sort-class-members
|
|
- import
|
|
- react-hooks
|
|
- promise
|
|
|
|
overrides:
|
|
# For simplicity's sake, when possible prefer to add rules to the top-level
|
|
# list of rules, even if they only apply to certain files. That way the
|
|
# rules listed here are only ones which conflict.
|
|
|
|
- files:
|
|
- 'badge-maker/**/*.js'
|
|
- '**/*.cjs'
|
|
env:
|
|
node: true
|
|
es6: true
|
|
|
|
- files:
|
|
- '**/*.js'
|
|
- '!frontend/**/*.js'
|
|
- '!badge-maker/**/*.js'
|
|
env:
|
|
node: true
|
|
es6: true
|
|
parserOptions:
|
|
sourceType: 'module'
|
|
parser: '@typescript-eslint/parser'
|
|
rules:
|
|
no-console: 'off'
|
|
|
|
- files:
|
|
- '**/*.ts'
|
|
parserOptions:
|
|
sourceType: 'module'
|
|
parser: '@typescript-eslint/parser'
|
|
|
|
- files:
|
|
- 'frontend/**/*.js'
|
|
parserOptions:
|
|
sourceType: 'module'
|
|
env:
|
|
browser: true
|
|
rules:
|
|
import/extensions:
|
|
['error', 'never', { 'json': 'always', 'yml': 'always' }]
|
|
|
|
- files:
|
|
- 'core/base-service/**/*.js'
|
|
- 'services/**/*.js'
|
|
rules:
|
|
sort-class-members/sort-class-members:
|
|
[
|
|
'error',
|
|
{
|
|
order:
|
|
[
|
|
'name',
|
|
'category',
|
|
'isDeprecated',
|
|
'route',
|
|
'auth',
|
|
'examples',
|
|
'_cacheLength',
|
|
'defaultBadgeData',
|
|
'render',
|
|
'constructor',
|
|
'fetch',
|
|
'transform',
|
|
'handle',
|
|
],
|
|
},
|
|
]
|
|
|
|
- files:
|
|
- '**/*.spec.@(js|ts|tsx)'
|
|
- '**/*.integration.js'
|
|
- '**/test-helpers.js'
|
|
- 'core/service-test-runner/**/*.js'
|
|
env:
|
|
mocha: true
|
|
rules:
|
|
mocha/no-exclusive-tests: 'error'
|
|
mocha/no-skipped-tests: 'error'
|
|
mocha/no-mocha-arrows: 'error'
|
|
mocha/prefer-arrow-callback: 'error'
|
|
|
|
- files:
|
|
- 'services/**/*.tester.js'
|
|
rules:
|
|
icedfrisby/no-exclusive-tests: 'error'
|
|
icedfrisby/no-skipped-tests: 'error'
|
|
|
|
rules:
|
|
# Disable some rules from eslint:recommended.
|
|
no-empty: ['error', { 'allowEmptyCatch': true }]
|
|
|
|
no-use-before-define: 'off'
|
|
|
|
# These should be disabled by eslint-config-prettier, but are not.
|
|
no-extra-semi: 'off'
|
|
|
|
# Shields additions.
|
|
no-var: 'error'
|
|
prefer-const: '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' }]
|
|
quotes:
|
|
['error', 'single', { 'avoidEscape': true, 'allowTemplateLiterals': false }]
|
|
|
|
# Account for destructuring responses from upstream services,
|
|
# many of which do not follow camelcase
|
|
# Based on original rule configuration from eslint-config-standard
|
|
camelcase:
|
|
[
|
|
'error',
|
|
{
|
|
ignoreDestructuring: true,
|
|
properties: 'never',
|
|
ignoreGlobals: true,
|
|
allow: ['^UNSAFE_'],
|
|
},
|
|
]
|
|
|
|
# Chai friendly.
|
|
no-unused-expressions: 'off'
|
|
chai-friendly/no-unused-expressions: 'error'
|
|
|
|
# jsdoc plugin:
|
|
# don't require every class/function to have a docblock
|
|
jsdoc/require-jsdoc: 'off'
|
|
|
|
# allow Joi as an undefined type
|
|
jsdoc/no-undefined-types: ['error', { definedTypes: ['Joi'] }]
|
|
|
|
# all the other recommended rules as errors (not warnings)
|
|
jsdoc/check-alignment: 'error'
|
|
jsdoc/check-param-names: 'error'
|
|
jsdoc/check-tag-names: 'error'
|
|
jsdoc/check-types: 'error'
|
|
jsdoc/implements-on-classes: 'error'
|
|
jsdoc/tag-lines: ['error', 'any', { 'startLines': 1 }]
|
|
jsdoc/require-param: 'error'
|
|
jsdoc/require-param-description: 'error'
|
|
jsdoc/require-param-name: 'error'
|
|
jsdoc/require-param-type: 'error'
|
|
jsdoc/require-returns: 'error'
|
|
jsdoc/require-returns-check: 'error'
|
|
jsdoc/require-returns-description: 'error'
|
|
jsdoc/require-returns-type: 'error'
|
|
jsdoc/valid-types: 'error'
|
|
|
|
react/prop-types: 'off'
|
|
react/jsx-sort-props: 'error'
|
|
react-hooks/rules-of-hooks: 'error'
|
|
react-hooks/exhaustive-deps: 'error'
|
|
jsx-quotes: ['error', 'prefer-double']
|