-
-
Notifications
You must be signed in to change notification settings - Fork 51
/
eslint.config.js
106 lines (103 loc) · 2.56 KB
/
eslint.config.js
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import eslint from "@eslint/js";
import importPlugin from "eslint-plugin-import";
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
import simpleImportSort from "eslint-plugin-simple-import-sort";
import eslintPluginUnicorn from "eslint-plugin-unicorn";
import globals from "globals";
// eslint-disable-next-line import/no-unresolved
import tseslint from "typescript-eslint";
export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.strict,
importPlugin.flatConfigs.recommended,
importPlugin.flatConfigs.typescript,
eslintPluginUnicorn.configs["flat/recommended"],
eslintPluginPrettierRecommended,
{
ignores: [
"dist",
"docs",
"coverage",
"playground",
"**/__tests__/",
"**/__mocks__/",
],
},
{
files: ["**/*.{js,ts}"],
plugins: {
"simple-import-sort": simpleImportSort,
},
rules: {
"no-console": "error",
"no-unused-vars": "off",
"import/no-cycle": "error",
"simple-import-sort/imports": "error",
"unicorn/prevent-abbreviations": "off",
"unicorn/no-array-reduce": "off",
},
},
{
files: ["**/*.ts"],
languageOptions: {
parserOptions: {
project: "./tsconfig.json",
},
},
rules: {
"@typescript-eslint/explicit-module-boundary-types": "error",
"@typescript-eslint/explicit-member-accessibility": [
"error",
{ accessibility: "no-public" },
],
"@typescript-eslint/camelcase": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
},
],
"@typescript-eslint/consistent-type-imports": [
"error",
{ prefer: "type-imports", fixStyle: "inline-type-imports" },
],
"no-restricted-imports": [
"error",
{
paths: [
{
name: "ws",
message: "Use `isomophic-ws` instead.",
},
],
},
],
},
},
{
files: ["examples/**"],
languageOptions: {
parserOptions: {
project: "./examples/tsconfig.json",
},
},
rules: {
"no-console": "off",
"import/no-unresolved": "off",
"unicorn/prefer-top-level-await": "off",
"unicorn/no-process-exit": "off",
},
},
{
files: ["tests/**/*.ts", "test-utils/**/*.ts", "**/*.spec.ts"],
languageOptions: {
globals: {
...globals.jest,
},
},
rules: {
"no-constant-condition": "off",
},
},
);