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

Version 2: Add stylistic Eslint #183

Closed
wants to merge 46 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
87c3211
feat: init v2 strcucture
donskov Apr 3, 2022
d0ed5b4
feat(deps): add "craco" to resolve global "crypto" use
donskov Apr 4, 2022
53c4081
feat: add basic connection
donskov Sep 12, 2022
cc1cac4
feat: use Vite instead of CRA
donskov Mar 25, 2024
29dc4b4
Version 2 (#101)
OleksandrSPV Apr 29, 2024
fc330cd
Add storybook (#121)
OleksandrSPV Apr 29, 2024
4c0c19b
Version 2: Add certificate viewer (#123)
OleksandrSPV May 1, 2024
f0403a1
Version 2: Style fetching statuses (#124)
OleksandrSPV May 1, 2024
083033b
Version 2: Add delete certificate dialog (#130)
OleksandrSPV May 6, 2024
27f35d7
Version 2: Add Certificate creation menu (#136)
OleksandrSPV May 9, 2024
fc09da2
Version 2: Add Certificate download button (#138)
OleksandrSPV May 10, 2024
e52e5ac
Version 2: Add Certificate copy button (#142)
OleksandrSPV May 13, 2024
bda7998
Version 2: Add Vitest (#143)
OleksandrSPV May 14, 2024
ab4a8d6
Version 2: Add ci (#145)
OleksandrSPV May 17, 2024
c970d5a
Version 2: Add import certificate dialog (#132)
OleksandrSPV May 20, 2024
581503d
Version 2: Improve provider list (#147)
OleksandrSPV May 29, 2024
3315399
Version 2: Create Certificate creation Dialog (#144)
OleksandrSPV May 31, 2024
24cdabb
Version 2: Improve certificate delete dialog (#151)
OleksandrSPV Jun 4, 2024
46dc814
Version 2: Add App error boundary (#148)
OleksandrSPV Jun 6, 2024
e901957
Version 2: Add missed stories to storybook (#153)
OleksandrSPV Jun 14, 2024
71e2361
Remove general block (#156)
OleksandrSPV Jun 17, 2024
98fd08c
Version2: Add sorting to certificate list (#146)
OleksandrSPV Jun 24, 2024
7a505a5
Version 2: Add certificate creation logic (#149)
OleksandrSPV Jun 24, 2024
d98f207
Version 2: Remove certificate logic (#152)
OleksandrSPV Jun 27, 2024
9f6a477
Version 2: Certificates list improvements (#158)
OleksandrSPV Jul 4, 2024
3a95d0a
Fix search input (#160)
OleksandrSPV Jul 4, 2024
0f0ea1a
Uppdate @peculiar packages (#162)
OleksandrSPV Jul 4, 2024
3a36d8e
Version 2: Fix certificate import dialog (#150)
OleksandrSPV Jul 4, 2024
1eeea63
Add import logic (#164)
OleksandrSPV Jul 5, 2024
0de48e3
Fix providers list readonly label (#165)
OleksandrSPV Jul 5, 2024
86be410
Fix copy certificate (#169)
OleksandrSPV Jul 11, 2024
dc0a890
Version2: Add certificate search logic (#167)
OleksandrSPV Jul 22, 2024
24437d6
Version 2: Update packages (#170)
OleksandrSPV Jul 22, 2024
04d3582
Version 2: Add certificate viewer dialog hook (#171)
OleksandrSPV Jul 23, 2024
7436eb4
Version 2: Fix certificate name (label) (#174)
OleksandrSPV Jul 23, 2024
f103739
Add ExtendedKeyUsage for certificate creation (#172)
OleksandrSPV Jul 23, 2024
70852c5
Version 2: Fix readme logo (#180)
OleksandrSPV Jul 26, 2024
232ad5a
Fix certificate import dialog close (#179)
OleksandrSPV Jul 26, 2024
35ccf82
Add cerificates sorting by type (#181)
OleksandrSPV Jul 26, 2024
73e6035
Add stylistic eslint
aleksandr-slobodian Jul 29, 2024
d085c3d
Version 2: Add gh-pages (#184)
OleksandrSPV Jul 31, 2024
1537e20
Add eslint plugin import
aleksandr-slobodian Jul 31, 2024
35398ce
Merge branch 'donskov/v2' into aslobodian/v2-add-stylistic-eslint
OleksandrSPV Jul 31, 2024
6ef2743
Update packages
aleksandr-slobodian Aug 12, 2024
c7036ad
Merge branch 'main' into aslobodian/v2-add-stylistic-eslint
OleksandrSPV Aug 30, 2024
84f1fdc
Fix lint
aleksandr-slobodian Aug 30, 2024
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
49 changes: 39 additions & 10 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,59 @@
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import eslintConfigPrettier from "eslint-config-prettier";
import stylisticJs from "@stylistic/eslint-plugin-js";
import importPlugin from "eslint-plugin-import-x";

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
eslintConfigPrettier,
{
files: ["src/**/*.ts", "src/**/*.tsx"],
ignores: ["src/**/*.d.ts"],
plugins: {
"@stylistic/js": stylisticJs,
import: importPlugin,
},
rules: {
"@typescript-eslint/semi": 1,
"no-param-reassign": ["error", { props: false }],
"brace-style": ["error", "1tbs", { allowSingleLine: true }],
"operator-assignment": ["error", "always"],
"no-empty": 2,
"no-multi-assign": 2,
"spaced-comment": ["warn", "always", { exceptions: ["*"] }],
"no-var": 2,
"@typescript-eslint/keyword-spacing": 2,
"spaced-comment": ["warn", "always", { exceptions: ["*"] }],
"no-fallthrough": 2,
"@typescript-eslint/no-unused-vars": 1,
quotes: ["error", "double"],
"arrow-body-style": ["error", "as-needed"],
"eol-last": ["warn", "always"],
"no-multiple-empty-lines": ["error", { max: 1, maxBOF: 0, maxEOF: 0 }],

"@stylistic/js/eol-last": ["warn", "always"],
"@stylistic/js/no-multiple-empty-lines": [
"error",
{ max: 1, maxBOF: 0, maxEOF: 0 },
],
"@stylistic/js/keyword-spacing": 2,
"@stylistic/js/quotes": ["error", "double"],
"@stylistic/js/quote-props": ["error", "as-needed"],
"@stylistic/js/semi": 1,
"@stylistic/js/semi-style": ["error", "last"],
"@stylistic/js/brace-style": ["error", "1tbs", { allowSingleLine: true }],
"@stylistic/js/arrow-parens": ["error", "always"],
"@stylistic/js/object-curly-spacing": ["error", "always"],
"@stylistic/js/comma-style": ["error", "last"],

"@stylistic/js/jsx-quotes": ["error", "prefer-double"],

"@typescript-eslint/no-unused-vars": ["warn", { caughtErrors: "none" }],
"@typescript-eslint/no-unused-expressions": [
"error",
{ allowShortCircuit: true, allowTernary: true },
],

"import/order": [
"error",
{
groups: ["builtin", "external", "internal"],
},
],
},
}
},
eslintConfigPrettier
);
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"@storybook/react": "^8.2.9",
"@storybook/react-vite": "^8.2.9",
"@storybook/test": "^8.2.9",
"@stylistic/eslint-plugin-js": "^2.6.2",
"@testing-library/react": "^16.0.0",
"@types/react": "^18.3.4",
"@types/react-dom": "^18.3.0",
Expand All @@ -26,14 +27,15 @@
"autoprefixer": "^10.4.20",
"eslint": "^9.9.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import-x": "^3.1.0",
"gh-pages": "^6.1.1",
"jsdom": "^25.0.0",
"postcss": "^8.4.41",
"prettier": "^3.3.3",
"sass": "^1.77.8",
"storybook": "^8.2.9",
"typescript": "^5.5.4",
"typescript-eslint": "^7.18.0",
"typescript-eslint": "^8.0.1",
"vite": "^5.4.2",
"vite-plugin-svgr": "^4.2.0",
"vite-tsconfig-paths": "^5.0.1",
Expand Down
2 changes: 1 addition & 1 deletion src/components/app-fallback/AppFallback.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Meta, StoryObj } from "@storybook/react";
import { AppFallback } from "./AppFallback";
import { fn } from "@storybook/test";
import { AppFallback } from "./AppFallback";

const meta: Meta<typeof AppFallback> = {
title: "Components/AppFallback",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { Meta, StoryObj } from "@storybook/react";
import { CertificateAlgorithmInfo } from "./CertificateAlgorithmInfo";
import {
EHashAlgorithm,
ESignatureAlgorithm,
} from "@peculiar/fortify-client-core";
import { CertificateAlgorithmInfo } from "./CertificateAlgorithmInfo";

const meta: Meta<typeof CertificateAlgorithmInfo> = {
title: "Components/CertificateAlgorithmInfo",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React, { useState } from "react";
import { useTranslation } from "react-i18next";
import { Button, TextField } from "@peculiar/react-components";
import { CertificateAlgorithmInfo } from "../certificate-algorithm-info";
import { Card } from "../card";
import {
EHashAlgorithm,
ESignatureAlgorithm,
} from "@peculiar/fortify-client-core";
import { CertificateAlgorithmProps, CertificateType } from "../../types";
import { CertificateAlgorithmInfo } from "../certificate-algorithm-info";
import { Card } from "../card";

import styles from "./styles/index.module.scss";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import React, { useState } from "react";
import { useTranslation } from "react-i18next";
import { ExtendedKeyUsageType } from "@peculiar/x509";
import {
CertificateAlgorithmProps,
CertificateSubjectProps,
CertificateType,
} from "../../types";
import {
Autocomplete,
Button,
TextField,
Typography,
} from "@peculiar/react-components";
import { ExtendedKeyUsageType } from "@peculiar/x509";
import { CertificateKeyPropertiesSelect } from "../certificate-key-properties-select";
import { Card } from "../card";
import { KeyUsagesCheckboxGroup } from "../key-usages-checkbox-group";
import {
CertificateAlgorithmProps,
CertificateSubjectProps,
CertificateType,
} from "../../types";

import { countries } from "../../config/data";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React, { useState } from "react";
import { useTranslation } from "react-i18next";
import { Button, TextField } from "@peculiar/react-components";
import { CertificateAlgorithmInfo } from "../certificate-algorithm-info";
import { Card } from "../card";
import {
EHashAlgorithm,
ESignatureAlgorithm,
} from "@peculiar/fortify-client-core";
import { CertificateAlgorithmInfo } from "../certificate-algorithm-info";
import { Card } from "../card";
import { CertificateAlgorithmProps, CertificateType } from "../../types";

import styles from "./styles/index.module.scss";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ import React from "react";
import { useTranslation } from "react-i18next";
import { IProviderInfo } from "@peculiar/fortify-client-core";
import clsx from "clsx";
import {
CertificateTypeSelect,
ICertificateTypeSelectValue,
} from "../certificate-type-select";
import {
Dialog,
ArrowRightIcon,
Expand All @@ -27,6 +23,10 @@ import {
ICertificateCreateByCustomData,
} from "../certificate-create-by-custom";
import { CertificatesProvidersSelectList } from "../certificates-providers-select-list";
import {
CertificateTypeSelect,
ICertificateTypeSelectValue,
} from "../certificate-type-select";
import { CertificateType } from "../../types";

import styles from "./styles/index.module.scss";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Meta, StoryObj } from "@storybook/react";
import { CertificatesList } from "./CertificatesList";
import { faker } from "@faker-js/faker";
import { CertificatesList } from "./CertificatesList";

const meta: Meta<typeof CertificatesList> = {
title: "Components/CertificatesList",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from "react";
import { IProviderInfo } from "@peculiar/fortify-client-core";
import { useTranslation } from "react-i18next";
import { Skeleton, Typography } from "@peculiar/react-components";
import { CertificatesProvidersListItem } from "../certificates-providers-list-item";
import AttentionCircleIcon from "../../icons/attention-circle.svg?react";
import { Skeleton, Typography } from "@peculiar/react-components";
import styles from "./styles/index.module.scss";

interface CertificatesProvidersListProps {
Expand Down
2 changes: 1 addition & 1 deletion src/components/date/Date.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Typography } from "@peculiar/react-components";
import React, { ComponentProps } from "react";
import { useTranslation } from "react-i18next";
import styles from "./styles/index.module.scss";
import clsx from "clsx";
import styles from "./styles/index.module.scss";

interface DateProps {
date?: Date;
Expand Down
5 changes: 5 additions & 0 deletions src/icons/import.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading