/
eslint.yml
42 lines (35 loc) · 1.12 KB
/
eslint.yml
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
# SPDX-FileCopyrightText: 2024 Red Bee Media Ltd <https://www.redbeemedia.com/>
#
# SPDX-License-Identifier: MIT
env:
browser: true
es6: true
jest/globals: true
extends:
- eslint-config-prettier
- eslint:recommended
- plugin:@typescript-eslint/recommended
- eslint-config-preact
plugins:
- prettier
- jest
- "@typescript-eslint"
globals:
Promise: true
rules:
prettier/prettier:
- error
arrow-body-style: off
no-console: off
no-redeclare: off # TS performs the same checks, but intentionally allows naming the type the same as a var
no-restricted-syntax:
- error
- selector: TSEnumDeclaration
message: TypeScript enums have several pitfalls. Please use union type or JS objects declared with `as const` instead. See https://youtu.be/jjMbPt_H3RQ for a good explanation.
no-undef: off # TypeScript already handles this better because it understands type definitions.
"@typescript-eslint/no-unused-vars": "error"
"@typescript-eslint/explicit-module-boundary-types": off
"@typescript-eslint/ban-ts-comment": "warn"
parser: "@typescript-eslint/parser"
parserOptions:
sourceType: module