-
Notifications
You must be signed in to change notification settings - Fork 73
Expand file tree
/
Copy patheslint.config.js
More file actions
78 lines (77 loc) · 2.37 KB
/
eslint.config.js
File metadata and controls
78 lines (77 loc) · 2.37 KB
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
import { defineConfig } from "eslint/config";
import xo from "eslint-config-xo";
import xoTypeScript from "eslint-config-xo-typescript";
import importPlugin from "eslint-plugin-import";
import prettierRecommended from "eslint-plugin-prettier/recommended";
import unicorn from "eslint-plugin-unicorn";
export default defineConfig(
{
ignores: ["package-lock.json"],
},
xo,
{
files: ["**/*.{cts,mts,ts}"],
extends: xoTypeScript,
},
importPlugin.flatConfigs.recommended,
unicorn.configs.recommended,
prettierRecommended,
{
languageOptions: {
ecmaVersion: "latest",
},
settings: {
"import/resolver": "typescript",
},
rules: {
"@stylistic/curly-newline": "off", // https://github.com/prettier/eslint-config-prettier/issues/351
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/no-restricted-types": "off",
"arrow-body-style": "error",
"capitalized-comments": "off",
curly: ["error", "multi-line", "consistent"],
"import/first": "error",
"import/newline-after-import": "error",
"import/no-cycle": "error",
"import/no-useless-path-segments": "error",
"import/order": [
"error",
{ alphabetize: { order: "asc" }, "newlines-between": "always" },
],
"max-nested-callbacks": ["error", 3],
"max-params": ["error", 5],
"no-await-in-loop": "off",
"no-useless-constructor": "error",
"no-var": "error",
"object-shorthand": ["error", "consistent-as-needed"],
"prefer-arrow-callback": "error",
"prefer-destructuring": ["error", { array: true, object: false }],
"prefer-const": "error",
"prefer-template": "error",
"require-unicode-regexp": "off",
strict: "error",
"unicorn/no-null": "off",
"unicorn/no-process-exit": "off",
"unicorn/no-useless-undefined": "off",
"unicorn/numeric-separators-style": "off",
"unicorn/prefer-node-protocol": "off",
"unicorn/prefer-ternary": "off",
"unicorn/prevent-abbreviations": [
"error",
{ replacements: { args: false } },
],
camelcase: ["off", {}],
},
},
{
files: ["**/*.json"],
rules: {
"unicorn/expiring-todo-comments": "off",
strict: "off",
},
},
{
files: ["**/tsconfig.json"],
language: "json/jsonc", // https://github.com/xojs/xo/issues/798
},
);