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

fix: lint issue #574

Merged
merged 1 commit into from
May 30, 2024
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
6 changes: 3 additions & 3 deletions bundestag.io/admin/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": ["next", "next/core-web-vitals"],
"root": true,
"extends": ["next", "prettier"],
"rules": {
"react/display-name": 0,
"@typescript-eslint/no-explicit-any": ["warn"]
"react/display-name": 0
}
}
6 changes: 3 additions & 3 deletions bundestag.io/admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint && tsc --noEmit",
"lint": "next lint",
"codegen": "graphql-codegen --require dotenv/config --config codegen.ts dotenv_config_path=.env.local"
},
"dependencies": {
Expand Down Expand Up @@ -37,8 +37,8 @@
"@vanilla-extract/css": "^1.14.2",
"@vanilla-extract/next-plugin": "^2.4.0",
"babel-plugin-styled-components": "^2.1.4",
"eslint": "9.0.0",
"eslint": "^8",
"eslint-config-next": "14.1.4",
"typescript": "^5.4.4"
"typescript": "^5.3.3"
}
}
4 changes: 2 additions & 2 deletions bundestag.io/admin/src/__generated/gql-ai/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from "./fragment-masking";
export * from "./gql";
export * from './fragment-masking';
export * from './gql';
4 changes: 2 additions & 2 deletions bundestag.io/admin/src/__generated/gql/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from "./fragment-masking";
export * from "./gql";
export * from './fragment-masking';
export * from './gql';
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React, { useRef, useState } from 'react';
import { Form, Input, Button, InputNumber, Radio, Row, Col, notification, Switch, FormInstance } from 'antd';
import React from 'react';
import { Form, Input, Button, InputNumber, Radio, Row, Col, notification, Switch } from 'antd';
import { axiosClient } from '../../lib/axios';
import { AiVotes, AiVotesProps } from './AiVotes';
import { Vote } from '@/__generated/gql-ai/graphql';

// Ant Design Sub-Elements
const { TextArea } = Input;
Expand Down Expand Up @@ -74,7 +73,7 @@ const VoteResultsForm = ({ data, type, procedureId, period }) => {
});
};

const onFinishFailed = (...args) => {
const onFinishFailed = () => {
notification.error({
message: 'Speichern Fehlgeschlagen!',
description: 'Überprüfe deine eingaben',
Expand Down
14 changes: 4 additions & 10 deletions bundestag.io/admin/src/graphql/mutations/saveVoteResults.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { gql } from "@apollo/client";
import VoteResults from "../fragments/voteResults";
import { gql } from '@apollo/client';
import VoteResults from '../fragments/voteResults';

export const SAVE_VOTE_RESULTS = gql`
mutation saveProcedureCustomData(
Expand All @@ -24,14 +24,8 @@ export const SAVE_VOTE_RESULTS = gql`
`;

export const SAVE_VOTE_RESULTS_NAMED_POLL = gql`
mutation saveProcedurenamedPollCustomData(
$procedureId: String!
$toggleDecision: Boolean!
) {
saveProcedurenamedPollCustomData(
procedureId: $procedureId
toggleDecision: $toggleDecision
) {
mutation saveProcedurenamedPollCustomData($procedureId: String!, $toggleDecision: Boolean!) {
saveProcedurenamedPollCustomData(procedureId: $procedureId, toggleDecision: $toggleDecision) {
...VoteResults
procedureId
}
Expand Down
1 change: 0 additions & 1 deletion bundestag.io/admin/src/lib/apolloClient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ function createIsomorphicLink(context: GraphQlContext | { headers: any } | undef
// const { graphQlSchema } = require("./schema");
// return new SchemaLink({ schema: graphQlSchema, context });
// }
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { HttpLink } = require('@apollo/client');

/**
Expand Down
2 changes: 1 addition & 1 deletion bundestag.io/admin/src/lib/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
let errors: string[] = [];
const errors: string[] = [];
const AI_SIMULATION = process.env.AI_SIMULATION === 'true';

if (!process.env.BUNDESTAGIO_SERVER_URL) {
Expand Down
1 change: 1 addition & 0 deletions bundestag.io/admin/tsconfig.tsbuildinfo

Large diffs are not rendered by default.

69 changes: 1 addition & 68 deletions democracy/desktop/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,71 +1,4 @@
{
"root": true,
// Configuration for JavaScript files
"extends": ["airbnb-base", "next/core-web-vitals", "plugin:prettier/recommended"],
"rules": {
"prettier/prettier": [
"error",
{
"singleQuote": true,
"endOfLine": "auto"
}
]
},
"overrides": [
// Configuration for TypeScript files
{
"files": ["**/*.ts", "**/*.tsx"],
"plugins": ["@typescript-eslint", "unused-imports", "tailwindcss"],
"extends": [
"plugin:tailwindcss/recommended",
"airbnb-typescript",
"next/core-web-vitals",
"plugin:prettier/recommended"
],
"rules": {
"prettier/prettier": [
"error",
{
"singleQuote": true,
"endOfLine": "auto"
}
],
"react/destructuring-assignment": "off", // Vscode doesn't support automatically destructuring, it's a pain to add a new variable
"jsx-a11y/anchor-is-valid": "off", // Next.js use his own internal link system
"react/require-default-props": "off", // Allow non-defined react props as undefined
"react/jsx-props-no-spreading": "off", // _app.tsx uses spread operator and also, react-hook-form
"@next/next/no-img-element": "off", // We currently not using next/image because it isn't supported with SSG mode
"import/order": [
"error",
{
"groups": ["builtin", "external", "internal"],
"pathGroups": [
{
"pattern": "react",
"group": "external",
"position": "before"
}
],
"pathGroupsExcludedImportTypes": ["react"],
"newlines-between": "always",
"alphabetize": {
"order": "asc",
"caseInsensitive": true
}
}
],
"@typescript-eslint/comma-dangle": "off", // Avoid conflict rule between Eslint and Prettier
"import/prefer-default-export": "off", // Named export is easier to refactor automatically
"tailwindcss/classnames-order": [
"warn",
{
"officialSorting": true
}
], // Follow the same ordering as the official plugin `prettier-plugin-tailwindcss`
"@typescript-eslint/no-unused-vars": "off",
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }]
}
}
]
"extends": ["next/core-web-vitals", "prettier"],
}
19 changes: 4 additions & 15 deletions democracy/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,31 +48,20 @@
"@types/node": "20.12.12",
"@types/react": "18.3.3",
"@types/slug": "5.0.8",
"@typescript-eslint/eslint-plugin": "7.10.0",
"@typescript-eslint/parser": "7.10.0",
"autoprefixer": "10.4.19",
"cross-env": "7.0.3",
"cssnano": "7.0.1",
"eslint": "9.3.0",
"eslint-config-airbnb-base": "15.0.0",
"eslint-config-airbnb-typescript": "18.0.0",
"eslint-config-next": "14.2.3",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-jsx-a11y": "6.8.0",
"eslint-plugin-prettier": "5.1.3",
"eslint-plugin-react": "7.34.1",
"eslint-plugin-react-hooks": "4.6.2",
"eslint-plugin-tailwindcss": "3.17.0",
"eslint-plugin-unused-imports": "4.0.0",
"eslint": "8",
"eslint-config-next": "14.1.4",
"eslint-config-prettier": "^9.1.0",
"husky": "9.0.11",
"lint-staged": "15.2.5",
"npm-run-all": "4.1.5",
"postcss": "8.4.38",
"prettier": "3.2.5",
"rimraf": "5.0.7",
"tailwindcss": "3.4.3",
"typescript": "5.4.5"
"typescript": "5.3.3"
},
"license": "ISC"
}
3 changes: 2 additions & 1 deletion democracy/desktop/src/components/molecules/ChartPair.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useEffect, useRef, useState } from 'react';
import { formatVotes } from '@/utils/Helpers';

import DoughnutChart, { PartyVote, VoteCategory, Votes } from '../organisms/DoughnutChart';
import Image from 'next/image';

function sortPartyVotes(partyVotes: PartyVote[], key: string) {
try {
Expand Down Expand Up @@ -204,7 +205,7 @@ export default function ChartPair({ item, className, large }) {
</span> */}
{partyVotes.map((p) => (
<div key={p.party} className="flex w-full items-center justify-between pb-px">
<img
<Image
src={`/img/parteilogos/unified/${slug(p.party)}.svg`}
className={`${large ? 'h-6 w-20' : 'h-5 w-14'} object-cover text-xs italic`}
alt={p.party}
Expand Down
5 changes: 3 additions & 2 deletions democracy/desktop/src/components/molecules/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { useRouter } from 'next/router';
import { useRecoilState } from 'recoil';

import { searchTermState } from '@/components/state/states';
import Image from 'next/image';

function classNames(...classes: string[]) {
return classes.filter(Boolean).join(' ');
Expand Down Expand Up @@ -47,14 +48,14 @@ const Navigation = () => {
<div className="flex h-16 justify-between">
<div className="flex">
<Link href="/" className="flex shrink-0 items-center rounded">
<img
<Image
className="hidden h-[38px] w-auto lg:inline-flex"
height="161"
width="1024"
src="/assets/images/logo-text.svg"
alt="Democracy App"
/>
<img
<Image
className="inline-flex h-[38px] w-auto lg:hidden"
height="160"
width="161"
Expand Down
Loading
Loading