Skip to content
Draft
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
49 changes: 49 additions & 0 deletions .taskfiles/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,55 @@ tasks:
- task: format
- task: lint:fix

# ------------------------------------------------------------
# OSS oxc toolchain (oxlint + oxfmt) - evaluation
# Runs in parallel with the ESLint/Prettier tasks above so the
# two toolchains can be benchmarked head-to-head before any swap.
# Config: frontend/oxlint.config.ts, frontend/.oxfmtrc.json
# ------------------------------------------------------------

lint:oxlint:
desc: "Run oxlint linting"
deps: [install]
cmds:
- npx oxlint --max-warnings=0

lint:oxlint:type-aware:
desc: "Run oxlint linting including type-aware rules"
deps: [install]
cmds:
- npx oxlint --type-aware --max-warnings=0

lint:oxlint:fix:
desc: "Auto-fix lint issues with oxlint"
deps: [install]
cmds:
- npx oxlint --fix

format:oxfmt:
desc: "Auto-fix code formatting with oxfmt"
deps: [install]
cmds:
- npx oxfmt --write .

format:oxfmt:check:
desc: "Check code formatting with oxfmt"
deps: [install]
cmds:
- npx oxfmt --check .

bench:lint:
desc: "Time ESLint against oxlint on the same tree"
deps: [install]
cmds:
- bash -c 'echo "=== ESLint ===" && time npx eslint --max-warnings=0 || true; echo; echo "=== oxlint ===" && time npx oxlint --max-warnings=0 || true'

bench:format:
desc: "Time Prettier against oxfmt on the same tree"
deps: [install]
cmds:
- bash -c 'echo "=== Prettier ===" && time npx prettier --check . || true; echo; echo "=== oxfmt ===" && time npx oxfmt --check . || true'

typecheck:
desc: "Typecheck default build of the app"
cmds:
Expand Down
30 changes: 30 additions & 0 deletions frontend/.oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"endOfLine": "lf",
"sortPackageJson": false,
"ignorePatterns": [
"dist/",
"dist-portal/",
"editor/dist/",
"editor/src-tauri/**/target/",
"editor/src-tauri/gen/",
"node_modules/",
"editor/public/vendor/",
"portal/public/mockServiceWorker.js",
"editor/public/pdfjs*/",
"editor/public/js/thirdParty/",
"editor/public/css/cookieconsent.css",
"storybook-static/",
"playwright-report/",
"editor/playwright-report/",
"test-results/",
"editor/test-results/",
"*.min.*",
"*.md",
"*.wxs",
"editor/src/output.css"
]
}
5 changes: 2 additions & 3 deletions frontend/editor/src/core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"baseUrl": "../../",
"paths": {
"@app/*": ["src/core/*"],
"@shared/*": ["../shared/*"]
"@app/*": ["./*"],
"@shared/*": ["../../../shared/*"]
}
},
"include": ["../global.d.ts", "../*.js", "../*.ts", "../*.tsx", "."]
Expand Down
9 changes: 4 additions & 5 deletions frontend/editor/src/desktop/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"baseUrl": "../../",
"paths": {
"@app/*": ["src/desktop/*", "src/proprietary/*", "src/core/*"],
"@proprietary/*": ["src/proprietary/*"],
"@core/*": ["src/core/*"],
"@shared/*": ["../shared/*"]
"@app/*": ["./*", "../proprietary/*", "../core/*"],
"@proprietary/*": ["../proprietary/*"],
"@core/*": ["../core/*"],
"@shared/*": ["../../../shared/*"]
}
},
"include": [
Expand Down
7 changes: 3 additions & 4 deletions frontend/editor/src/proprietary/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"baseUrl": "../../",
"paths": {
"@app/*": ["src/proprietary/*", "src/core/*"],
"@core/*": ["src/core/*"],
"@shared/*": ["../shared/*"]
"@app/*": ["./*", "../core/*"],
"@core/*": ["../core/*"],
"@shared/*": ["../../../shared/*"]
}
},
"include": [
Expand Down
9 changes: 4 additions & 5 deletions frontend/editor/src/prototypes/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"baseUrl": "../../",
"paths": {
"@app/*": ["src/prototypes/*", "src/proprietary/*", "src/core/*"],
"@proprietary/*": ["src/proprietary/*"],
"@core/*": ["src/core/*"],
"@shared/*": ["../shared/*"]
"@app/*": ["./*", "../proprietary/*", "../core/*"],
"@proprietary/*": ["../proprietary/*"],
"@core/*": ["../core/*"],
"@shared/*": ["../../../shared/*"]
}
},
"include": [
Expand Down
9 changes: 4 additions & 5 deletions frontend/editor/src/saas/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"baseUrl": "../../",
"paths": {
"@app/*": ["src/saas/*", "src/proprietary/*", "src/core/*"],
"@proprietary/*": ["src/proprietary/*"],
"@core/*": ["src/core/*"],
"@shared/*": ["../shared/*"]
"@app/*": ["./*", "../proprietary/*", "../core/*"],
"@proprietary/*": ["../proprietary/*"],
"@core/*": ["../core/*"],
"@shared/*": ["../../../shared/*"]
}
},
"include": ["../global.d.ts", "../*.js", "../*.ts", "../*.tsx", "."]
Expand Down
2 changes: 1 addition & 1 deletion frontend/editor/tsconfig.core.vite.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"paths": {
"@app/*": ["src/core/*"],
"@app/*": ["./src/core/*"],
"@shared/*": ["../shared/*"]
}
},
Expand Down
6 changes: 3 additions & 3 deletions frontend/editor/tsconfig.desktop.vite.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"extends": "./tsconfig.proprietary.vite.json",
"compilerOptions": {
"paths": {
"@app/*": ["src/desktop/*", "src/proprietary/*", "src/core/*"],
"@proprietary/*": ["src/proprietary/*"],
"@core/*": ["src/core/*"],
"@app/*": ["./src/desktop/*", "./src/proprietary/*", "./src/core/*"],
"@proprietary/*": ["./src/proprietary/*"],
"@core/*": ["./src/core/*"],
"@shared/*": ["../shared/*"]
}
},
Expand Down
7 changes: 3 additions & 4 deletions frontend/editor/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,11 @@
"module": "esnext" /* Specify what module code is generated. */,
// "rootDir": "./", /* Specify the root folder within your source files. */
"moduleResolution": "bundler" /* Specify how TypeScript looks up a file from a given module specifier. */,
"baseUrl": "./" /* Specify the base directory to resolve non-relative module names. */,
"paths": {
/* Specify a set of entries that re-map imports to additional lookup locations. */
"@app/*": ["src/desktop/*", "src/proprietary/*", "src/core/*"],
"@proprietary/*": ["src/proprietary/*"],
"@core/*": ["src/core/*"],
"@app/*": ["./src/desktop/*", "./src/proprietary/*", "./src/core/*"],
"@proprietary/*": ["./src/proprietary/*"],
"@core/*": ["./src/core/*"],
"@shared/*": ["../shared/*"]
},
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
Expand Down
6 changes: 3 additions & 3 deletions frontend/editor/tsconfig.proprietary.vite.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"paths": {
"@app/*": ["src/proprietary/*", "src/core/*"],
"@proprietary/*": ["src/proprietary/*"],
"@core/*": ["src/core/*"],
"@app/*": ["./src/proprietary/*", "./src/core/*"],
"@proprietary/*": ["./src/proprietary/*"],
"@core/*": ["./src/core/*"],
"@shared/*": ["../shared/*"]
}
},
Expand Down
6 changes: 3 additions & 3 deletions frontend/editor/tsconfig.prototypes.vite.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"extends": "./tsconfig.proprietary.vite.json",
"compilerOptions": {
"paths": {
"@app/*": ["src/prototypes/*", "src/proprietary/*", "src/core/*"],
"@proprietary/*": ["src/proprietary/*"],
"@core/*": ["src/core/*"],
"@app/*": ["./src/prototypes/*", "./src/proprietary/*", "./src/core/*"],
"@proprietary/*": ["./src/proprietary/*"],
"@core/*": ["./src/core/*"],
"@shared/*": ["../shared/*"]
}
},
Expand Down
6 changes: 3 additions & 3 deletions frontend/editor/tsconfig.saas.vite.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"paths": {
"@app/*": ["src/saas/*", "src/proprietary/*", "src/core/*"],
"@proprietary/*": ["src/proprietary/*"],
"@core/*": ["src/core/*"],
"@app/*": ["./src/saas/*", "./src/proprietary/*", "./src/core/*"],
"@proprietary/*": ["./src/proprietary/*"],
"@core/*": ["./src/core/*"],
"@shared/*": ["../shared/*"]
}
},
Expand Down
11 changes: 8 additions & 3 deletions frontend/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,7 @@ export default defineConfig(
],
},
},
// Stricter rules that not all sub-folders are conformant to yet.
// Keep this non-type-aware: `parserOptions.project`/`projectService` here OOMs
// the lint step (builds the whole TS program); tsc covers type correctness.
// Stricter rules that not all sub-folders are conformant to yet
{
files: srcGlobs,
ignores: [
Expand All @@ -160,8 +158,15 @@ export default defineConfig(
"editor/src/core/types/**/*.{js,mjs,jsx,ts,tsx}",
"editor/src/core/utils/**/*.{js,mjs,jsx,ts,tsx}",
],
languageOptions: {
parserOptions: {
project: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-unnecessary-type-assertion": "error",
},
},
// Config for browser scripts
Expand Down
Loading
Loading