Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

task/WG-197: improve linting on react project #188

Merged
merged 8 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions react/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist/
build/
coverage/
8 changes: 2 additions & 6 deletions react/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,8 @@
"plugins": ["react", "react-hooks", "@typescript-eslint", "prettier"],
"rules": {
"prettier/prettier": ["error"],
"react/jsx-key": 0,
"jsx-a11y/anchor-is-valid": 0,
"react-hooks/exhaustive-deps": 0,
"react-hooks/rules-of-hooks": 0,
"react/display-name": 0,
"react/prop-types": 0
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-explicit-any": "off"
},
"settings": {
"react": {
Expand Down
3 changes: 2 additions & 1 deletion react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
"build": "tsc && vite build",
"preview": "vite preview",
"test": "jest",
"lint": "npm run lint:js",
"lint": "npm run lint:js && npm run prettier:check",
"lint:js": "eslint . --ext .js,.jsx,.ts,.tsx",
"lint:fix": "eslint . --ext .js,.jsx,.ts,.tsx --fix",
"lint:rules": "eslint --print-config src/index.tsx",
"prettier:check": "prettier --single-quote --check src",
"prettier:fix": "prettier --single-quote --write src"
},
Expand Down
1 change: 1 addition & 0 deletions react/src/pages/MapProject/MapProject.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const MapProject: React.FC<Props> = ({ isPublic = false }) => {
const { projectUUID } = useParams<{ projectUUID: string }>();

console.log(projectUUID);
console.log(isPublic);

return (
<div style={{ width: '100vw', height: '100vh' }}>
Expand Down
2 changes: 1 addition & 1 deletion react/src/utils/authUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function getTokenFromLocalStorage(): AuthToken {
const auth = JSON.parse(tokenStr);
return auth;
}
} catch (e: any) {
} catch (e) {
console.error('Error loading state from localStorage:', e);
}
return { token: null, expires: null };
Expand Down
2 changes: 1 addition & 1 deletion react/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function getDesignsafePortalUrl(backend: string): string {
}

// https://vitejs.dev/config/
export default defineConfig(({ command, mode }) => {
export default defineConfig(({ command, mode }) => { // eslint-disable-line
const envFile = loadEnv(mode, process.cwd(), '');
const targetEnvironment = envFile.TARGET;
const env = {
Expand Down
Loading