drone/web/.eslintrc.yml

127 lines
2.7 KiB
YAML

---
parser: '@typescript-eslint/parser'
parserOptions:
ecmaVersion: 2020
sourceType: module
ecmaFeatures:
jsx: true
impliedStrict: true
project: ./tsconfig-eslint.json
plugins:
- react
- '@typescript-eslint/eslint-plugin'
- react-hooks
- jest
- import
env:
browser: true
node: true
shared-node-browser: true
es6: true
jest: true
globals:
__DEV__: readonly
extends:
- eslint:recommended
- plugin:react/recommended
- plugin:@typescript-eslint/recommended
- plugin:import/errors
- plugin:import/typescript
- prettier
settings:
react:
version: detect
import/resolver:
typescript:
alwaysTryTypes: true
rules:
'@typescript-eslint/ban-types':
- error
- extendDefaults: true
types:
'{}': false
# custom rules
no-document-body-snapshot: 2
duplicate-data-tooltip-id: 'warn'
jest-no-mock:
- 2
- module:
react-router-dom: 'react-router-dom should not be mocked. Wrap the component inside TestWrapper instead'
# built-in
no-console: 2
semi: 0
no-await-in-loop: 2
no-shadow: 0
# react hooks
react-hooks/rules-of-hooks: 2
react-hooks/exhaustive-deps: 1
# react
react/prop-types: 0
react/display-name: 1
#typescript
'@typescript-eslint/no-use-before-define': 0
'@typescript-eslint/explicit-function-return-type': 0
no-unused-vars: 0
'@typescript-eslint/no-unused-vars':
- 2
- vars: all
args: after-used
ignoreRestSiblings: true
argsIgnorePattern: ^_
'@typescript-eslint/member-delimiter-style': 0
'@typescript-eslint/no-shadow': 2
'@typescript-eslint/no-extra-semi': 0
'@typescript-eslint/explicit-module-boundary-types': 0
#import
import/order:
- error
- groups:
- builtin
- external
- internal
- - parent
- sibling
pathGroups:
- pattern: '*.scss'
group: index
position: after
patternOptions:
matchBase: true
import/no-useless-path-segments: 2
no-restricted-imports:
- error
- patterns:
- lodash.*
paths:
- lodash
overrides:
- files:
- '**/*.test.ts'
- '**/*.test.tsx'
rules:
'@typescript-eslint/no-magic-numbers': 0
'@typescript-eslint/no-non-null-assertion': 'off'
'@typescript-eslint/no-non-null-asserted-optional-chain': 0
'@typescript-eslint/no-explicit-any': 0
no-await-in-loop: 0
jest/consistent-test-it:
- 2
- fn: test
withinDescribe: test
jest/expect-expect: 2
jest/no-disabled-tests: 2
jest/no-commented-out-tests: 2
- files:
- services.tsx
rules:
'@typescript-eslint/explicit-function-return-type': 0
'@typescript-eslint/no-explicit-any': 0