-
Notifications
You must be signed in to change notification settings - Fork 96
Expand file tree
/
Copy patheslint.config.mjs
More file actions
95 lines (94 loc) · 2.61 KB
/
Copy patheslint.config.mjs
File metadata and controls
95 lines (94 loc) · 2.61 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
84
85
86
87
88
89
90
91
92
93
94
95
import eslint from "@eslint/js";
import tseslint from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";
import prettierPlugin from "eslint-plugin-prettier";
import prettierConfig from "eslint-config-prettier";
import importPlugin from "eslint-plugin-import";
export default [
eslint.configs.recommended,
prettierConfig,
{
files: ["**/*.ts", "**/*.tsx"],
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
project: true,
},
},
plugins: {
"@typescript-eslint": tseslint,
prettier: prettierPlugin,
import: importPlugin,
},
rules: {
...tseslint.configs.recommended.rules,
// Turn off no-undef since TypeScript handles this
"no-undef": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unnecessary-type-constraint": "error",
"prettier/prettier": "error",
"no-redeclare": "off",
// Import sorting rules
"import/order": [
"error",
{
groups: [
"builtin", // Node.js built-in modules
"external", // External packages
"internal", // Internal modules (same project)
"parent", // Parent directory imports
"sibling", // Sibling directory imports
"index", // Current directory index
],
"newlines-between": "always",
alphabetize: {
order: "asc",
caseInsensitive: true,
},
},
],
"import/newline-after-import": "error",
"import/no-duplicates": "error",
"no-empty": "warn",
"no-restricted-imports": [
"error",
{
patterns: [
{
group: ["node:*", "fs", "path", "os", "crypto"],
message:
"Node.js built-ins are not allowed in universal packages. Use @langfuse/otel for Node-specific functionality.",
},
],
},
],
},
},
{
files: ["packages/otel/**/*.ts"],
rules: {
"no-restricted-imports": "off",
},
},
{
files: ["**/__tests__/**/*.ts", "**/*.test.ts"],
rules: {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off",
"no-restricted-imports": "off",
},
},
{
ignores: ["dist/", "node_modules/", "packages/core/src/api/"],
},
];