Skip to content

Commit

Permalink
Merge pull request #11 from IdoBouskila/chore/lint
Browse files Browse the repository at this point in the history
Chore/lint
  • Loading branch information
IdoBouskila authored Nov 29, 2024
2 parents 3255ab6 + 06bef3f commit e936a2a
Show file tree
Hide file tree
Showing 15 changed files with 1,737 additions and 60 deletions.
78 changes: 52 additions & 26 deletions client/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,54 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'
import js from '@eslint/js';
import globals from 'globals';
import tseslint from 'typescript-eslint';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import perfectionist from 'eslint-plugin-perfectionist';
import eslintPluginUnicorn from 'eslint-plugin-unicorn';

export default tseslint.config(
{ ignores: ['dist'] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
},
)
{ ignores: ['dist'] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
unicorn: eslintPluginUnicorn,
perfectionist: perfectionist,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'perfectionist/sort-imports': [
'error',
{
groups: [],
order: 'asc',
type: 'line-length',
newlinesBetween: 'ignore',
},
],
'perfectionist/sort-named-imports': [
'error',
{
order: 'asc',
type: 'line-length',
},
],
'unicorn/filename-case': [
'error',
{
case: 'kebabCase',
},
],
},
}
);
8 changes: 5 additions & 3 deletions client/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "simple-weather-app",
"name": "weather-app-client",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"preview": "vite preview",
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview"
"lint": "concurrently -n eslint,tsc -c magenta,blue \"eslint . --report-unused-disable-directives --max-warnings 0\" \"tsc --project tsconfig.app.json\""
},
"dependencies": {
"@tanstack/react-query": "^5.61.5",
Expand All @@ -28,8 +28,10 @@
"@vitejs/plugin-react": "^4.3.3",
"concurrently": "^9.1.0",
"eslint": "^9.13.0",
"eslint-plugin-perfectionist": "^4.1.2",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-react-refresh": "^0.4.14",
"eslint-plugin-unicorn": "^56.0.1",
"globals": "^15.11.0",
"typescript": "~5.6.2",
"typescript-eslint": "^8.11.0",
Expand Down
4 changes: 2 additions & 2 deletions client/src/App.tsx → client/src/app.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import './App.css';
import { useState } from 'react';
import tabs from './components/utils/tabs';
import Dashboard from './components/Dashboard';
import SideNavigation from './components/SideNavigation';
import Dashboard from './components/dashboard';
import SideNavigation from './components/side-navigation';

function App() {
const [currentTabId, setCurrentTabId] = useState(tabs[0].id);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Map from './Map';
import { PiDropLight, PiEyeLight, PiSunLight, PiThermometerSimple, PiWind, PiWindLight } from 'react-icons/pi';
import Map from './map';
import { PiWind, PiEyeLight, PiSunLight, PiDropLight, PiWindLight, PiThermometerSimple } from 'react-icons/pi';

const Dashboard = () => {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'leaflet/dist/leaflet.css';
import { MapContainer, Marker, TileLayer } from 'react-leaflet';
import { Marker, TileLayer, MapContainer } from 'react-leaflet';

const mapSettings = {
defaultZoom: 11,
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion client/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import App from './App.tsx';
import App from './app.tsx';
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';

Expand Down
2 changes: 1 addition & 1 deletion client/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true
},
"include": ["src"]
"include": ["src/*"],
}
Loading

0 comments on commit e936a2a

Please sign in to comment.