-
Notifications
You must be signed in to change notification settings - Fork 58
/
.eslintrc.js
99 lines (99 loc) · 2.94 KB
/
.eslintrc.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
/** @type import("eslint").Linter.Config */
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
extends: ["eslint:recommended", "plugin:@typescript-eslint/eslint-recommended"],
parserOptions: {
ecmaVersion: 2019,
sourceType: "module",
},
ignorePatterns: [
"out/",
"*.js",
"tree-sitter-api.d.ts",
],
overrides: [
{
files: ["commands/index.ts"],
rules: {
"max-len": "off",
},
},
{
files: ["test/suite/commands/*.ts"],
rules: {
"no-useless-escape": "off",
},
},
{
files: ["test/suite/commands/*-tabs.test.ts"],
rules: {
"no-tabs": "off",
},
},
],
rules: {
"indent": ["error", 2, {
"CallExpression": { arguments: "first" },
"FunctionDeclaration": { parameters: "first" },
"FunctionExpression": { parameters: "first" },
"VariableDeclarator": "first",
"flatTernaryExpressions": true,
"offsetTernaryExpressions": true,
"ignoredNodes": [
"TemplateLiteral *",
"VariableDeclaration VariableDeclarator:first-child ObjectExpression",
],
}],
"curly": ["error", "all"],
"dot-location": ["error", "property"],
"eqeqeq": ["error", "always", { null: "ignore" }],
"require-await": "error",
"array-bracket-spacing": ["error", "never"],
"block-scoped-var": "error",
"block-spacing": ["error", "always"],
"brace-style": ["error", "1tbs", { allowSingleLine: false }],
"comma-dangle": ["error", "always-multiline"],
"linebreak-style": ["error", "unix"],
"max-len": [
"warn",
{
code: 100,
comments: 80,
ignorePattern: "^ *(\\*|//) ([sS]ee )?http\\S+\\)?.?$|^ *// =+( [^=]+ =+)?$|\|$",
},
],
"multiline-ternary": ["error", "always-multiline"],
"no-tabs": "error",
"no-trailing-spaces": "error",
"no-unexpected-multiline": "error",
"no-unneeded-ternary": "error",
"object-curly-spacing": ["error", "always"],
"operator-linebreak": ["error", "before", { overrides: { "=": "after" } }],
"object-shorthand": "error",
"quotes": ["error", "double", { avoidEscape: true, allowTemplateLiterals: true }],
"semi": ["error", "always"],
"sort-imports": [
"error",
{
ignoreCase: true,
ignoreDeclarationSort: true,
memberSyntaxSortOrder: ["none", "all", "single", "multiple"],
},
],
"space-before-function-paren": "off",
"space-before-blocks": "error",
"space-infix-ops": "error",
"unicode-bom": "error",
"keyword-spacing": ["error", { before: true, after: true }],
"no-unused-vars": "off",
"no-case-declarations": "off",
"no-cond-assign": "off",
"@typescript-eslint/explicit-member-accessibility": ["error"],
"@typescript-eslint/space-before-function-paren": [
"error",
{ anonymous: "always", named: "never", asyncArrow: "always" },
],
},
};