forked from Hahfyeex/Stellar-PolyMarket
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.eslintrc.js
More file actions
56 lines (54 loc) · 1.48 KB
/
Copy path.eslintrc.js
File metadata and controls
56 lines (54 loc) · 1.48 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
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
env: {
browser: true,
node: true,
es2022: true,
},
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
ecmaFeatures: { jsx: true },
},
plugins: ["@typescript-eslint", "react", "react-hooks"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
],
settings: {
react: { version: "detect" },
},
rules: {
// TypeScript
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
// React
"react/react-in-jsx-scope": "off", // Not needed in Next.js
"react/prop-types": "off", // We use TypeScript for prop types
// General
"no-console": ["warn", { allow: ["error", "warn"] }],
"eqeqeq": ["error", "always"],
"no-var": "error",
"prefer-const": "error",
},
overrides: [
{
// Relax rules for plain JS files (backend/oracle)
files: ["**/*.js"],
rules: {
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-explicit-any": "off",
},
},
{
// Jest globals for test files
files: ["**/*.test.js", "**/*.test.ts", "**/*.test.tsx", "**/*.spec.js"],
env: { jest: true },
},
],
ignorePatterns: ["node_modules/", ".next/", "dist/", "target/"],
};