forked from resolve-accept-language/resolve-accept-language
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.yaml
92 lines (92 loc) · 3.03 KB
/
.eslintrc.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
---
root: true # Disables inheritance from parent config.
env:
browser: true
node: true
es6: true
plugins:
- prefer-arrow-functions
extends:
- eslint:recommended
- plugin:import/recommended
- plugin:import/typescript
- plugin:unicorn/recommended
- plugin:prettier/recommended
settings:
import/resolver:
node:
extensions:
- '.js'
- '.jsx'
- '.ts'
- '.tsx'
# Uses `eslint-import-resolver-typescript` to support the `exports` syntax in `package.json`
# @see https://github.com/import-js/eslint-import-resolver-typescript
typescript:
alwaysTryTypes: true
rules:
# Increase the level to 'error' for unused variables (the default is set to 'warning')
# @see https://eslint.org/docs/latest/rules/no-unused-vars
no-unused-vars:
- error
- args: all
# The Unicorn plugin comes with opinionated checks, including some that we prefer disabling.
'unicorn/no-array-for-each':
# Performance is no longer an issue - we prefer `forEach` for readability.
- off
'unicorn/numeric-separators-style':
# Doesn't add a lot of value and makes numbers look odd.
- off
'unicorn/prefer-type-error':
# Not really applicable when using TypeScript (mostly triggers false positives).
- off
'prefer-arrow-functions/prefer-arrow-functions':
# There is no recommended configuration to extend so we have to set it here to enforce arrow functions.
# @see https://github.com/JamieMason/eslint-plugin-prefer-arrow-functions
- warn
- classPropertiesAllowed: false
disallowPrototype: false
returnStyle: unchanged
singleReturnOnly: false
overrides:
# TypeScript configurations
- files:
- '*.ts'
- '*.mts'
- '*.cts'
- '*.tsx'
parser: '@typescript-eslint/parser'
parserOptions:
project:
- 'tsconfig.json'
- 'tests/jest.json'
extends:
- plugin:@typescript-eslint/recommended
- plugin:@typescript-eslint/recommended-requiring-type-checking
rules:
# Increase the level to 'error' for unused variables (the default is set to 'warning')
# @see https://typescript-eslint.io/rules/no-unused-vars/
no-unused-vars: off
'@typescript-eslint/no-unused-vars':
- error
# Show errors when missing return types are missing on relevant functions
# @see https://typescript-eslint.io/rules/explicit-function-return-type/
'@typescript-eslint/explicit-function-return-type':
- error
- allowExpressions: true
allowConciseArrowFunctionExpressionsStartingWithVoid: true
# Checks members (classes, interfaces, types) and applies consistent ordering.
# @see https://typescript-eslint.io/rules/member-ordering/
'@typescript-eslint/member-ordering':
- error
- default:
# Only use basic types to avoid intrusive rules.
memberTypes:
- field
- constructor
- method
# Jest configurations
- files:
- tests/**
extends:
- plugin:jest/recommended