Skip to content

Commit dfdcb4a

Browse files
committed
Update ESLint to latest version, fix eslint errors
1 parent d5dd74e commit dfdcb4a

10 files changed

Lines changed: 436 additions & 28 deletions

File tree

eslint.config.mjs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import eslint from '@eslint/js';
2+
import { defineConfig } from 'eslint/config';
3+
import tseslint from 'typescript-eslint';
4+
import reactPlugin from 'eslint-plugin-react';
5+
6+
export default defineConfig(
7+
eslint.configs.recommended,
8+
tseslint.configs.strict,
9+
tseslint.configs.stylistic,
10+
reactPlugin.configs.flat.recommended,
11+
reactPlugin.configs.flat['jsx-runtime'],
12+
{
13+
settings: {
14+
react: {
15+
version: 'detect',
16+
},
17+
}
18+
},
19+
{
20+
ignores: [
21+
'node_modules',
22+
'build',
23+
'.react-router',
24+
'public/gtag.js',
25+
'**/__generated__',
26+
],
27+
},
28+
{
29+
rules: {
30+
'@typescript-eslint/no-explicit-any': 'warn',
31+
'@typescript-eslint/consistent-indexed-object-style': 'warn',
32+
},
33+
}
34+
);

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"test": "react-scripts test",
2121
"eject": "react-scripts eject",
2222
"relay": "relay-compiler $@",
23-
"lint": "eslint . --ext .ts,.tsx"
23+
"lint": "eslint ."
2424
},
2525
"eslintConfig": {
2626
"extends": "react-app"
@@ -39,17 +39,18 @@
3939
},
4040
"devDependencies": {
4141
"@babel/core": "^7.4.5",
42+
"@eslint/js": "^9.39.2",
4243
"@types/node": "^24.10.1",
4344
"@types/react": "^19.0.0",
4445
"@types/react-dom": "^19.0.0",
4546
"@types/react-relay": "^18.2.1",
46-
"@typescript-eslint/eslint-plugin": "^5.33.0",
47-
"@typescript-eslint/parser": "^5.33.0",
48-
"eslint": "^8.21.0",
47+
"eslint": "^9.39.2",
48+
"eslint-plugin-react": "^7.37.5",
4949
"graphql": "^16.10.0",
5050
"relay-compiler": "^20.1.1",
5151
"relay-compiler-language-typescript": "^15.0.0",
52-
"typescript": "^5.7.3"
52+
"typescript": "^5.7.3",
53+
"typescript-eslint": "^8.54.0"
5354
},
5455
"relay": {
5556
"src": "./src/",

src/components/Footer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const Footer = () => (
88
<Container fluid={true}>
99
<Row>
1010
<Col>
11-
Created with <i className="fas fa-heart" style={{ color: 'red' }}></i> by <a href="https://juffalow.com" style={{ color: '#fff', textDecoration: 'none' }}>Matej <span style={{ color: 'red' }}>'juffalow'</span> Jellus</a> | 2019 - 2025
11+
Created with <i className="fas fa-heart" style={{ color: 'red' }}></i> by <a href="https://juffalow.com" style={{ color: '#fff', textDecoration: 'none' }}>Matej <span style={{ color: 'red' }}>&apos;juffalow&apos;</span> Jellus</a> | 2019 - 2025
1212
</Col>
1313
</Row>
1414
</Container>

src/pages/authors/AuthorsTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import AuthorRow from './AuthorRow';
55
import { Author } from '../../types/Author';
66

77
interface Props {
8-
authors: Array<Author>;
8+
authors: Author[];
99
}
1010

1111
const AuthorsTable = (props: Props) => {

src/pages/home/QuotesList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import QuoteCard from './QuoteCard';
66
import { Quote } from '../../types/Quote';
77

88
interface Props {
9-
quotes: Array<Quote>;
9+
quotes: Quote[];
1010
}
1111

1212
const QuotesList = (props: Props) => {

src/pages/home/QuotesLoader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ interface Props {
1010
const QuotesLoader = ({ count = 9 }: Props) => (
1111
<Row className="mt-4">
1212
{
13-
Array.apply(null, Array(count)).map((_, index) => (
13+
[...Array(count)].map((_, index) => (
1414
<Col key={index} md={4} style={{ marginBottom: 20 }}>
1515
<Card className="bar-loader" style={{ minHeight: 125 }} />
1616
</Col>

src/serviceWorker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const isLocalhost = Boolean(
2020
)
2121
);
2222

23-
type Config = {
23+
interface Config {
2424
onSuccess?: (registration: ServiceWorkerRegistration) => void;
2525
onUpdate?: (registration: ServiceWorkerRegistration) => void;
2626
};

src/types/Author.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export type Author = {
1+
export interface Author {
22
id: number;
33
_id: string;
44
firstName: string;

src/types/Quote.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export type Quote = {
1+
export interface Quote {
22
id: number;
33
_id: string;
44
text: string;

0 commit comments

Comments
 (0)