forked from antmicro/zephelin-trace-viewer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
84 lines (79 loc) · 2.77 KB
/
eslint.config.js
File metadata and controls
84 lines (79 loc) · 2.77 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
79
80
81
82
83
/*
* Copyright (c) 2025 Analog Devices, Inc.
* Copyright (c) 2025 Antmicro <www.antmicro.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
import importPlugin from 'eslint-plugin-import';
import unusedImportsPlugin from "eslint-plugin-unused-imports";
import stylisticPlugin from '@stylistic/eslint-plugin'
import jsonPlugin from "@eslint/json";
import jsoncPlugin from "eslint-plugin-jsonc";
import reactPlugin from "eslint-plugin-react";
import tsParser from "@typescript-eslint/parser";
import tseslint from 'typescript-eslint';
export default tseslint.config(
{
extends: [
tseslint.configs.recommendedTypeChecked,
tseslint.configs.stylisticTypeChecked,
],
files: ['**/*.tsx', '**/*.ts'],
languageOptions: {
parser: tsParser,
parserOptions: {
project: "./tsconfig.json",
},
},
plugins: {
"import": importPlugin,
"unused-imports": unusedImportsPlugin,
"stylistic": stylisticPlugin,
"react": reactPlugin,
},
rules: {
"@typescript-eslint/naming-convention": ["warn", {
selector: "import",
format: ["camelCase", "PascalCase"],
}],
curly: "error",
eqeqeq: "error",
"no-throw-literal": "error",
semi: "error",
"stylistic/indent": ["error", 4, { "outerIIFEBody": 0 }],
"no-trailing-spaces": "error",
"comma-dangle": ["error", "always-multiline"],
"import/order": "error",
"import/no-duplicates": "error",
"unused-imports/no-unused-imports": "error",
'@typescript-eslint/no-unused-vars': 'off',
"unused-imports/no-unused-vars": ["error", {
"vars": "all",
"varsIgnorePattern": "^_",
"args": "after-used",
"argsIgnorePattern": "^_",
}],
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-function': 'off',
'stylistic/multiline-comment-style': ["error", "starred-block"],
'react/jsx-tag-spacing': [2, {
beforeSelfClosing: 'always', beforeClosing: 'never'
}],
}
},
{
files: ["**/*.json"],
plugins: {
"jsonc": jsoncPlugin,
"json": jsonPlugin,
},
language: "json/json",
rules: {
"jsonc/indent": ["error", 4],
"jsonc/comma-dangle": ["error", "never"],
"jsonc/object-curly-spacing": ["error", "never"],
},
},
)