Skip to content

Commit

Permalink
fix(lint): fix files formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
nfroidure committed Dec 22, 2023
1 parent 2df4794 commit 2280cf8
Show file tree
Hide file tree
Showing 27 changed files with 90 additions and 98 deletions.
6 changes: 5 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
"node": true,
"es2021": true
},
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "next/core-web-vitals"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"next/core-web-vitals"
],
"overrides": [],
"parser": "@typescript-eslint/parser",
"parserOptions": {
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
branches:
- main
tags:
- "v*.*.*"
- 'v*.*.*'
repository_dispatch:
types:
- publish-event
Expand Down Expand Up @@ -42,4 +42,4 @@ jobs:
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: out
folder: out
6 changes: 4 additions & 2 deletions contents/conferences/chtijs-27.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ location: FR

## Programme

**Talk de [David Leuliette](https://github.com/flexbox 'Voir son profil GitHub') :**
**Talk de
[David Leuliette](https://github.com/flexbox 'Voir son profil GitHub') :**
Découvrez comment développer 55% plus rapidement avec VSCode et GitHub Copilot

"J'ai exploré le Chat de GitHub nommé Copilot, une extension que vous pouvez
Expand All @@ -30,4 +31,5 @@ les auteurs !

## Pour info

Pour la liste des participants, voir [l'évènement Meetup](https://www.meetup.com/francejs/events/292749418/ "Aller sur la page de l'événement").
Pour la liste des participants, voir
[l'évènement Meetup](https://www.meetup.com/francejs/events/292749418/ "Aller sur la page de l'événement").
10 changes: 5 additions & 5 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/** @type {import('next').NextConfig} */

const baseURL =
process.env.NODE_ENV === "production"
? "https://chtijs.francejs.org"
: "http://chtijs.localhost:3000";
process.env.NODE_ENV === 'production'
? 'https://chtijs.francejs.org'
: 'http://chtijs.localhost:3000';
const basePath = '';
const assetPrefix = `${baseURL}${basePath}`;

Expand All @@ -13,7 +13,7 @@ const config = {
distDir: 'out',
reactStrictMode: true,
images: {
unoptimized: true
unoptimized: true,
},
publicRuntimeConfig: {
environment: process.env.NODE_ENV,
Expand All @@ -25,4 +25,4 @@ const config = {
swcMinify: true,
};

export default config;
export default config;
6 changes: 3 additions & 3 deletions src/app/not-found.module.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.img {
height: 19rem;
width: 6rem;
border-radius: 15px;
height: 19rem;
width: 6rem;
border-radius: 15px;
}

.p {
Expand Down
6 changes: 3 additions & 3 deletions src/components/_gridSystem.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import styles from "./_gridSystem.module.scss";
import styles from './_gridSystem.module.scss';

export default function GridSystem(): JSX.Element {
return (
<div className={styles.grid} id="gridSystem">
<div className={styles.vGrid} id="vGridSystem">
{new Array(30).fill("").map((_, index) => {
{new Array(30).fill('').map((_, index) => {
return [
<div key={`g${index}`} className={styles.gutter}></div>,
<div key={`c${index}`} className={styles.column}></div>,
];
})}
</div>
<div className={styles.hGrid} id="hGridSystem">
{new Array(100).fill("").map((_, index) => {
{new Array(100).fill('').map((_, index) => {
return [<div key={`${index}`} className={styles.row}></div>];
})}
</div>
Expand Down
5 changes: 3 additions & 2 deletions src/components/a.module.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
.root,
.root:visited {
color: #c1a008;
color: var(--senary);
font-weight: bold;
transition: color 0.1s linear;
text-decoration: none;
text-decoration: underline;
}
.root:hover,
.root:focus {
Expand Down
1 change: 0 additions & 1 deletion src/components/cite.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import styles from './cite.module.scss';


const Cite = ({
children,
...props
Expand Down
4 changes: 3 additions & 1 deletion src/components/contentBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ export default function ContentBlock({
className?: string;
}): JSX.Element {
return (
<section className={`${styles.root} root${className ? ' ' + className : ''}`}>
<section
className={`${styles.root} root${className ? ' ' + className : ''}`}
>
{children}
</section>
);
Expand Down
8 changes: 4 additions & 4 deletions src/components/gallery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ const Gallery = ({ imagesNodes }: { imagesNodes: MarkdownImageNode[] }) => {
<li key={index}>
<a
onClick={() => setSelectedIndex(index)}
aria-label={`Image ${index + 1}`}
tabIndex={0}
aria-label={`Image ${index + 1}`}
tabIndex={0}
>
<img
src={
Expand All @@ -37,7 +37,7 @@ const Gallery = ({ imagesNodes }: { imagesNodes: MarkdownImageNode[] }) => {
'/' +
imageNode.url
}
alt={imageNode.alt || `Image ${index + 1}`}
alt={imageNode.alt || `Image ${index + 1}`}
/>
</a>
</li>
Expand All @@ -46,4 +46,4 @@ const Gallery = ({ imagesNodes }: { imagesNodes: MarkdownImageNode[] }) => {
</div>
);
};
export default Gallery;
export default Gallery;
6 changes: 4 additions & 2 deletions src/components/h1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ const Heading1 = ({
className,
...props
}: { children: React.ReactNode } & React.HTMLAttributes<HTMLElement>) => (
<h1 className={`${styles.root}${className ? ' ' + className : ''}`} {...props}>
<h1
className={`${styles.root}${className ? ' ' + className : ''}`}
{...props}
>
{children}

</h1>
);

Expand Down
6 changes: 4 additions & 2 deletions src/components/h2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ const Heading2 = ({
className,
...props
}: { children: React.ReactNode } & React.HTMLAttributes<HTMLElement>) => (
<h2 className={`${styles.root}${className ? ' ' + className : ''}`} {...props}>
<h2
className={`${styles.root}${className ? ' ' + className : ''}`}
{...props}
>
{children}

</h2>
);

Expand Down
2 changes: 1 addition & 1 deletion src/components/h3.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const Heading3 = ({
}: { children: React.ReactNode } & React.HTMLAttributes<HTMLElement>) => (
<h3 className={styles.root} {...props}>
{children}
</h3>
</h3>
);

export default Heading3;
1 change: 0 additions & 1 deletion src/components/h4.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const Heading4 = ({
}: { children: React.ReactNode } & React.HTMLAttributes<HTMLElement>) => (
<h4 className={styles.root} {...props}>
{children}

</h4>
);

Expand Down
1 change: 0 additions & 1 deletion src/components/h5.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const Heading5 = ({
}: { children: React.ReactNode } & React.HTMLAttributes<HTMLElement>) => (
<h5 className={styles.root} {...props}>
{children}

</h5>
);

Expand Down
2 changes: 1 addition & 1 deletion src/components/menu.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
.nav a.selected {
text-decoration: underline;
color: var(--light);
background-color: var(--grey);
background-color: var(--dark);
}
.nav a:hover,
.nav a.selected:hover {
Expand Down
9 changes: 3 additions & 6 deletions src/components/strong.module.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
/* strong.module.scss */

.root {
color: var(--quinary);
font-weight: bold;
}

color: var(--quinary);
font-weight: bold;
}
14 changes: 1 addition & 13 deletions src/components/tootList.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,6 @@
margin: 0 0 var(--vRhythm) 0;
}

.toot :global(a) {
color: #205370;
}

.toot :global(p) {
margin-left: 2%;
}

.toot :global(a):hover {
color: #14171a;
}

.tootList {
margin-top: var(--vRhythm);
display: flex-block;
Expand All @@ -22,7 +10,7 @@
.toot {
border-bottom: var(--border) solid var(--grey);
width: auto;
padding: calc(var(--vRhythm) / 2) calc(var(--gutter) / 2);
padding: calc(var(--vRhythm) - var(--border)) 0 0 0;
overflow: hidden;
}

Expand Down
2 changes: 1 addition & 1 deletion src/contexts/grid.module.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "../../styles/variables.scss";
@import '../../styles/variables.scss';

:export {
vGrid: $CSS_GRID_V;
Expand Down
28 changes: 14 additions & 14 deletions src/contexts/grid.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"use client";
'use client';

import { type ReactNode, createContext } from "react";
import useCSSVar from "../hooks/useCSSVar";
import styles from "./grid.module.scss";
import { type ReactNode, createContext } from 'react';
import useCSSVar from '../hooks/useCSSVar';
import styles from './grid.module.scss';

const DEFAULT_GRID_H = parseFloat(styles.hGrid.replace("rem", ""));
const DEFAULT_GRID_V = parseFloat(styles.vGrid.replace("rem", ""));
const DEFAULT_GRID_H = parseFloat(styles.hGrid.replace('rem', ''));
const DEFAULT_GRID_V = parseFloat(styles.vGrid.replace('rem', ''));
const DEFAULT_V_RHYTHM_RATIO = parseFloat(styles.vRhythmRatio);
const DEFAULT_COLUMN_RATIO = parseFloat(styles.columnRatio);
const DEFAULT_GUTTER_RATIO = parseFloat(styles.gutterRatio);
Expand All @@ -23,21 +23,21 @@ export default function ProvideGridContext({
}: {
children: ReactNode;
}): ReactNode {
const vGrid = useCSSVar("number", "--vGrid", DEFAULT_GRID_V);
const hGrid = useCSSVar("number", "--hGrid", DEFAULT_GRID_H);
const vGrid = useCSSVar('number', '--vGrid', DEFAULT_GRID_V);
const hGrid = useCSSVar('number', '--hGrid', DEFAULT_GRID_H);
const vRhythmRatio = useCSSVar(
"number",
"--vRhythmRatio",
'number',
'--vRhythmRatio',
DEFAULT_V_RHYTHM_RATIO
);
const gutterRatio = useCSSVar(
"number",
"--gutterRatio",
'number',
'--gutterRatio',
DEFAULT_COLUMN_RATIO
);
const columnRatio = useCSSVar(
"number",
"--columnRatio",
'number',
'--columnRatio',
DEFAULT_GUTTER_RATIO
);

Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useCSSRemValue.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default function useCSSRemValue(fallbackSize = 16): number {
if (typeof navigator === "undefined") {
if (typeof navigator === 'undefined') {
return fallbackSize;
}

Expand Down
14 changes: 7 additions & 7 deletions src/hooks/useCSSVar.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
export default function useCSSVar<T extends "string" | "number">(
export default function useCSSVar<T extends 'string' | 'number'>(
type: T,
name: string,
fallback: T extends "number" ? number : string
): T extends "number" ? number : string {
if (typeof navigator === "undefined") {
fallback: T extends 'number' ? number : string
): T extends 'number' ? number : string {
if (typeof navigator === 'undefined') {
return fallback;
}

const cssValue = getComputedStyle(document.documentElement).getPropertyValue(
name
);

if (type === "string") {
return cssValue as unknown as T extends "number" ? number : string;
if (type === 'string') {
return cssValue as unknown as T extends 'number' ? number : string;
}

const numberValue = parseFloat(cssValue);
Expand All @@ -21,5 +21,5 @@ export default function useCSSVar<T extends "string" | "number">(
return fallback;
}

return numberValue as unknown as T extends "number" ? number : string;
return numberValue as unknown as T extends 'number' ? number : string;
}
6 changes: 3 additions & 3 deletions src/utils/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ export const ORGANISATION_PRIMARY_COLOR = '#f2c80a';
export const PUBLISHER = 'ChtiJS';
export const DOMAIN_NAME = 'chtijs.francejs.org';
export const TWITTER_ACCOUNT = 'chtijs';
export const MASTODON_ACCOUNT_ID = "111449166761360064";
export const MASTODON_SERVER = "piaille.fr";
export const MASTODON_ACCOUNT = "chtijs";
export const MASTODON_ACCOUNT_ID = '111449166761360064';
export const MASTODON_SERVER = 'piaille.fr';
export const MASTODON_ACCOUNT = 'chtijs';
4 changes: 2 additions & 2 deletions src/utils/contents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export function datedPagesSorter<T extends { date: string }>(
return Date.parse(dateA) === Date.parse(dateB)
? 0
: Date.parse(dateA) > Date.parse(dateB)
? -1
: 1;
? -1
: 1;
}

export function titledPagesSorter<T extends { title: string }>(
Expand Down
Loading

0 comments on commit 2280cf8

Please sign in to comment.