-
Notifications
You must be signed in to change notification settings - Fork 15
/
.eslintrc.cjs
105 lines (103 loc) · 2.47 KB
/
.eslintrc.cjs
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
/** @type {import("eslint").Linter.Config} */
module.exports = {
env: {
es2022: true,
node: true,
},
extends: [
"@remix-run/eslint-config",
"@remix-run/eslint-config/node",
"eslint:recommended",
"plugin:eslint-comments/recommended",
"plugin:regexp/recommended",
"plugin:react/jsx-runtime",
"plugin:react-hooks/recommended",
],
overrides: [
{
extends: ["plugin:markdown/recommended-legacy"],
files: ["**/*.md"],
processor: "markdown/markdown",
},
{
extends: [
"plugin:@typescript-eslint/strict",
"plugin:typescript-sort-keys/recommended",
],
files: ["**/*.ts", "**/*.tsx"],
parser: "@typescript-eslint/parser",
},
{
extends: [
"plugin:@typescript-eslint/strict-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
],
excludedFiles: ["**/*.md/*.ts"],
files: ["**/*.ts", "**/*.tsx"],
parser: "@typescript-eslint/parser",
parserOptions: {
project: true,
},
rules: {
// These off-by-default rules work well for this repo and we like them on.
"deprecation/deprecation": "error",
},
},
{
files: ["*.json", "*.jsonc"],
excludedFiles: ["package.json"],
parser: "jsonc-eslint-parser",
rules: {
"jsonc/sort-keys": "error",
},
extends: ["plugin:jsonc/recommended-with-json"],
},
{
files: ["**/*.{yml,yaml}"],
parser: "yaml-eslint-parser",
extends: ["plugin:yml/standard", "plugin:yml/prettier"],
rules: {
"yml/file-extension": ["error", { extension: "yml" }],
"yml/sort-keys": [
"error",
{
order: { type: "asc" },
pathPattern: "^.*$",
},
],
"yml/sort-sequence-values": [
"error",
{
order: { type: "asc" },
pathPattern: "^.*$",
},
],
},
},
],
parser: "@typescript-eslint/parser",
plugins: [
"@typescript-eslint",
"deprecation",
"regexp",
"react",
"react-hooks",
"simple-import-sort",
"typescript-sort-keys",
],
root: true,
rules: {
// These off-by-default rules work well for this repo and we like them on.
"simple-import-sort/exports": "error",
"simple-import-sort/imports": "error",
"react/jsx-sort-props": "error",
// These on-by-default rules don't work well for this repo and we like them off.
"no-undef": "off",
// Stylistic concerns that don't interfere with Prettier
"padding-line-between-statements": "off",
"@typescript-eslint/padding-line-between-statements": [
"error",
{ blankLine: "always", next: "*", prev: "block-like" },
],
},
};