Skip to content

Commit ba34c8e

Browse files
committed
fix(plugins/eslint-plugin): Unexpected top-level property 'name' in legacy configs, closes #863
1 parent d41ead8 commit ba34c8e

File tree

15 files changed

+359
-4
lines changed

15 files changed

+359
-4
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
},
5+
parser: "@typescript-eslint/parser",
6+
plugins: ["@eslint-react/eslint-plugin"],
7+
extends: ["eslint:recommended"],
8+
overrides: [
9+
{
10+
files: ["src/**/*.{ts, tsx}"],
11+
extends: [
12+
"plugin:@eslint-react/recommended-legacy",
13+
],
14+
},
15+
],
16+
};
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: 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.js"></script>
13+
</body>
14+
15+
</html>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "vite-react-dom-legacy",
3+
"version": "0.0.0",
4+
"private": true,
5+
"type": "module",
6+
"scripts": {
7+
"build": "tsc && vite build",
8+
"dev": "vite",
9+
"lint": "ESLINT_USE_FLAT_CONFIG=false eslint .",
10+
"preview": "vite preview"
11+
},
12+
"dependencies": {
13+
"react": "^18.3.1",
14+
"react-dom": "^18.3.1"
15+
},
16+
"devDependencies": {
17+
"@babel/core": "^7.26.0",
18+
"@babel/eslint-parser": "^7.25.9",
19+
"@babel/preset-env": "^7.26.0",
20+
"@babel/preset-react": "^7.25.9",
21+
"@eslint-react/eslint-plugin": "workspace:*",
22+
"@eslint/config-inspector": "^0.5.6",
23+
"@eslint/js": "^9.15.0",
24+
"@types/react": "^18.3.12",
25+
"@types/react-dom": "^18.3.1",
26+
"@vitejs/plugin-react": "^4.3.3",
27+
"eslint": "^9.15.0",
28+
"eslint-plugin-react-hooks": "rc",
29+
"eslint-plugin-react-refresh": "^0.4.14",
30+
"globals": "^15.12.0",
31+
"vite": "^5.4.11"
32+
}
33+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#root {
2+
max-width: 1280px;
3+
margin: 0 auto;
4+
padding: 2rem;
5+
text-align: center;
6+
}
7+
8+
.logo {
9+
height: 8em;
10+
padding: 1.5em;
11+
will-change: filter;
12+
transition: filter 300ms;
13+
}
14+
15+
.logo:hover {
16+
filter: drop-shadow(0 0 2em #646cffaa);
17+
}
18+
19+
.logo.react:hover {
20+
filter: drop-shadow(0 0 2em #61dafbaa);
21+
}
22+
23+
@keyframes logo-spin {
24+
from {
25+
transform: rotate(0deg);
26+
}
27+
28+
to {
29+
transform: rotate(360deg);
30+
}
31+
}
32+
33+
@media (prefers-reduced-motion: no-preference) {
34+
a>.logo {
35+
animation: logo-spin infinite 20s linear;
36+
}
37+
}
38+
39+
.card {
40+
padding: 2em;
41+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import "./App.css";
2+
3+
import { useState } from "react";
4+
5+
import logo from "./assets/eslint-react.svg";
6+
7+
function App() {
8+
const [count, setCount] = useState(0n);
9+
10+
return (
11+
<div>
12+
<div>
13+
<a href="https://eslint-react.xyz" target="_blank" rel="noopener noreferrer">
14+
<img alt="logo" className="logo" src={logo} />
15+
</a>
16+
</div>
17+
<div className="card">
18+
<button type="button" onClick={() => setCount((count) => count + 1n)}>
19+
count is {count.toString()}
20+
</button>
21+
</div>
22+
</div>
23+
);
24+
}
25+
26+
export default App;
Lines changed: 13 additions & 0 deletions
Loading
Lines changed: 6 additions & 0 deletions
Loading
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
:root {
2+
font-family: ui-sans-serif,
3+
system-ui,
4+
-apple-system,
5+
BlinkMacSystemFont,
6+
'Segoe UI',
7+
Roboto,
8+
'Helvetica Neue',
9+
Arial,
10+
'Noto Sans',
11+
sans-serif,
12+
'Apple Color Emoji',
13+
'Segoe UI Emoji',
14+
'Segoe UI Symbol',
15+
'Noto Color Emoji';
16+
17+
line-height: 1.5;
18+
font-weight: 400;
19+
20+
color-scheme: light dark;
21+
color: rgba(255, 255, 255, 0.87);
22+
background-color: #242424;
23+
24+
font-synthesis: none;
25+
text-rendering: optimizeLegibility;
26+
-webkit-font-smoothing: antialiased;
27+
-moz-osx-font-smoothing: grayscale;
28+
-webkit-text-size-adjust: 100%;
29+
}
30+
31+
a {
32+
font-weight: 500;
33+
color: #646cff;
34+
text-decoration: inherit;
35+
}
36+
37+
a:hover {
38+
color: #535bf2;
39+
}
40+
41+
body {
42+
margin: 0;
43+
display: flex;
44+
place-items: center;
45+
min-width: 320px;
46+
min-height: 100vh;
47+
}
48+
49+
h1 {
50+
font-size: 3.2em;
51+
line-height: 1.1;
52+
}
53+
54+
button {
55+
border-radius: 8px;
56+
border: 1px solid transparent;
57+
padding: 0.6em 1.2em;
58+
font-size: 1em;
59+
font-weight: 500;
60+
font-family: inherit;
61+
background-color: #1a1a1a;
62+
cursor: pointer;
63+
transition: border-color 0.25s;
64+
}
65+
66+
button:hover {
67+
border-color: #646cff;
68+
}
69+
70+
button:focus,
71+
button:focus-visible {
72+
outline: 4px auto -webkit-focus-ring-color;
73+
}
74+
75+
@media (prefers-color-scheme: light) {
76+
:root {
77+
color: #213547;
78+
background-color: #ffffff;
79+
}
80+
81+
a:hover {
82+
color: #747bff;
83+
}
84+
85+
button {
86+
background-color: #f9f9f9;
87+
}
88+
}

0 commit comments

Comments
 (0)