-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
60 lines (59 loc) · 1.82 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
import markdown from "eslint-plugin-markdown";
import tsParser from "@typescript-eslint/parser";
import stylistic from "@stylistic/eslint-plugin";
export default [
{
ignores: ["dist/*"],
},
{
plugins: {
markdown,
},
},
{
files: ["*.md", "**/*.md"],
processor: "markdown/markdown", // only lint js/jsx/ts/tsx code within md, not md itself
},
{
files: ["*.ts", "**/*.ts"],
languageOptions: {
parser: tsParser,
parserOptions: {
project: ["./tsconfig.json"],
},
},
},
stylistic.configs["all-flat"],
// https://github.com/eslint-stylistic/eslint-stylistic/blob/main/packages/eslint-plugin/configs/customize.ts
{
rules: {
"@stylistic/indent": ["error", 2],
// punctuation
"@stylistic/quote-props": ["error", "as-needed"],
"@stylistic/quotes": [
"error", "double", { allowTemplateLiterals: true,
avoidEscape: false },
],
"@stylistic/semi": ["error", "always"],
"@stylistic/comma-dangle": ["error", "always-multiline"],
"@stylistic/dot-location": ["error", "property"],
// spacing
"@stylistic/object-curly-spacing": ["error", "always"],
// line breaks
"@stylistic/array-bracket-newline": ["error", "consistent"],
"@stylistic/array-element-newline": ["error", "consistent"],
"@stylistic/object-property-newline": [
"error",
{ allowAllPropertiesOnSameLine: true },
],
"@stylistic/function-call-argument-newline": ["error", "consistent"],
"@stylistic/function-paren-newline": ["error", "multiline-arguments"],
"@stylistic/multiline-ternary": ["error", "always-multiline"],
// line padding
"@stylistic/padding-line-between-statements": [
"error",
{ blankLine: "any", prev: "*", next: "*" },
],
},
},
];