Skip to content

Commit

Permalink
update rules
Browse files Browse the repository at this point in the history
  • Loading branch information
mehdi-torabiv committed Jul 10, 2024
1 parent f91f4bd commit 572deaa
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 26 deletions.
7 changes: 6 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,15 @@ module.exports = {
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
project: ['./tsconfig.json', './tsconfig.node.json', "./tsconfig.app.json"],
},
plugins: ['react', '@typescript-eslint', 'prettier'],
rules: {
'react/react-in-jsx-scope': 0,
'import/no-extraneous-dependencies': 'off',
'import/prefer-default-export': 'warn',
"import/prefer-default-export": "off",
"import/order": 'warn',
"import/extensions": 'warn'
},
};
13 changes: 13 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"eslint": "^8.57.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^18.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.9.0",
"eslint-plugin-prettier": "^5.1.3",
Expand Down
14 changes: 7 additions & 7 deletions src/App.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from "react";
import { render, screen } from "@testing-library/react";
import App from "./App";
import React from 'react';
import { render, screen } from '@testing-library/react';
import App from './App';

test("renders test text", () => {
render(<App />);
const linkElement = screen.getByText(/test/i);
expect(linkElement).toBeInTheDocument();
test('renders test text', () => {
render(<App />);
const linkElement = screen.getByText(/test/i);
expect(linkElement).toBeInTheDocument();
});
4 changes: 2 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import "./App.css";
import React from 'react';
import './App.css';

function App() {
return <>test</>;
Expand Down
6 changes: 3 additions & 3 deletions src/api/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import axios from "axios";
import axios from 'axios';

export const client = axios.create({
baseURL: "",
baseURL: '',
headers: {
"Content-Type": "application/json",
'Content-Type': 'application/json',
},
});
16 changes: 8 additions & 8 deletions src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App.tsx";
import "./index.css";
import { BrowserRouter } from "react-router-dom";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App.tsx';

Check warning on line 3 in src/main.tsx

View workflow job for this annotation

GitHub Actions / test/node 18/ubuntu-latest

`./App.tsx` import should occur after import of `@tanstack/react-query`

Check warning on line 3 in src/main.tsx

View workflow job for this annotation

GitHub Actions / test/node 18/ubuntu-latest

Unexpected use of file extension "tsx" for "./App.tsx"

Check warning on line 3 in src/main.tsx

View workflow job for this annotation

GitHub Actions / test/node 17/ubuntu-latest

`./App.tsx` import should occur after import of `@tanstack/react-query`

Check warning on line 3 in src/main.tsx

View workflow job for this annotation

GitHub Actions / test/node 17/ubuntu-latest

Unexpected use of file extension "tsx" for "./App.tsx"

Check warning on line 3 in src/main.tsx

View workflow job for this annotation

GitHub Actions / test/node 18/ubuntu-latest

`./App.tsx` import should occur after import of `@tanstack/react-query`

Check warning on line 3 in src/main.tsx

View workflow job for this annotation

GitHub Actions / test/node 18/ubuntu-latest

Unexpected use of file extension "tsx" for "./App.tsx"

Check warning on line 3 in src/main.tsx

View workflow job for this annotation

GitHub Actions / test/node 17/ubuntu-latest

`./App.tsx` import should occur after import of `@tanstack/react-query`

Check warning on line 3 in src/main.tsx

View workflow job for this annotation

GitHub Actions / test/node 17/ubuntu-latest

Unexpected use of file extension "tsx" for "./App.tsx"
import './index.css';
import { BrowserRouter } from 'react-router-dom';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';

import '@fontsource/roboto/300.css';
import '@fontsource/roboto/400.css';
Expand All @@ -20,12 +20,12 @@ const queryClient = new QueryClient({
},
});

ReactDOM.createRoot(document.getElementById("root")!).render(
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<QueryClientProvider client={queryClient}>
<BrowserRouter>
<App />
</BrowserRouter>
</QueryClientProvider>
</React.StrictMode>,
</React.StrictMode>
);
4 changes: 2 additions & 2 deletions src/setupTests.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as matchers from "@testing-library/jest-dom/matchers";
import { expect } from "vitest";
import * as matchers from '@testing-library/jest-dom/matchers';
import { expect } from 'vitest';

expect.extend(matchers);
2 changes: 1 addition & 1 deletion src/store/authStore.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { create } from "zustand";
import { create } from 'zustand';

export const useAuthStore = create(() => ({
user: null,
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
"isolatedModules": true,
"moduleDetection": "force",
"noEmit": true,
"jsx": "react",
"jsx": "react-jsx",

/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src", ".eslintrc.cjs"]
"include": [".prettierrc.cjs", ".eslintrc.cjs", "src"]
}

0 comments on commit 572deaa

Please sign in to comment.