Skip to content

Commit

Permalink
Migrate ESLint config & Add CI (#10)
Browse files Browse the repository at this point in the history
* Migrate ESLint config

* Add CI and fix links in readme

* lint
  • Loading branch information
mhd-hi authored Jan 25, 2025
1 parent 366222a commit 84d6c95
Show file tree
Hide file tree
Showing 16 changed files with 2,506 additions and 803 deletions.
3 changes: 0 additions & 3 deletions .eslintrc.json

This file was deleted.

40 changes: 0 additions & 40 deletions .github/workflows/build.yml

This file was deleted.

39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build-and-test:
strategy:
matrix:
node-version: [20.x]

name: Build & test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Type checking
run: yarn run check-types

- name: Build Next.js
run: yarn run build
env:
CI: true

- name: Lint
run: yarn lint
10 changes: 10 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"bradlc.vscode-tailwindcss",
"yoavbls.pretty-ts-errors",
"ms-playwright.playwright",
"github.vscode-github-actions",
"rvest.vs-code-prettier-eslint"
]
}
34 changes: 34 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.addMissingImports": "explicit",
"source.fixAll.eslint": "explicit"
},
"[typescriptreact]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
},
"[typescript]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
},
"eslint.nodePath": "./node_modules/eslint",

"eslint.format.enable": true,
"eslint.validate": [
"javascript",
"typescript",
"javascriptreact",
"typescriptreact",
"html",
"markdown",
"json",
"yaml",
"css",
"pcss",
"postcss",
"github-actions-workflow"
],
"search.exclude": {
"yarn.lock": true
}
}
24 changes: 8 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# <p align="center">PlanifETS Frontend</p>

<p align="center">
<a href="https://github.com/your-repo/planifETS-frontend/actions/workflows/ci.yml" target="_blank">
<a href="https://github.com/ApplETS/planifETS-frontend/actions/workflows/ci.yml" target="_blank">
<img src="https://github.com/your-repo/planifETS-frontend/actions/workflows/ci.yml/badge.svg" alt="CI Status" style="height: 20px; margin-right: 5px;">
</a>
<a href="https://www.notion.so/PlanifETS-Frontend" target="_blank">
<a href="https://www.notion.so/PlanifETS-29cdf43623ec4c749dc5280dcaa3dba4" target="_blank">
<img src="https://img.shields.io/badge/Notion-%23000000.svg?style=for-the-badge&logo=notion&logoColor=white" alt="Notion" style="height: 20px; margin-right: 5px;">
</a>
</p>
Expand All @@ -17,17 +17,16 @@ This frontend complements the PlanifETS backend, providing an intuitive and user

## 🚀 Technologies Used

- [Next.js](https://nextjs.org/)
- [React](https://reactjs.org/)
- [TypeScript](https://www.typescriptlang.org/)
- [Tailwind CSS](https://tailwindcss.com/)
- [Vercel](https://vercel.com/)
- [Next.js](https://nextjs.org/)
- [React](https://reactjs.org/)
- [TypeScript](https://www.typescriptlang.org/)
- [Tailwind CSS](https://tailwindcss.com/)

---

## 🛠️ Onboarding

To get started with the frontend, refer to our onboarding documentation available on [Notion](https://www.notion.so/PlanifETS-Frontend).
To get started with the frontend, refer to our onboarding documentation available on [Notion](https://www.notion.so/Frontend-Onboarding-1827e115b74f80ef9802daa8f3425813?pvs=25).

### Quick Start

Expand All @@ -49,11 +48,10 @@ To get started with the frontend, refer to our onboarding documentation availabl

## ⚖️ License

This project is licensed under the MIT License. See the [LICENSE](https://github.com/your-repo/planifETS-frontend/blob/main/LICENSE) file for more information.
This project is licensed under the MIT License. See the [LICENSE](https://github.com/ApplETS/planifETS-frontend/blob/main/LICENSE) file for more information.

---


## 📚 Learn More

- [Next.js Documentation](https://nextjs.org/docs): Explore features and APIs.
Expand All @@ -62,10 +60,4 @@ This project is licensed under the MIT License. See the [LICENSE](https://github

---

## 🚀 Deploying on Vercel

Deploy this project using [Vercel](https://vercel.com). Follow the [Next.js deployment guide](https://nextjs.org/docs/deployment) for detailed steps.

---

🎉 **Make your academic planning at ÉTS effortless with PlanifETS!**
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
version: "3.8"
version: '3.8'
services:
frontend:
build:
context: .
dockerfile: Dockerfile
ports:
- "3000:3000"
- '3000:3000'
volumes:
- .:/app
- /app/node_modules
Expand Down
60 changes: 60 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import antfu from '@antfu/eslint-config';
import nextPlugin from '@next/eslint-plugin-next';
import jestDom from 'eslint-plugin-jest-dom';
import jsxA11y from 'eslint-plugin-jsx-a11y';
import playwright from 'eslint-plugin-playwright';
import tailwind from 'eslint-plugin-tailwindcss';
import testingLibrary from 'eslint-plugin-testing-library';

export default antfu({
react: true,
typescript: true,

lessOpinionated: true,
isInEditor: false,

stylistic: {
semi: true,
},

formatters: {
css: true,
},

ignores: [
'migrations/**/*',
'next-env.d.ts',
'node_modules/**/*',
'public/**/*',
],
}, ...tailwind.configs['flat/recommended'], jsxA11y.flatConfigs.recommended, {
plugins: {
'@next/next': nextPlugin,
},
rules: {
...nextPlugin.configs.recommended.rules,
...nextPlugin.configs['core-web-vitals'].rules,
},
}, {
files: [
'**/*.test.ts?(x)',
],
...testingLibrary.configs['flat/react'],
...jestDom.configs['flat/recommended'],
}, {
files: [
'**/*.spec.ts',
'**/*.e2e.ts',
],
...playwright.configs['flat/recommended'],
}, {
rules: {
'antfu/no-top-level-await': 'off', // Allow top-level await
'style/brace-style': ['error', '1tbs'], // Use the default brace style
'ts/consistent-type-definitions': ['error', 'type'], // Use `type` instead of `interface`
'react/prefer-destructuring-assignment': 'off', // Vscode doesn't support automatically destructuring, it's a pain to add a new variable
'node/prefer-global/process': 'off', // Allow using `process.env`
'test/padding-around-all': 'error', // Add padding in test files
'test/prefer-lowercase-title': 'off', // Allow using uppercase titles in test titles
},
});
2 changes: 1 addition & 1 deletion next.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { NextConfig } from "next";
import type { NextConfig } from 'next';

const nextConfig: NextConfig = {
/* config options here */
Expand Down
55 changes: 42 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,51 @@
"dev": "next dev --turbopack",
"build": "next build",
"start": "next start",
"lint": "next lint",
"test": "echo \"No tests configured yet\" && exit 0"
"clean": "rimraf .next out coverage",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"check-types": "tsc --noEmit --pretty"
},
"dependencies": {
"react": "19.0.0-rc-66855b96-20241106",
"react-dom": "19.0.0-rc-66855b96-20241106",
"next": "15.0.3"
"next": "^15.1.0",
"react": "19.0.0",
"react-dom": "19.0.0",
"react-icons": "^5.3.0"
},
"devDependencies": {
"typescript": "^5",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"postcss": "^8",
"tailwindcss": "^3.4.1",
"eslint": "^8",
"eslint-config-next": "15.0.3"
"@antfu/eslint-config": "^3.11.2",
"@eslint-react/eslint-plugin": "^1.19.0",
"@next/eslint-plugin-next": "^15.1.2",
"@types/debug": "^4.1.12",
"@types/estree": "^1.0.5",
"@types/json-schema": "^7.0.15",
"@types/mdast": "^4.0.3",
"@types/ms": "^0.7.34",
"@types/node": "^22.10.1",
"@types/normalize-package-data": "^2.4.4",
"@types/parse-json": "^4.0.2",
"@types/prop-types": "^15.7.11",
"@types/react": "^19.0.1",
"@types/react-dom": "^19",
"@types/react-transition-group": "^4.4.10",
"@types/unist": "^3.0.2",
"@typescript-eslint/eslint-plugin": "^8.18.2",
"@typescript-eslint/parser": "^8.18.2",
"@vitest/eslint-plugin": "^1.1.25",
"autoprefixer": "^10.4.20",
"eslint": "^9.16.0",
"eslint-plugin-format": "^0.1.3",
"eslint-plugin-jest-dom": "^5.5.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-playwright": "^2.1.0",
"eslint-plugin-react-hooks": "^5.1.0",
"eslint-plugin-react-refresh": "^0.4.16",
"eslint-plugin-tailwindcss": "^3.17.5",
"eslint-plugin-testing-library": "^7.1.1",
"postcss": "^8.4.49",
"prettier": "^3.4.2",
"rimraf": "^6.0.1",
"tailwindcss": "^3.4.16",
"typescript": "^5"
}
}
2 changes: 1 addition & 1 deletion src/app/globals.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@tailwind utilities;
22 changes: 11 additions & 11 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import type { Metadata } from "next";
import localFont from "next/font/local";
import "./globals.css";
import type { Metadata } from 'next';
import localFont from 'next/font/local';
import './globals.css';

const geistSans = localFont({
src: "./fonts/GeistVF.woff",
variable: "--font-geist-sans",
weight: "100 900",
src: './fonts/GeistVF.woff',
variable: '--font-geist-sans',
weight: '100 900',
});
const geistMono = localFont({
src: "./fonts/GeistMonoVF.woff",
variable: "--font-geist-mono",
weight: "100 900",
src: './fonts/GeistMonoVF.woff',
variable: '--font-geist-mono',
weight: '100 900',
});

export const metadata: Metadata = {
title: "PlanifETS",
description: "Plan and organize your university courses across sessions",
title: 'PlanifETS',
description: 'Plan and organize your university courses across sessions',
};

export default function RootLayout({
Expand Down
1 change: 0 additions & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

export default function Home() {
return (
<div className="">
Expand Down
Loading

0 comments on commit 84d6c95

Please sign in to comment.