-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.js
More file actions
44 lines (43 loc) · 1.45 KB
/
eslint.config.js
File metadata and controls
44 lines (43 loc) · 1.45 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
import js from "@eslint/js";
import globals from "globals";
import pluginReact from "eslint-plugin-react";
import { defineConfig } from "eslint/config";
export default defineConfig([
{ files: ["**/*.{js,mjs,cjs,jsx}"], plugins: { js }, extends: ["js/recommended"] },
{ files: ["api/**/*.{js,mjs,cjs,jsx}"], languageOptions: { globals: globals.node } },
{
files: ["src/**/*.{js,mjs,cjs,jsx}"],
languageOptions: { globals: globals.browser },
rules: {
// Prevent circular dependencies by restricting certain import patterns
"no-restricted-imports": [
"error",
{
patterns: [
{
group: ["../../../*", "../../../../*", "../../../../../*"],
message: "Avoid deep relative imports. Use absolute imports or refactor the module structure."
}
],
paths: [
// Prevent physics modules from importing from higher-level modules
{
name: "../../components/**",
message: "Physics modules should not import from components. Extract shared logic to utils or services."
},
{
name: "../../managers/**",
message: "Physics modules should not import from managers. Use dependency injection or events."
}
]
}
]
},
settings: {
react: {
version: "detect"
}
}
},
pluginReact.configs.flat.recommended,
]);