-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
54 lines (50 loc) · 2.02 KB
/
eslint.config.js
File metadata and controls
54 lines (50 loc) · 2.02 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
import perfectionist from "eslint-plugin-perfectionist";
import tailwind from "eslint-plugin-readable-tailwind";
import stylistic from "@stylistic/eslint-plugin";
import svelte from "eslint-plugin-svelte";
import ts from "typescript-eslint";
import globals from "globals";
import js from "@eslint/js";
/** @type {import('eslint').Linter.Config[]} */
export default [
// Formatting
stylistic.configs["recommended-flat"],
perfectionist.configs["recommended-line-length"],
{ plugins: { "readable-tailwind": tailwind } },
// Linting
js.configs.recommended,
...ts.configs.recommended,
...svelte.configs["flat/recommended"],
{
languageOptions:
{
globals: { ...globals.browser, ...globals.node },
parserOptions: { parser: ts.parser },
},
files: ["**/*.svelte"],
},
{ ignores: ["build/", ".svelte-kit/"] },
{
rules: {
...tailwind.configs.error.rules,
"no-restricted-syntax": ["error",
{
selector: "FunctionExpression[generator=false]:not(:has(ThisExpression)):not(Property[kind='get'] > .value):not(Property[kind='set'] > .value)",
message: "FunctionExpression: Arrow functions preferred",
},
{
selector: "FunctionDeclaration[generator=false]:not(:has(ThisExpression)):not(MethodDefinition[kind='get'] > .value):not(MethodDefinition[kind='set'] > .value)",
message: "FunctionDeclaration: Arrow functions preferred",
},
],
"readable-tailwind/multiline": ["error", { preferSingleLine: true, printWidth: 999 }],
"@typescript-eslint/no-unused-expressions": ["error", { allowTernary: true }],
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
"@stylistic/max-statements-per-line": ["error", { max: 3 }],
"@stylistic/member-delimiter-style": ["error", {}], // {} overrides recommended-flat config with default.
// "@stylistic/max-len": ["error", { code: 170 }],
"@stylistic/quotes": ["error", "double"],
"@stylistic/semi": ["error", "always"],
},
},
];