-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
54 lines (53 loc) · 2.05 KB
/
eslint.config.js
File metadata and controls
54 lines (53 loc) · 2.05 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 reactPlugin from "eslint-plugin-react";
import typescriptPlugin from "@typescript-eslint/eslint-plugin";
import typescriptParser from "@typescript-eslint/parser";
import noRawText from "./eslint-rules/no-raw-text.js";
import componentMaxLines from "./eslint-rules/component-max-lines.js";
export default [
{
files: ["src/**/*.tsx", "src/**/*.ts"],
plugins: {
react: reactPlugin,
"@typescript-eslint": typescriptPlugin,
"tui-internal": {
rules: {
"no-raw-text": noRawText,
"component-max-lines": componentMaxLines,
},
},
},
languageOptions: {
parser: typescriptParser,
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
globals: {
// Add browser/node globals if needed
},
},
rules: {
...reactPlugin.configs.recommended.rules,
...typescriptPlugin.configs.recommended.rules,
"react/react-in-jsx-scope": "off", // Not needed in modern React
"react/prop-types": "off", // Using TypeScript instead
"react/no-unknown-property": "off", // OpenTUI uses custom props like flexDirection, gap, etc.
"react/no-unescaped-entities": "off", // Common in TUI text content
"react/jsx-no-leaked-render": ["error", { "validStrategies": ["ternary", "coerce"] }],
"@typescript-eslint/no-explicit-any": "warn", // Useful but common in this codebase
"@typescript-eslint/no-unused-vars": ["warn", {
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}],
"@typescript-eslint/no-require-imports": "warn",
"tui-internal/no-raw-text": "error",
"tui-internal/component-max-lines": ["error", { "max": 500 }],
},
settings: {
react: {
version: "detect",
},
},
},
];