-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy patheslint.config.mjs
More file actions
44 lines (43 loc) · 1.12 KB
/
eslint.config.mjs
File metadata and controls
44 lines (43 loc) · 1.12 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 reactHooks from "eslint-plugin-react-hooks";
import tseslint from "typescript-eslint";
export default [
{
files: ["**/*.{js,jsx,ts,tsx}"],
ignores: ["src/demos/animate-algebra/peggy/**", "src/math/cobyla.js"],
languageOptions: {
parser: tseslint.parser,
},
plugins: {
"react-hooks": reactHooks,
},
rules: {
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "error",
"object-shorthand": ["error", "always"],
},
},
// Ban className (i.e. Tailwind) in library code — only demo/docs may use it.
{
files: ["src/**/*.{ts,tsx}"],
ignores: [
"src/demo/**",
"src/demos/**",
"src/docs/**",
"src/studio/**",
"src/study/**",
"src/IndexPage.tsx",
"src/main.tsx",
"src/**/*.test.{ts,tsx}",
],
rules: {
"no-restricted-syntax": [
"error",
{
selector: "JSXAttribute[name.name='className']",
message:
"Don't use className in library code (avoids Tailwind dependency for lib consumers). Use inline styles instead.",
},
],
},
},
];