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

feature/gist 87 config prettier eslint add them on husky #36

Merged
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: 0 additions & 3 deletions .eslintrc.json

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/mr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Pull request tests
on:
pull_request:
branches:
- main

jobs:
lint:
name: Test linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: "lts/*"
- name: Install dependencies
run: |
npm install -g pnpm
pnpm install --frozen-lockfile
- name: Test lint
run: |
pnpm lint
- name: Test prettier
run: |
pnpm prettier
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
pnpm lint
pnpm prettier
pnpm build
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore artifacts:
build
coverage
node_modules
pnpm-lock.yaml
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"trailingComma": "es5",
"printWidth": 120,
"tabWidth": 2,
"semi": false,
"singleQuote": false
}
2 changes: 1 addition & 1 deletion components.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
"components": "@/components",
"utils": "@/lib/utils"
}
}
}
35 changes: 35 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import eslintConfigPrettier from "eslint-config-prettier"
import nextPlugin from "@next/eslint-plugin-next"
import tsPlugin from "@typescript-eslint/eslint-plugin"
import tsParser from "@typescript-eslint/parser"

export default [
{
ignores: ["node_modules/**", "dist/**", ".next/**", "out/**"],
},
{
files: ["**/*.{ts,tsx}"],
plugins: {
"@typescript-eslint": tsPlugin,
"@next/next": nextPlugin,
},
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
},
rules: {
// Avertissement pour les 'any'
"@typescript-eslint/no-explicit-any": "warn",

// Avertissement pour les imports/variables non utilisés
"@typescript-eslint/no-unused-vars": "warn",

// Avertissement pour les types implicites qui pourraient être 'any'
"@typescript-eslint/no-inferrable-types": "warn",
},
},
eslintConfigPrettier,
]
4 changes: 2 additions & 2 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
output: "standalone",
};
}

export default nextConfig;
export default nextConfig
21 changes: 16 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"lint": "npx eslint .",
"prettier": "prettier --check .",
"prettier:format": "prettier --write .",
"prepare": "husky"
},
"dependencies": {
Expand All @@ -29,7 +31,7 @@
"gsap": "^3.12.5",
"input-otp": "^1.2.4",
"ky": "^1.7.2",
"lucide-react": "^0.419.0",
"lucide-react": "^0.456.0",
"next": "14.2.10",
"next-themes": "^0.3.0",
"react": "^18.3.1",
Expand All @@ -42,15 +44,24 @@
},
"devDependencies": {
"@codedependant/semantic-release-docker": "^5.0.3",
"@eslint/js": "^9.14.0",
"@iconify/react": "^5.0.2",
"@types/node": "^20.16.10",
"@types/node": "^22.9.0",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.0",
"eslint": "^8.57.1",
"@typescript-eslint/eslint-plugin": "^8.13.0",
"@typescript-eslint/parser": "^8.13.0",
"eslint": "^9.14.0",
"eslint-config-next": "14.2.5",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.37.2",
"globals": "^15.12.0",
"husky": "^9.1.6",
"postcss": "^8.4.47",
"prettier": "3.3.3",
"tailwindcss": "^3.4.13",
"typescript": "^5.6.2"
"typescript": "^5.6.2",
"typescript-eslint": "^8.13.0"
}
}
Loading
Loading