-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
86 lines (85 loc) · 2.73 KB
/
Copy patheslint.config.js
File metadata and controls
86 lines (85 loc) · 2.73 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
// ESLint v9 flat config for DataLab-Web.
//
// Mirrors the conventions used in the rest of the workspace: a permissive
// baseline that catches real bugs (no-undef, no-unused-vars) without
// fighting the Pyodide bridge or the Plotly typings.
import js from "@eslint/js";
import tseslint from "typescript-eslint";
import reactHooks from "eslint-plugin-react-hooks";
import globals from "globals";
export default [
{
ignores: [
"dist/**",
"build/**",
"release/**",
"packages/*/dist/**",
"node_modules/**",
"coverage-ts/**",
"htmlcov-python/**",
"playwright-report/**",
"test-results/**",
".venv/**",
"**/*.d.ts",
"vite.config.js",
"vite.config.d.ts",
// Compiled outputs of Vite plugins; the .ts sources are linted.
"build-plugins/*.js",
// Documentation snippets — not part of the build, ship without
// their Angular dependencies, see ``doc/examples/angular/README.md``.
"doc/examples/**",
],
},
js.configs.recommended,
...tseslint.configs.recommended,
{
files: ["**/*.{ts,tsx}"],
plugins: { "react-hooks": reactHooks },
languageOptions: {
ecmaVersion: 2022,
sourceType: "module",
globals: { ...globals.browser, ...globals.node },
},
linterOptions: {
// Existing source has a couple of legacy ``eslint-disable`` comments
// that no longer match an active rule; treat them as warnings rather
// than failing the lint task.
reportUnusedDisableDirectives: "warn",
},
rules: {
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
// The Pyodide bridge legitimately surfaces ``any`` values; keep it as
// a warning so it shows up in the editor without failing CI.
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unused-vars": [
"warn",
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
],
"@typescript-eslint/no-empty-object-type": "warn",
// Demote the picky stylistic rules that only flag pre-existing code.
"no-useless-assignment": "warn",
"no-constant-binary-expression": "warn",
"prefer-const": "warn",
"no-empty": ["error", { allowEmptyCatch: true }],
},
},
{
files: ["tests/**/*.{ts,tsx}"],
languageOptions: {
globals: { ...globals.browser, ...globals.node },
},
rules: {
"@typescript-eslint/no-explicit-any": "off",
},
},
{
// Node-side build/release scripts — pure Node ESM, no TS, no DOM.
files: ["scripts/**/*.{mjs,cjs,js}", "tests/benchmark/**/*.{mjs,cjs,js}"],
languageOptions: {
ecmaVersion: 2022,
sourceType: "module",
globals: { ...globals.node },
},
},
];