Skip to content

Commit

Permalink
Improve eslint config (#320)
Browse files Browse the repository at this point in the history
* chore: activate typescript rules

* chore: update eslint file format
  • Loading branch information
Jujulego authored Feb 10, 2025
1 parent 45eaacf commit c471d7f
Show file tree
Hide file tree
Showing 6 changed files with 663 additions and 509 deletions.
8 changes: 0 additions & 8 deletions .eslintrc.json

This file was deleted.

1 change: 0 additions & 1 deletion app/(with-map)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import DnsSearchOptions from '@/components/search/DnsSearchOptions';
import IpSearchOptions from '@/components/search/IpSearchOptions';
import SearchBox from '@/components/search/SearchBox';
import { SearchBoxSkeleton } from '@/components/search/SearchBoxSkeleton';
import { mergeSx } from '@/utils/mui';
import Paper from '@mui/material/Paper';
import Toolbar from '@mui/material/Toolbar';
import { domAnimation, LazyMotion } from 'motion/react';
Expand Down
2 changes: 1 addition & 1 deletion components/search/SearchBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function SearchBox({ children, sx }: SearchProviderProps) {
const handleClose = useCallback(() => setIsOpen(false), []);

// Input state
const [searchParam, _] = useSearchParam('search');
const [searchParam,] = useSearchParam('search');
const [inputValue, setInputValue] = useState(searchParam ?? '');
const inputValueRef = useRef(inputValue);
inputValueRef.current = inputValue;
Expand Down
18 changes: 18 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { FlatCompat } from '@eslint/eslintrc';

const compat = new FlatCompat({
baseDirectory: import.meta.dirname,
});

const eslintConfig = [
...compat.config({
extends: ['next/core-web-vitals', 'next/typescript'],
rules: {
'jsx-quotes': ['error', 'prefer-double'],
quotes: ['error', 'single'],
semi: ['error', 'always']
}
}),
];

export default eslintConfig;
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,26 @@
},
"devDependencies": {
"@codecov/nextjs-webpack-plugin": "1.9.0",
"@eslint/eslintrc": "3.2.0",
"@microsoft/eslint-formatter-sarif": "3.1.0",
"@next/bundle-analyzer": "15.1.6",
"@next/eslint-plugin-next": "15.1.6",
"@testing-library/dom": "10.4.0",
"@testing-library/jest-dom": "6.6.3",
"@testing-library/react": "16.2.0",
"@testing-library/user-event": "14.6.1",
"@types/node": "20.17.17",
"@types/node": "22.13.1",
"@types/react": "19.0.8",
"@types/react-dom": "19.0.3",
"@types/react-syntax-highlighter": "15.5.13",
"@typescript-eslint/eslint-plugin": "8.24.0",
"@typescript-eslint/parser": "8.24.0",
"@vitejs/plugin-react": "4.3.4",
"@vitest/coverage-v8": "3.0.5",
"eslint": "9.20.0",
"eslint-config-next": "15.1.6",
"eslint-plugin-react": "7.37.4",
"eslint-plugin-react-hooks": "5.1.0",
"jsdom": "26.0.0",
"typescript": "5.7.3",
"vite": "6.1.0",
Expand Down
Loading

0 comments on commit c471d7f

Please sign in to comment.