Skip to content

Commit c163ad5

Browse files
committed
feat: eslint
1 parent eddf80a commit c163ad5

File tree

109 files changed

+1574
-1617
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+1574
-1617
lines changed

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm lint-staged

.npmrc

Lines changed: 59 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,68 @@
1-
# Enforce pnpm workspace behavior and allow Turbo's lifecycle hooks if scripts are disabled
2-
# This repo uses pnpm with workspaces.
1+
# ------------------------------
2+
# Core Workspace Behavior
3+
# ------------------------------
34

4-
# Prefer linking local workspace packages when available
5-
prefer-workspace-packages=true
6-
link-workspace-packages=true
7-
shared-workspace-lockfile=true
5+
# Always prefer using local workspace packages when available
6+
prefer-workspace-packages = true
87

9-
# Make peer installs smoother across the monorepo
10-
auto-install-peers=true
11-
strict-peer-dependencies=false
8+
# Symlink workspace packages instead of duplicating them
9+
link-workspace-packages = true
1210

13-
# If scripts are disabled (e.g., CI with --ignore-scripts), allowlisted packages can still run their hooks
14-
# Turbo occasionally performs postinstall tasks for optimal performance
15-
# moved to pnpm-workspace.yaml: onlyBuiltDependencies (e.g., allow turbo)
11+
# Use a single lockfile across the whole monorepo
12+
shared-workspace-lockfile = true
1613

17-
public-hoist-pattern[]=*eslint*
18-
public-hoist-pattern[]=prettier
19-
public-hoist-pattern[]=typescript
14+
# Ensure packages added from workspace save using workspace: protocol
15+
save-workspace-protocol = true
2016

21-
# Reproducible installs across CI and dev
22-
prefer-frozen-lockfile=true
2317

24-
# Prefer resolving to highest versions in monorepo to reduce duplication
25-
resolution-mode=highest
18+
# ------------------------------
19+
# Dependency Resolution
20+
# ------------------------------
2621

27-
# Speed up native module builds by caching side effects
28-
side-effects-cache=true
22+
# Choose the highest compatible version across the workspace
23+
# → reduces fragmentation & node_modules bloat
24+
resolution-mode = highest
2925

30-
# Speed up local dev by reusing local store when possible
31-
prefer-offline=true
26+
# Automatically install peer dependencies instead of forcing every package to declare them
27+
auto-install-peers = true
3228

33-
# Ensure workspace protocol is used when adding internal deps
34-
save-workspace-protocol=true
29+
# Don't break the install if peers are missing
30+
strict-peer-dependencies = false
31+
32+
33+
# ------------------------------
34+
# Performance Optimizations
35+
# ------------------------------
36+
37+
# Use cached artifacts for native modules (sharp, esbuild, etc.)
38+
side-effects-cache = true
39+
40+
# Prefer local cached packages rather than hitting network
41+
prefer-offline = true
42+
43+
# In CI, refuse to modify lockfile (prevents drift)
44+
prefer-frozen-lockfile = true
45+
46+
# Use isolated linker (best compatibility with Node ecosystem tools)
47+
node-linker = isolated
48+
49+
50+
# ------------------------------
51+
# Hoisting Strategy
52+
# ------------------------------
53+
54+
# Hoist commonly used tools to the root to prevent duplicates and speed up resolution
55+
public-hoist-pattern[] = typescript
56+
public-hoist-pattern[] = eslint
57+
public-hoist-pattern[] = *@plane/*
58+
public-hoist-pattern[] = vite
59+
public-hoist-pattern[] = turbo
60+
61+
62+
# ------------------------------
63+
# Optional - Useful Safety Toggles
64+
# ------------------------------
65+
66+
# Work around situations where packages run postinstall scripts even when disabled
67+
# Helps CI environments that use --ignore-scripts
68+
enable-pre-post-scripts = false

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm-lock.yaml

.prettierrc

Lines changed: 0 additions & 6 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ If you would like to _implement_ it, an issue with your proposal must be submitt
9191
To ensure consistency throughout the source code, please keep these rules in mind as you are working:
9292

9393
- All features or bug fixes must be tested by one or more specs (unit-tests).
94-
- We use [Eslint default rule guide](https://eslint.org/docs/rules/), with minor changes. An automated formatter is available using prettier.
94+
- We lint with [ESLint 9](https://eslint.org/docs/latest/) using the shared `eslint.config.mjs` (type-aware via `typescript-eslint`) and format with [Prettier](https://prettier.io/) using `prettier.config.cjs`.
9595

9696
## Ways to contribute
9797

@@ -187,18 +187,19 @@ Adding a new language involves several steps to ensure it integrates seamlessly
187187
Add the new language to the TLanguage type in the language definitions file:
188188

189189
```ts
190-
// packages/i18n/src/types/language.ts
191-
export type TLanguage = "en" | "fr" | "your-lang";
190+
// packages/i18n/src/types/language.ts
191+
export type TLanguage = "en" | "fr" | "your-lang";
192192
```
193193

194194
1. **Add language configuration**
195195
Include the new language in the list of supported languages:
196+
196197
```ts
197-
// packages/i18n/src/constants/language.ts
198-
export const SUPPORTED_LANGUAGES: ILanguageOption[] = [
199-
{ label: "English", value: "en" },
200-
{ label: "Your Language", value: "your-lang" }
201-
];
198+
// packages/i18n/src/constants/language.ts
199+
export const SUPPORTED_LANGUAGES: ILanguageOption[] = [
200+
{ label: "English", value: "en" },
201+
{ label: "Your Language", value: "your-lang" },
202+
];
202203
```
203204

204205
2. **Create translation files**
@@ -210,6 +211,7 @@ Adding a new language involves several steps to ensure it integrates seamlessly
210211

211212
3. **Update import logic**
212213
Modify the language import logic to include your new language:
214+
213215
```ts
214216
private importLanguageFile(language: TLanguage): Promise<any> {
215217
switch (language) {

apps/admin/.eslintignore

Lines changed: 0 additions & 14 deletions
This file was deleted.

apps/admin/.eslintrc.cjs

Lines changed: 0 additions & 18 deletions
This file was deleted.

apps/admin/.prettierrc

Lines changed: 0 additions & 6 deletions
This file was deleted.

apps/admin/package.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
"preview": "react-router build && serve -s build/client -l 3001",
1212
"start": "serve -s build/client -l 3001",
1313
"clean": "rm -rf .turbo && rm -rf .next && rm -rf node_modules && rm -rf dist && rm -rf build",
14-
"check:lint": "eslint . --max-warnings 19",
14+
"check:lint": "pnpm exec eslint . --max-warnings=485",
1515
"check:types": "react-router typegen && tsc --noEmit",
16-
"check:format": "prettier --check \"**/*.{ts,tsx,md,json,css,scss}\"",
17-
"fix:lint": "eslint . --fix",
18-
"fix:format": "prettier --write \"**/*.{ts,tsx,md,json,css,scss}\""
16+
"check:format": "pnpm exec prettier --check .",
17+
"fix:lint": "pnpm exec eslint . --fix --max-warnings=485",
18+
"fix:format": "pnpm exec prettier --write ."
1919
},
2020
"dependencies": {
2121
"@bprogress/core": "catalog:",
@@ -48,10 +48,8 @@
4848
"uuid": "catalog:"
4949
},
5050
"devDependencies": {
51-
"@plane/eslint-config": "workspace:*",
5251
"@plane/tailwind-config": "workspace:*",
5352
"@plane/typescript-config": "workspace:*",
54-
"@prettier/plugin-oxc": "0.0.4",
5553
"@react-router/dev": "catalog:",
5654
"@types/lodash-es": "catalog:",
5755
"@types/node": "catalog:",

apps/admin/postcss.config.cjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
// eslint-disable-next-line @typescript-eslint/no-require-imports
21
module.exports = require("@plane/tailwind-config/postcss.config.js");

0 commit comments

Comments
 (0)