Skip to content

Commit 4cf17f3

Browse files
committed
feat(examples): add new 'vite-react-dom-with-ts-blank-eslint-parser-app' example
1 parent 170bbef commit 4cf17f3

File tree

24 files changed

+879
-280
lines changed

24 files changed

+879
-280
lines changed

examples/dual-react-dom-lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
},
3131
"devDependencies": {
3232
"@eslint-react/eslint-plugin": "^1.24.1",
33-
"@eslint/js": "^9.18.0",
33+
"@eslint/js": "^9.19.0",
3434
"@tsconfig/node22": "^22.0.0",
3535
"@tsconfig/strictest": "^2.0.5",
3636
"@types/node": "^22.10.10",

examples/next-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"devDependencies": {
1919
"@eslint-react/eslint-plugin": "^1.24.1",
2020
"@eslint/config-inspector": "^1.0.0",
21-
"@eslint/js": "^9.18.0",
21+
"@eslint/js": "^9.19.0",
2222
"@next/eslint-plugin-next": "^15.1.6",
2323
"@types/negotiator": "^0.6.3",
2424
"@types/node": "^22.10.10",

examples/vite-react-dom-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"devDependencies": {
1818
"@eslint-react/eslint-plugin": "^1.24.1",
1919
"@eslint/config-inspector": "^1.0.0",
20-
"@eslint/js": "^9.18.0",
20+
"@eslint/js": "^9.19.0",
2121
"@tsconfig/node22": "^22.0.0",
2222
"@tsconfig/strictest": "^2.0.5",
2323
"@types/react": "^19.0.8",

examples/vite-react-dom-js-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"devDependencies": {
1818
"@eslint-react/eslint-plugin": "^1.24.1",
1919
"@eslint/config-inspector": "^1.0.0",
20-
"@eslint/js": "^9.18.0",
20+
"@eslint/js": "^9.19.0",
2121
"@types/react": "^19.0.8",
2222
"@types/react-dom": "^19.0.3",
2323
"@vitejs/plugin-react": "^4.3.4",

examples/vite-react-dom-js-with-babel-app/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
"react-dom": "^19.0.0"
1616
},
1717
"devDependencies": {
18-
"@babel/core": "^7.26.0",
18+
"@babel/core": "^7.26.7",
1919
"@babel/eslint-parser": "^7.26.5",
20-
"@babel/preset-env": "^7.26.0",
20+
"@babel/preset-env": "^7.26.7",
2121
"@babel/preset-react": "^7.26.3",
2222
"@eslint-react/eslint-plugin": "^1.24.1",
2323
"@eslint/config-inspector": "^1.0.0",
24-
"@eslint/js": "^9.18.0",
24+
"@eslint/js": "^9.19.0",
2525
"@types/babel__core": "~7.20.5",
2626
"@types/babel__preset-env": "~7.9.7",
2727
"@types/react": "^19.0.8",
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.idea
17+
.DS_Store
18+
*.suo
19+
*.ntvs*
20+
*.njsproj
21+
*.sln
22+
*.sw?
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"recommendations": [
3+
"dbaeumer.vscode-eslint"
4+
]
5+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
declare module "@eslint/js";
2+
declare module "eslint-plugin-react-hooks";
3+
declare module "eslint-plugin-react-refresh";
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
// @ts-check
2+
import eslintJs from "@eslint/js";
3+
import eslintReact from "@eslint-react/eslint-plugin";
4+
import eslintPluginReactHooks from "eslint-plugin-react-hooks";
5+
import eslintPluginReactRefresh from "eslint-plugin-react-refresh";
6+
import globals from "globals";
7+
import * as tsBlankEslintParser from "ts-blank-eslint-parser";
8+
9+
import TSCONFIG from "./tsconfig.json" with { type: "json" };
10+
import TSCONFIG_NODE from "./tsconfig.node.json" with { type: "json" };
11+
12+
const GLOB_TS = ["**/*.ts", "**/*.tsx"];
13+
14+
export default [
15+
// base configuration for browser environment source files
16+
{
17+
files: TSCONFIG.include,
18+
languageOptions: {
19+
globals: {
20+
...globals.browser,
21+
},
22+
parser: tsBlankEslintParser,
23+
parserOptions: {
24+
jsxPragma: "React",
25+
sourceType: "module",
26+
},
27+
},
28+
rules: {
29+
...eslintJs.configs.recommended.rules,
30+
},
31+
},
32+
// base configuration for node environment source files (*.config.js, etc.)
33+
{
34+
files: TSCONFIG_NODE.include,
35+
ignores: TSCONFIG_NODE.exclude,
36+
languageOptions: {
37+
globals: {
38+
...globals.node,
39+
},
40+
parser: tsBlankEslintParser,
41+
parserOptions: {
42+
requireConfigFile: false,
43+
babelOptions: {
44+
babelrc: false,
45+
configFile: false,
46+
presets: ["@babel/preset-env"],
47+
},
48+
},
49+
},
50+
rules: {
51+
...eslintJs.configs.recommended.rules,
52+
"no-console": "off",
53+
},
54+
},
55+
// React configuration
56+
{
57+
files: TSCONFIG.include,
58+
...eslintReact.configs.recommended,
59+
},
60+
// React Hooks configuration
61+
{
62+
files: TSCONFIG.include,
63+
plugins: {
64+
"react-hooks": eslintPluginReactHooks,
65+
},
66+
rules: eslintPluginReactHooks.configs.recommended.rules,
67+
},
68+
// React Refresh configuration
69+
{
70+
files: TSCONFIG.include,
71+
plugins: {
72+
"react-refresh": eslintPluginReactRefresh,
73+
},
74+
rules: {
75+
"react-refresh/only-export-components": "warn",
76+
},
77+
},
78+
];
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!doctype html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>eslint-react-example</title>
8+
</head>
9+
10+
<body>
11+
<div id="root"></div>
12+
<script type="module" src="/src/main.ts"></script>
13+
</body>
14+
15+
</html>

0 commit comments

Comments
 (0)