mirror of
https://github.com/twentyhq/twenty
synced 2026-04-21 13:37:22 +00:00
Migrate from ESLint to OxLint (#18443)
## Summary Fully replaces ESLint with OxLint across the entire monorepo: - **Replaced all ESLint configs** (`eslint.config.mjs`) with OxLint configs (`.oxlintrc.json`) for every package: `twenty-front`, `twenty-server`, `twenty-emails`, `twenty-ui`, `twenty-shared`, `twenty-sdk`, `twenty-zapier`, `twenty-docs`, `twenty-website`, `twenty-apps/*`, `create-twenty-app` - **Migrated custom lint rules** from ESLint plugin format to OxLint JS plugin system (`@oxlint/plugins`), including `styled-components-prefixed-with-styled`, `no-hardcoded-colors`, `sort-css-properties-alphabetically`, `graphql-resolvers-should-be-guarded`, `rest-api-methods-should-be-guarded`, `max-consts-per-file`, and Jotai-related rules - **Migrated custom rule tests** from ESLint `RuleTester` + Jest to `oxlint/plugins-dev` `RuleTester` + Vitest - **Removed all ESLint dependencies** from `package.json` files and regenerated lockfiles - **Updated Nx targets** (`lint`, `lint:diff-with-main`, `fmt`) in `nx.json` and per-project `project.json` to use `oxlint` commands with proper `dependsOn` for plugin builds - **Updated CI workflows** (`.github/workflows/ci-*.yaml`) — no more ESLint executor - **Updated IDE setup**: replaced `dbaeumer.vscode-eslint` with `oxc.oxc-vscode` extension, configured `source.fixAll.oxc` and format-on-save with Prettier - **Replaced all `eslint-disable` comments** with `oxlint-disable` equivalents across the codebase - **Updated docs** (`twenty-docs`) to reference OxLint instead of ESLint - **Renamed** `twenty-eslint-rules` package to `twenty-oxlint-rules` ### Temporarily disabled rules (tracked in `OXLINT_MIGRATION_TODO.md`) | Rule | Package | Violations | Auto-fixable | |------|---------|-----------|-------------| | `twenty/sort-css-properties-alphabetically` | twenty-front | 578 | Yes | | `typescript/consistent-type-imports` | twenty-server | 3814 | Yes | | `twenty/max-consts-per-file` | twenty-server | 94 | No | ### Dropped plugins (no OxLint equivalent) `eslint-plugin-project-structure`, `lingui/*`, `@stylistic/*`, `import/order`, `prefer-arrow/prefer-arrow-functions`, `eslint-plugin-mdx`, `@next/eslint-plugin-next`, `eslint-plugin-storybook`, `eslint-plugin-react-refresh`. Partial coverage for `jsx-a11y` and `unused-imports`. ### Additional fixes (pre-existing issues exposed by merge) - Fixed `EmailThreadPreview.tsx` broken import from main rename (`useOpenEmailThreadInSidePanel`) - Restored truthiness guard in `getActivityTargetObjectRecords.ts` - Fixed `AgentTurnResolver` return types to match entity (virtual `fileMediaType`/`fileUrl` are resolved via `@ResolveField()`) ## Test plan - [x] `npx nx lint twenty-front` passes - [x] `npx nx lint twenty-server` passes - [x] `npx nx lint twenty-docs` passes - [x] Custom oxlint rules validated with Vitest: `npx nx test twenty-oxlint-rules` - [x] `npx nx typecheck twenty-front` passes - [x] `npx nx typecheck twenty-server` passes - [x] CI workflows trigger correctly with `dependsOn: ["twenty-oxlint-rules:build"]` - [x] IDE linting works with `oxc.oxc-vscode` extension
This commit is contained in:
parent
b421efbff7
commit
9d57bc39e5
880 changed files with 4711 additions and 9687 deletions
|
|
@ -8,7 +8,7 @@ alwaysApply: true
|
||||||
## Formatting Standards
|
## Formatting Standards
|
||||||
- **Prettier**: 2-space indentation, single quotes, trailing commas, semicolons
|
- **Prettier**: 2-space indentation, single quotes, trailing commas, semicolons
|
||||||
- **Print width**: 80 characters
|
- **Print width**: 80 characters
|
||||||
- **ESLint**: No unused imports, consistent import ordering, prefer const over let
|
- **Oxlint**: No unused imports, consistent import ordering, prefer const over let
|
||||||
|
|
||||||
## Naming Conventions
|
## Naming Conventions
|
||||||
```typescript
|
```typescript
|
||||||
|
|
|
||||||
3
.github/actions/nx-affected/action.yaml
vendored
3
.github/actions/nx-affected/action.yaml
vendored
|
|
@ -15,6 +15,9 @@ inputs:
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
|
- name: Fetch main branch for diff
|
||||||
|
shell: bash
|
||||||
|
run: git fetch origin main --depth=1
|
||||||
- name: Get last successful commit
|
- name: Get last successful commit
|
||||||
uses: nrwl/nx-set-shas@v4
|
uses: nrwl/nx-set-shas@v4
|
||||||
- name: Run affected command
|
- name: Run affected command
|
||||||
|
|
|
||||||
2
.github/workflows/changed-files.yaml
vendored
2
.github/workflows/changed-files.yaml
vendored
|
|
@ -23,7 +23,7 @@ jobs:
|
||||||
- name: Fetch custom Github Actions and base branch history
|
- name: Fetch custom Github Actions and base branch history
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 10
|
||||||
- name: Check for changed files
|
- name: Check for changed files
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: tj-actions/changed-files@v45
|
uses: tj-actions/changed-files@v45
|
||||||
|
|
|
||||||
2
.github/workflows/ci-breaking-changes.yaml
vendored
2
.github/workflows/ci-breaking-changes.yaml
vendored
|
|
@ -70,7 +70,7 @@ jobs:
|
||||||
- name: Checkout current branch
|
- name: Checkout current branch
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 10
|
||||||
|
|
||||||
- name: Try to merge main into current branch
|
- name: Try to merge main into current branch
|
||||||
id: merge_attempt
|
id: merge_attempt
|
||||||
|
|
|
||||||
2
.github/workflows/ci-create-app.yaml
vendored
2
.github/workflows/ci-create-app.yaml
vendored
|
|
@ -37,7 +37,7 @@ jobs:
|
||||||
- name: Fetch custom Github Actions and base branch history
|
- name: Fetch custom Github Actions and base branch history
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 10
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
uses: ./.github/actions/yarn-install
|
uses: ./.github/actions/yarn-install
|
||||||
- name: Build
|
- name: Build
|
||||||
|
|
|
||||||
7
.github/workflows/ci-docs.yaml
vendored
7
.github/workflows/ci-docs.yaml
vendored
|
|
@ -21,7 +21,6 @@ jobs:
|
||||||
files: |
|
files: |
|
||||||
package.json
|
package.json
|
||||||
packages/twenty-docs/**
|
packages/twenty-docs/**
|
||||||
eslint.config.mjs
|
|
||||||
|
|
||||||
docs-lint:
|
docs-lint:
|
||||||
needs: changed-files-check
|
needs: changed-files-check
|
||||||
|
|
@ -37,11 +36,11 @@ jobs:
|
||||||
- name: Fetch local actions
|
- name: Fetch local actions
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 10
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
uses: ./.github/actions/yarn-install
|
uses: ./.github/actions/yarn-install
|
||||||
|
|
||||||
- name: Docs / Lint English MDX files
|
- name: Docs / Lint
|
||||||
run: npx eslint "packages/twenty-docs/{developers,user-guide,twenty-ui,getting-started,snippets}/**/*.mdx" --max-warnings 0
|
run: npx nx lint twenty-docs
|
||||||
|
|
||||||
|
|
|
||||||
2
.github/workflows/ci-emails.yaml
vendored
2
.github/workflows/ci-emails.yaml
vendored
|
|
@ -30,7 +30,7 @@ jobs:
|
||||||
- name: Fetch custom Github Actions and base branch history
|
- name: Fetch custom Github Actions and base branch history
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 10
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
uses: ./.github/actions/yarn-install
|
uses: ./.github/actions/yarn-install
|
||||||
- name: Build twenty-emails
|
- name: Build twenty-emails
|
||||||
|
|
|
||||||
14
.github/workflows/ci-front.yaml
vendored
14
.github/workflows/ci-front.yaml
vendored
|
|
@ -53,7 +53,7 @@ jobs:
|
||||||
- name: Fetch local actions
|
- name: Fetch local actions
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 10
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
uses: ./.github/actions/yarn-install
|
uses: ./.github/actions/yarn-install
|
||||||
- name: Diagnostic disk space issue
|
- name: Diagnostic disk space issue
|
||||||
|
|
@ -82,7 +82,7 @@ jobs:
|
||||||
- name: Fetch local actions
|
- name: Fetch local actions
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 10
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
uses: ./.github/actions/yarn-install
|
uses: ./.github/actions/yarn-install
|
||||||
- name: Build dependencies
|
- name: Build dependencies
|
||||||
|
|
@ -125,7 +125,7 @@ jobs:
|
||||||
# steps:
|
# steps:
|
||||||
# - uses: actions/checkout@v4
|
# - uses: actions/checkout@v4
|
||||||
# with:
|
# with:
|
||||||
# fetch-depth: 0
|
# fetch-depth: 10
|
||||||
# - name: Install dependencies
|
# - name: Install dependencies
|
||||||
# uses: ./.github/actions/yarn-install
|
# uses: ./.github/actions/yarn-install
|
||||||
# - uses: actions/download-artifact@v4
|
# - uses: actions/download-artifact@v4
|
||||||
|
|
@ -150,7 +150,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 10
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
uses: ./.github/actions/yarn-install
|
uses: ./.github/actions/yarn-install
|
||||||
- name: Restore storybook build cache
|
- name: Restore storybook build cache
|
||||||
|
|
@ -184,7 +184,7 @@ jobs:
|
||||||
- name: Fetch custom Github Actions and base branch history
|
- name: Fetch custom Github Actions and base branch history
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 10
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
uses: ./.github/actions/yarn-install
|
uses: ./.github/actions/yarn-install
|
||||||
- name: Restore ${{ matrix.task }} cache
|
- name: Restore ${{ matrix.task }} cache
|
||||||
|
|
@ -222,7 +222,7 @@ jobs:
|
||||||
- name: Fetch custom Github Actions and base branch history
|
- name: Fetch custom Github Actions and base branch history
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 10
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
uses: ./.github/actions/yarn-install
|
uses: ./.github/actions/yarn-install
|
||||||
- name: Front / Write .env
|
- name: Front / Write .env
|
||||||
|
|
@ -268,7 +268,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 10
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: lts/*
|
node-version: lts/*
|
||||||
|
|
|
||||||
4
.github/workflows/ci-sdk.yaml
vendored
4
.github/workflows/ci-sdk.yaml
vendored
|
|
@ -35,7 +35,7 @@ jobs:
|
||||||
- name: Fetch custom Github Actions and base branch history
|
- name: Fetch custom Github Actions and base branch history
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 10
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
uses: ./.github/actions/yarn-install
|
uses: ./.github/actions/yarn-install
|
||||||
- name: Build
|
- name: Build
|
||||||
|
|
@ -78,7 +78,7 @@ jobs:
|
||||||
- name: Fetch custom Github Actions and base branch history
|
- name: Fetch custom Github Actions and base branch history
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 10
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
uses: ./.github/actions/yarn-install
|
uses: ./.github/actions/yarn-install
|
||||||
- name: Build
|
- name: Build
|
||||||
|
|
|
||||||
6
.github/workflows/ci-server.yaml
vendored
6
.github/workflows/ci-server.yaml
vendored
|
|
@ -55,7 +55,7 @@ jobs:
|
||||||
- name: Fetch custom Github Actions and base branch history
|
- name: Fetch custom Github Actions and base branch history
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 10
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
uses: ./.github/actions/yarn-install
|
uses: ./.github/actions/yarn-install
|
||||||
- name: Restore server setup
|
- name: Restore server setup
|
||||||
|
|
@ -149,7 +149,7 @@ jobs:
|
||||||
- name: Fetch custom Github Actions and base branch history
|
- name: Fetch custom Github Actions and base branch history
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 10
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
uses: ./.github/actions/yarn-install
|
uses: ./.github/actions/yarn-install
|
||||||
- name: Restore server setup
|
- name: Restore server setup
|
||||||
|
|
@ -212,7 +212,7 @@ jobs:
|
||||||
- name: Fetch custom Github Actions and base branch history
|
- name: Fetch custom Github Actions and base branch history
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 10
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
uses: ./.github/actions/yarn-install
|
uses: ./.github/actions/yarn-install
|
||||||
- name: Update .env.test for integrations tests
|
- name: Update .env.test for integrations tests
|
||||||
|
|
|
||||||
4
.github/workflows/ci-shared.yaml
vendored
4
.github/workflows/ci-shared.yaml
vendored
|
|
@ -36,13 +36,13 @@ jobs:
|
||||||
- name: Fetch custom Github Actions and base branch history
|
- name: Fetch custom Github Actions and base branch history
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 10
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
uses: ./.github/actions/yarn-install
|
uses: ./.github/actions/yarn-install
|
||||||
- name: Run ${{ matrix.task }} task
|
- name: Run ${{ matrix.task }} task
|
||||||
uses: ./.github/actions/nx-affected
|
uses: ./.github/actions/nx-affected
|
||||||
with:
|
with:
|
||||||
tag: scope:frontend
|
tag: scope:shared
|
||||||
tasks: ${{ matrix.task }}
|
tasks: ${{ matrix.task }}
|
||||||
ci-shared-status-check:
|
ci-shared-status-check:
|
||||||
if: always() && !cancelled()
|
if: always() && !cancelled()
|
||||||
|
|
|
||||||
2
.github/workflows/ci-website.yaml
vendored
2
.github/workflows/ci-website.yaml
vendored
|
|
@ -42,7 +42,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 10
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
uses: ./.github/actions/yarn-install
|
uses: ./.github/actions/yarn-install
|
||||||
|
|
|
||||||
4
.github/workflows/ci-zapier.yaml
vendored
4
.github/workflows/ci-zapier.yaml
vendored
|
|
@ -52,7 +52,7 @@ jobs:
|
||||||
- name: Fetch custom Github Actions and base branch history
|
- name: Fetch custom Github Actions and base branch history
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 10
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
uses: ./.github/actions/yarn-install
|
uses: ./.github/actions/yarn-install
|
||||||
|
|
||||||
|
|
@ -107,7 +107,7 @@ jobs:
|
||||||
- name: Fetch custom Github Actions and base branch history
|
- name: Fetch custom Github Actions and base branch history
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 10
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
uses: ./.github/actions/yarn-install
|
uses: ./.github/actions/yarn-install
|
||||||
- name: Build
|
- name: Build
|
||||||
|
|
|
||||||
2
.github/workflows/claude.yml
vendored
2
.github/workflows/claude.yml
vendored
|
|
@ -164,4 +164,4 @@ jobs:
|
||||||
token: ${{ secrets.CI_PRIVILEGED_DISPATCH_TOKEN }}
|
token: ${{ secrets.CI_PRIVILEGED_DISPATCH_TOKEN }}
|
||||||
repository: twentyhq/ci-privileged
|
repository: twentyhq/ci-privileged
|
||||||
event-type: claude-cross-repo-response
|
event-type: claude-cross-repo-response
|
||||||
client-payload: '{"repo": ${{ toJSON(steps.prompt.outputs.repo) }}, "issue_number": ${{ toJSON(steps.prompt.outputs.issue_number) }}, "run_id": ${{ toJSON(github.run_id) }}, "run_url": ${{ toJSON(format('{0}/{1}/actions/runs/{2}', github.server_url, github.repository, github.run_id)) }}}'
|
client-payload: '{"repo": ${{ toJSON(steps.prompt.outputs.repo) }}, "issue_number": ${{ toJSON(steps.prompt.outputs.issue_number) }}, "run_id": ${{ toJSON(github.run_id) }}, "run_url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}'
|
||||||
|
|
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -28,7 +28,7 @@ coverage
|
||||||
dist
|
dist
|
||||||
storybook-static
|
storybook-static
|
||||||
*.tsbuildinfo
|
*.tsbuildinfo
|
||||||
.eslintcache
|
.oxlintcache
|
||||||
.nyc_output
|
.nyc_output
|
||||||
test-results/
|
test-results/
|
||||||
dump.rdb
|
dump.rdb
|
||||||
|
|
|
||||||
2
.vscode/extensions.json
vendored
2
.vscode/extensions.json
vendored
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"recommendations": [
|
"recommendations": [
|
||||||
"arcanis.vscode-zipfs",
|
"arcanis.vscode-zipfs",
|
||||||
"dbaeumer.vscode-eslint",
|
"oxc.oxc-vscode",
|
||||||
"esbenp.prettier-vscode",
|
"esbenp.prettier-vscode",
|
||||||
"figma.figma-vscode-extension",
|
"figma.figma-vscode-extension",
|
||||||
"firsttris.vscode-jest-runner",
|
"firsttris.vscode-jest-runner",
|
||||||
|
|
|
||||||
18
.vscode/settings.json
vendored
18
.vscode/settings.json
vendored
|
|
@ -4,25 +4,28 @@
|
||||||
"files.insertFinalNewline": true,
|
"files.insertFinalNewline": true,
|
||||||
"files.trimTrailingWhitespace": true,
|
"files.trimTrailingWhitespace": true,
|
||||||
"[typescript]": {
|
"[typescript]": {
|
||||||
"editor.formatOnSave": false,
|
"editor.formatOnSave": true,
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||||
"editor.codeActionsOnSave": {
|
"editor.codeActionsOnSave": {
|
||||||
"source.fixAll.eslint": "explicit",
|
"source.fixAll.oxc": "explicit",
|
||||||
"source.addMissingImports": "always",
|
"source.addMissingImports": "always",
|
||||||
"source.organizeImports": "always"
|
"source.organizeImports": "always"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"[javascript]": {
|
"[javascript]": {
|
||||||
"editor.formatOnSave": false,
|
"editor.formatOnSave": true,
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||||
"editor.codeActionsOnSave": {
|
"editor.codeActionsOnSave": {
|
||||||
"source.fixAll.eslint": "explicit",
|
"source.fixAll.oxc": "explicit",
|
||||||
"source.addMissingImports": "always",
|
"source.addMissingImports": "always",
|
||||||
"source.organizeImports": "always"
|
"source.organizeImports": "always"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"[typescriptreact]": {
|
"[typescriptreact]": {
|
||||||
"editor.formatOnSave": false,
|
"editor.formatOnSave": true,
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||||
"editor.codeActionsOnSave": {
|
"editor.codeActionsOnSave": {
|
||||||
"source.fixAll.eslint": "explicit",
|
"source.fixAll.oxc": "explicit",
|
||||||
"source.addMissingImports": "always",
|
"source.addMissingImports": "always",
|
||||||
"source.organizeImports": "always"
|
"source.organizeImports": "always"
|
||||||
}
|
}
|
||||||
|
|
@ -48,8 +51,7 @@
|
||||||
"search.exclude": {
|
"search.exclude": {
|
||||||
"**/.yarn": true
|
"**/.yarn": true
|
||||||
},
|
},
|
||||||
"eslint.useFlatConfig": true,
|
"oxc.lint.enable": true,
|
||||||
"eslint.debug": true,
|
|
||||||
"files.associations": {
|
"files.associations": {
|
||||||
".cursorrules": "markdown"
|
".cursorrules": "markdown"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
22
.vscode/twenty.code-workspace
vendored
22
.vscode/twenty.code-workspace
vendored
|
|
@ -37,8 +37,8 @@
|
||||||
"path": "../packages/twenty-zapier"
|
"path": "../packages/twenty-zapier"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "tools/eslint-rules",
|
"name": "packages/twenty-oxlint-rules",
|
||||||
"path": "../tools/eslint-rules"
|
"path": "../packages/twenty-oxlint-rules"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "packages/twenty-e2e-testing",
|
"name": "packages/twenty-e2e-testing",
|
||||||
|
|
@ -49,23 +49,26 @@
|
||||||
"editor.formatOnSave": false,
|
"editor.formatOnSave": false,
|
||||||
"files.eol": "auto",
|
"files.eol": "auto",
|
||||||
"[typescript]": {
|
"[typescript]": {
|
||||||
"editor.formatOnSave": false,
|
"editor.formatOnSave": true,
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||||
"editor.codeActionsOnSave": {
|
"editor.codeActionsOnSave": {
|
||||||
"source.fixAll.eslint": "explicit",
|
"source.fixAll.oxc": "explicit",
|
||||||
"source.addMissingImports": "always"
|
"source.addMissingImports": "always"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"[javascript]": {
|
"[javascript]": {
|
||||||
"editor.formatOnSave": false,
|
"editor.formatOnSave": true,
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||||
"editor.codeActionsOnSave": {
|
"editor.codeActionsOnSave": {
|
||||||
"source.fixAll.eslint": "explicit",
|
"source.fixAll.oxc": "explicit",
|
||||||
"source.addMissingImports": "always"
|
"source.addMissingImports": "always"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"[typescriptreact]": {
|
"[typescriptreact]": {
|
||||||
"editor.formatOnSave": false,
|
"editor.formatOnSave": true,
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||||
"editor.codeActionsOnSave": {
|
"editor.codeActionsOnSave": {
|
||||||
"source.fixAll.eslint": "explicit",
|
"source.fixAll.oxc": "explicit",
|
||||||
"source.addMissingImports": "always"
|
"source.addMissingImports": "always"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -88,7 +91,7 @@
|
||||||
"typescript.preferences.importModuleSpecifier": "non-relative",
|
"typescript.preferences.importModuleSpecifier": "non-relative",
|
||||||
"[javascript][typescript][typescriptreact]": {
|
"[javascript][typescript][typescriptreact]": {
|
||||||
"editor.codeActionsOnSave": {
|
"editor.codeActionsOnSave": {
|
||||||
"source.fixAll.eslint": "explicit",
|
"source.fixAll.oxc": "explicit",
|
||||||
"source.addMissingImports": "always"
|
"source.addMissingImports": "always"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -98,6 +101,7 @@
|
||||||
"files.exclude": {
|
"files.exclude": {
|
||||||
"packages/": true
|
"packages/": true
|
||||||
},
|
},
|
||||||
|
"oxc.lint.enable": true,
|
||||||
"jest.runMode": "on-demand",
|
"jest.runMode": "on-demand",
|
||||||
"jest.disabledWorkspaceFolders": [
|
"jest.disabledWorkspaceFolders": [
|
||||||
"ROOT",
|
"ROOT",
|
||||||
|
|
|
||||||
|
|
@ -1,226 +0,0 @@
|
||||||
import js from '@eslint/js';
|
|
||||||
import nxPlugin from '@nx/eslint-plugin';
|
|
||||||
import typescriptEslint from '@typescript-eslint/eslint-plugin';
|
|
||||||
import typescriptParser from '@typescript-eslint/parser';
|
|
||||||
import importPlugin from 'eslint-plugin-import';
|
|
||||||
import linguiPlugin from 'eslint-plugin-lingui';
|
|
||||||
import * as mdxPlugin from 'eslint-plugin-mdx';
|
|
||||||
import preferArrowPlugin from 'eslint-plugin-prefer-arrow';
|
|
||||||
import prettierPlugin from 'eslint-plugin-prettier';
|
|
||||||
import unicornPlugin from 'eslint-plugin-unicorn';
|
|
||||||
import unusedImportsPlugin from 'eslint-plugin-unused-imports';
|
|
||||||
import jsoncParser from 'jsonc-eslint-parser';
|
|
||||||
|
|
||||||
const twentyRules = await nxPlugin.loadWorkspaceRules(
|
|
||||||
'packages/twenty-eslint-rules',
|
|
||||||
);
|
|
||||||
|
|
||||||
export default [
|
|
||||||
// Base JavaScript configuration
|
|
||||||
js.configs.recommended,
|
|
||||||
|
|
||||||
// Lingui recommended rules
|
|
||||||
linguiPlugin.configs['flat/recommended'],
|
|
||||||
|
|
||||||
// Global ignores
|
|
||||||
{
|
|
||||||
ignores: ['**/node_modules/**'],
|
|
||||||
},
|
|
||||||
|
|
||||||
// Base configuration for all files
|
|
||||||
{
|
|
||||||
files: ['**/*.{js,jsx,ts,tsx}'],
|
|
||||||
plugins: {
|
|
||||||
prettier: prettierPlugin,
|
|
||||||
lingui: linguiPlugin,
|
|
||||||
'@nx': nxPlugin,
|
|
||||||
'prefer-arrow': preferArrowPlugin,
|
|
||||||
import: importPlugin,
|
|
||||||
'unused-imports': unusedImportsPlugin,
|
|
||||||
unicorn: unicornPlugin,
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
// General rules
|
|
||||||
'func-style': ['error', 'declaration', { allowArrowFunctions: true }],
|
|
||||||
'no-console': [
|
|
||||||
'warn',
|
|
||||||
{ allow: ['group', 'groupCollapsed', 'groupEnd'] },
|
|
||||||
],
|
|
||||||
'no-control-regex': 0,
|
|
||||||
'no-debugger': 'error',
|
|
||||||
'no-duplicate-imports': 'error',
|
|
||||||
'no-undef': 'off',
|
|
||||||
'no-unused-vars': 'off',
|
|
||||||
|
|
||||||
// Nx rules
|
|
||||||
'@nx/enforce-module-boundaries': [
|
|
||||||
'error',
|
|
||||||
{
|
|
||||||
enforceBuildableLibDependency: true,
|
|
||||||
allow: [],
|
|
||||||
depConstraints: [
|
|
||||||
{
|
|
||||||
sourceTag: 'scope:apps',
|
|
||||||
onlyDependOnLibsWithTags: ['scope:apps', 'scope:sdk'],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourceTag: 'scope:sdk',
|
|
||||||
onlyDependOnLibsWithTags: ['scope:sdk', 'scope:shared'],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourceTag: 'scope:create-app',
|
|
||||||
onlyDependOnLibsWithTags: ['scope:create-app', 'scope:shared'],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourceTag: 'scope:shared',
|
|
||||||
onlyDependOnLibsWithTags: ['scope:shared'],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourceTag: 'scope:backend',
|
|
||||||
onlyDependOnLibsWithTags: ['scope:shared', 'scope:backend'],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourceTag: 'scope:frontend',
|
|
||||||
onlyDependOnLibsWithTags: ['scope:shared', 'scope:frontend'],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourceTag: 'scope:zapier',
|
|
||||||
onlyDependOnLibsWithTags: ['scope:shared', 'scope:zapier'],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
|
|
||||||
// Import rules
|
|
||||||
'import/no-relative-packages': 'error',
|
|
||||||
'import/no-useless-path-segments': 'error',
|
|
||||||
'import/no-duplicates': ['error', { considerQueryString: true }],
|
|
||||||
|
|
||||||
// Prefer arrow functions
|
|
||||||
'prefer-arrow/prefer-arrow-functions': [
|
|
||||||
'error',
|
|
||||||
{
|
|
||||||
disallowPrototype: true,
|
|
||||||
singleReturnOnly: false,
|
|
||||||
classPropertiesAllowed: false,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
|
|
||||||
// Unused imports
|
|
||||||
'unused-imports/no-unused-imports': 'warn',
|
|
||||||
'unused-imports/no-unused-vars': [
|
|
||||||
'warn',
|
|
||||||
{
|
|
||||||
vars: 'all',
|
|
||||||
varsIgnorePattern: '^_',
|
|
||||||
args: 'after-used',
|
|
||||||
argsIgnorePattern: '^_',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
// TypeScript specific configuration
|
|
||||||
{
|
|
||||||
files: ['**/*.{ts,tsx}'],
|
|
||||||
languageOptions: {
|
|
||||||
parser: typescriptParser,
|
|
||||||
parserOptions: {
|
|
||||||
ecmaFeatures: {
|
|
||||||
jsx: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
plugins: {
|
|
||||||
'@typescript-eslint': typescriptEslint,
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
// TypeScript rules
|
|
||||||
'no-redeclare': 'off', // Turn off base rule for TypeScript
|
|
||||||
'@typescript-eslint/no-redeclare': 'error', // Use TypeScript-aware version
|
|
||||||
'@typescript-eslint/ban-ts-comment': 'error',
|
|
||||||
'@typescript-eslint/consistent-type-imports': [
|
|
||||||
'error',
|
|
||||||
{
|
|
||||||
prefer: 'type-imports',
|
|
||||||
fixStyle: 'inline-type-imports',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
||||||
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
||||||
'@typescript-eslint/interface-name-prefix': 'off',
|
|
||||||
'@typescript-eslint/no-empty-object-type': [
|
|
||||||
'error',
|
|
||||||
{
|
|
||||||
allowInterfaces: 'with-single-extends',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
'@typescript-eslint/no-explicit-any': 'off',
|
|
||||||
'@typescript-eslint/no-empty-function': 'off',
|
|
||||||
'@typescript-eslint/no-unused-vars': 'off',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
// JavaScript specific configuration
|
|
||||||
{
|
|
||||||
files: ['*.{js,jsx}'],
|
|
||||||
rules: {
|
|
||||||
// JavaScript-specific rules if needed
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
// Test files
|
|
||||||
{
|
|
||||||
files: [
|
|
||||||
'*.spec.@(ts|tsx|js|jsx)',
|
|
||||||
'*.integration-spec.@(ts|tsx|js|jsx)',
|
|
||||||
'*.test.@(ts|tsx|js|jsx)',
|
|
||||||
],
|
|
||||||
languageOptions: {
|
|
||||||
globals: {
|
|
||||||
jest: true,
|
|
||||||
describe: true,
|
|
||||||
it: true,
|
|
||||||
expect: true,
|
|
||||||
beforeEach: true,
|
|
||||||
afterEach: true,
|
|
||||||
beforeAll: true,
|
|
||||||
afterAll: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
// JSON files
|
|
||||||
{
|
|
||||||
files: ['**/*.json'],
|
|
||||||
languageOptions: {
|
|
||||||
parser: jsoncParser,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
// MDX files
|
|
||||||
{
|
|
||||||
...mdxPlugin.flat,
|
|
||||||
plugins: {
|
|
||||||
...mdxPlugin.flat.plugins,
|
|
||||||
'@nx': nxPlugin,
|
|
||||||
twenty: { rules: twentyRules },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mdxPlugin.flatCodeBlocks,
|
|
||||||
{
|
|
||||||
files: ['**/*.mdx'],
|
|
||||||
rules: {
|
|
||||||
'no-unused-vars': 'off',
|
|
||||||
'unused-imports/no-unused-imports': 'off',
|
|
||||||
'unused-imports/no-unused-vars': 'off',
|
|
||||||
// Enforce JSX tags on separate lines to prevent Crowdin translation issues
|
|
||||||
'twenty/mdx-component-newlines': 'error',
|
|
||||||
// Disallow angle bracket placeholders to prevent Crowdin translation errors
|
|
||||||
'twenty/no-angle-bracket-placeholders': 'error',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
];
|
|
||||||
30
nx.json
30
nx.json
|
|
@ -40,34 +40,30 @@
|
||||||
"dependsOn": ["^build"]
|
"dependsOn": ["^build"]
|
||||||
},
|
},
|
||||||
"lint": {
|
"lint": {
|
||||||
"executor": "@nx/eslint:lint",
|
"executor": "nx:run-commands",
|
||||||
"cache": true,
|
"cache": true,
|
||||||
"outputs": ["{options.outputFile}"],
|
|
||||||
"options": {
|
"options": {
|
||||||
"eslintConfig": "{projectRoot}/eslint.config.mjs",
|
"cwd": "{projectRoot}",
|
||||||
"cache": true,
|
"command": "npx oxlint -c .oxlintrc.json ."
|
||||||
"cacheLocation": "{workspaceRoot}/.cache/eslint"
|
|
||||||
},
|
},
|
||||||
"configurations": {
|
"configurations": {
|
||||||
"ci": {
|
"ci": {},
|
||||||
"cacheStrategy": "content"
|
|
||||||
},
|
|
||||||
"fix": {
|
"fix": {
|
||||||
"fix": true
|
"command": "npx oxlint --fix -c .oxlintrc.json ."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependsOn": ["^build"]
|
"dependsOn": ["^build", "twenty-oxlint-rules:build"]
|
||||||
},
|
},
|
||||||
"lint:diff-with-main": {
|
"lint:diff-with-main": {
|
||||||
"executor": "nx:run-commands",
|
"executor": "nx:run-commands",
|
||||||
"cache": false,
|
"cache": false,
|
||||||
"options": {
|
"options": {
|
||||||
"command": "git diff --name-only --diff-filter=d main | grep -E '{args.pattern}' | grep '^{projectRoot}/' | xargs sh -c 'if [ $# -gt 0 ]; then npx eslint --config {projectRoot}/eslint.config.mjs \"$@\"; fi' _",
|
"command": "FILES=$(git diff --name-only --diff-filter=d main -- {projectRoot}/ | grep -E '{args.pattern}'); [ -z \"$FILES\" ] && echo 'No changed files.' || npx oxlint -c {projectRoot}/.oxlintrc.json $FILES",
|
||||||
"pattern": "\\.(ts|tsx|js|jsx)$"
|
"pattern": "\\.(ts|tsx|js|jsx)$"
|
||||||
},
|
},
|
||||||
"configurations": {
|
"configurations": {
|
||||||
"fix": {
|
"fix": {
|
||||||
"command": "git diff --name-only --diff-filter=d main | grep -E '{args.pattern}' | grep '^{projectRoot}/' | xargs sh -c 'if [ $# -gt 0 ]; then npx eslint --config {projectRoot}/eslint.config.mjs --fix \"$@\"; fi' _"
|
"command": "FILES=$(git diff --name-only --diff-filter=d main -- {projectRoot}/ | grep -E '{args.pattern}'); [ -z \"$FILES\" ] && echo 'No changed files.' || npx oxlint --fix -c {projectRoot}/.oxlintrc.json $FILES"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -255,14 +251,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@nx/eslint:lint": {
|
|
||||||
"cache": true,
|
|
||||||
"inputs": [
|
|
||||||
"default",
|
|
||||||
"{workspaceRoot}/eslint.config.mjs",
|
|
||||||
"{workspaceRoot}/packages/twenty-eslint-rules/**/*"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"@nx/vite:build": {
|
"@nx/vite:build": {
|
||||||
"cache": true,
|
"cache": true,
|
||||||
"dependsOn": ["^build"],
|
"dependsOn": ["^build"],
|
||||||
|
|
@ -277,7 +265,6 @@
|
||||||
"@nx/react": {
|
"@nx/react": {
|
||||||
"application": {
|
"application": {
|
||||||
"style": "@linaria/react",
|
"style": "@linaria/react",
|
||||||
"linter": "eslint",
|
|
||||||
"bundler": "vite",
|
"bundler": "vite",
|
||||||
"compiler": "swc",
|
"compiler": "swc",
|
||||||
"unitTestRunner": "jest",
|
"unitTestRunner": "jest",
|
||||||
|
|
@ -285,7 +272,6 @@
|
||||||
},
|
},
|
||||||
"library": {
|
"library": {
|
||||||
"style": "@linaria/react",
|
"style": "@linaria/react",
|
||||||
"linter": "eslint",
|
|
||||||
"bundler": "vite",
|
"bundler": "vite",
|
||||||
"compiler": "swc",
|
"compiler": "swc",
|
||||||
"unitTestRunner": "jest",
|
"unitTestRunner": "jest",
|
||||||
|
|
|
||||||
25
package.json
25
package.json
|
|
@ -72,14 +72,13 @@
|
||||||
"@graphql-codegen/typescript": "^3.0.4",
|
"@graphql-codegen/typescript": "^3.0.4",
|
||||||
"@graphql-codegen/typescript-operations": "^3.0.4",
|
"@graphql-codegen/typescript-operations": "^3.0.4",
|
||||||
"@graphql-codegen/typescript-react-apollo": "^3.3.7",
|
"@graphql-codegen/typescript-react-apollo": "^3.3.7",
|
||||||
"@nx/eslint": "22.5.4",
|
|
||||||
"@nx/eslint-plugin": "22.5.4",
|
|
||||||
"@nx/jest": "22.5.4",
|
"@nx/jest": "22.5.4",
|
||||||
"@nx/js": "22.5.4",
|
"@nx/js": "22.5.4",
|
||||||
"@nx/react": "22.5.4",
|
"@nx/react": "22.5.4",
|
||||||
"@nx/storybook": "22.5.4",
|
"@nx/storybook": "22.5.4",
|
||||||
"@nx/vite": "22.5.4",
|
"@nx/vite": "22.5.4",
|
||||||
"@nx/web": "22.5.4",
|
"@nx/web": "22.5.4",
|
||||||
|
"@oxlint/plugins": "^1.51.0",
|
||||||
"@sentry/types": "^8",
|
"@sentry/types": "^8",
|
||||||
"@storybook-community/storybook-addon-cookie": "^5.0.0",
|
"@storybook-community/storybook-addon-cookie": "^5.0.0",
|
||||||
"@storybook/addon-coverage": "^3.0.0",
|
"@storybook/addon-coverage": "^3.0.0",
|
||||||
|
|
@ -89,7 +88,6 @@
|
||||||
"@storybook/icons": "^2.0.1",
|
"@storybook/icons": "^2.0.1",
|
||||||
"@storybook/react-vite": "^10.2.13",
|
"@storybook/react-vite": "^10.2.13",
|
||||||
"@storybook/test-runner": "^0.24.2",
|
"@storybook/test-runner": "^0.24.2",
|
||||||
"@stylistic/eslint-plugin": "^1.5.0",
|
|
||||||
"@swc-node/register": "^1.11.1",
|
"@swc-node/register": "^1.11.1",
|
||||||
"@swc/cli": "^0.7.10",
|
"@swc/cli": "^0.7.10",
|
||||||
"@swc/core": "^1.15.11",
|
"@swc/core": "^1.15.11",
|
||||||
|
|
@ -132,9 +130,6 @@
|
||||||
"@types/react-dom": "^18.2.15",
|
"@types/react-dom": "^18.2.15",
|
||||||
"@types/supertest": "^2.0.11",
|
"@types/supertest": "^2.0.11",
|
||||||
"@types/uuid": "^9.0.2",
|
"@types/uuid": "^9.0.2",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.39.0",
|
|
||||||
"@typescript-eslint/parser": "^8.39.0",
|
|
||||||
"@typescript-eslint/utils": "^8.39.0",
|
|
||||||
"@typescript/native-preview": "^7.0.0-dev.20260116.1",
|
"@typescript/native-preview": "^7.0.0-dev.20260116.1",
|
||||||
"@vitejs/plugin-react-swc": "4.2.3",
|
"@vitejs/plugin-react-swc": "4.2.3",
|
||||||
"@vitest/browser-playwright": "^4.0.18",
|
"@vitest/browser-playwright": "^4.0.18",
|
||||||
|
|
@ -146,22 +141,6 @@
|
||||||
"danger": "^13.0.4",
|
"danger": "^13.0.4",
|
||||||
"dotenv-cli": "^7.4.4",
|
"dotenv-cli": "^7.4.4",
|
||||||
"esbuild": "^0.25.10",
|
"esbuild": "^0.25.10",
|
||||||
"eslint": "^9.32.0",
|
|
||||||
"eslint-config-prettier": "^9.1.0",
|
|
||||||
"eslint-plugin-import": "^2.31.0",
|
|
||||||
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
||||||
"eslint-plugin-lingui": "^0.9.0",
|
|
||||||
"eslint-plugin-mdx": "^3.6.2",
|
|
||||||
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
||||||
"eslint-plugin-prettier": "^5.1.2",
|
|
||||||
"eslint-plugin-project-structure": "^3.9.1",
|
|
||||||
"eslint-plugin-react": "^7.37.2",
|
|
||||||
"eslint-plugin-react-hooks": "^5.0.0",
|
|
||||||
"eslint-plugin-react-refresh": "^0.4.4",
|
|
||||||
"eslint-plugin-simple-import-sort": "^10.0.0",
|
|
||||||
"eslint-plugin-storybook": "^10.2.13",
|
|
||||||
"eslint-plugin-unicorn": "^56.0.1",
|
|
||||||
"eslint-plugin-unused-imports": "^3.0.0",
|
|
||||||
"http-server": "^14.1.1",
|
"http-server": "^14.1.1",
|
||||||
"jest": "29.7.0",
|
"jest": "29.7.0",
|
||||||
"jest-environment-jsdom": "30.0.0-beta.3",
|
"jest-environment-jsdom": "30.0.0-beta.3",
|
||||||
|
|
@ -230,7 +209,7 @@
|
||||||
"packages/twenty-apps",
|
"packages/twenty-apps",
|
||||||
"packages/twenty-cli",
|
"packages/twenty-cli",
|
||||||
"packages/create-twenty-app",
|
"packages/create-twenty-app",
|
||||||
"packages/twenty-eslint-rules"
|
"packages/twenty-oxlint-rules"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"prettier": {
|
"prettier": {
|
||||||
|
|
|
||||||
38
packages/create-twenty-app/.oxlintrc.json
Normal file
38
packages/create-twenty-app/.oxlintrc.json
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
{
|
||||||
|
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
||||||
|
"plugins": ["typescript", "import", "unicorn"],
|
||||||
|
"categories": {
|
||||||
|
"correctness": "off"
|
||||||
|
},
|
||||||
|
"ignorePatterns": ["node_modules", "dist"],
|
||||||
|
"rules": {
|
||||||
|
"func-style": ["error", "declaration", { "allowArrowFunctions": true }],
|
||||||
|
"no-console": "off",
|
||||||
|
"no-control-regex": "off",
|
||||||
|
"no-debugger": "error",
|
||||||
|
"no-duplicate-imports": "error",
|
||||||
|
"no-undef": "off",
|
||||||
|
"no-unused-vars": "off",
|
||||||
|
"no-redeclare": "off",
|
||||||
|
"import/no-duplicates": "error",
|
||||||
|
"typescript/no-redeclare": "error",
|
||||||
|
"typescript/ban-ts-comment": "error",
|
||||||
|
"typescript/consistent-type-imports": ["error", {
|
||||||
|
"prefer": "type-imports",
|
||||||
|
"fixStyle": "inline-type-imports"
|
||||||
|
}],
|
||||||
|
"typescript/explicit-function-return-type": "off",
|
||||||
|
"typescript/explicit-module-boundary-types": "off",
|
||||||
|
"typescript/no-empty-object-type": ["error", {
|
||||||
|
"allowInterfaces": "with-single-extends"
|
||||||
|
}],
|
||||||
|
"typescript/no-empty-function": "off",
|
||||||
|
"typescript/no-explicit-any": "off",
|
||||||
|
"typescript/no-unused-vars": ["warn", {
|
||||||
|
"vars": "all",
|
||||||
|
"varsIgnorePattern": "^_",
|
||||||
|
"args": "after-used",
|
||||||
|
"argsIgnorePattern": "^_"
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -98,7 +98,7 @@ In interactive mode, you can pick from:
|
||||||
- `roles/default-role.ts` — Default role for logic functions
|
- `roles/default-role.ts` — Default role for logic functions
|
||||||
- `logic-functions/pre-install.ts` — Pre-install logic function (runs before app installation)
|
- `logic-functions/pre-install.ts` — Pre-install logic function (runs before app installation)
|
||||||
- `logic-functions/post-install.ts` — Post-install logic function (runs after app installation)
|
- `logic-functions/post-install.ts` — Post-install logic function (runs after app installation)
|
||||||
- TypeScript configuration, ESLint, package.json, .gitignore
|
- TypeScript configuration, Oxlint, package.json, .gitignore
|
||||||
- A prewired `twenty` script that delegates to the `twenty` CLI from twenty-sdk
|
- A prewired `twenty` script that delegates to the `twenty` CLI from twenty-sdk
|
||||||
|
|
||||||
**Example files (controlled by scaffolding mode):**
|
**Example files (controlled by scaffolding mode):**
|
||||||
|
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
import baseConfig from '../../eslint.config.mjs';
|
|
||||||
|
|
||||||
export default [
|
|
||||||
...baseConfig,
|
|
||||||
{
|
|
||||||
ignores: ['**/dist/**'],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
files: ['**/*.{js,jsx,ts,tsx}'],
|
|
||||||
rules: {
|
|
||||||
'prettier/prettier': 'error',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
rules: {
|
|
||||||
'no-console': 'off',
|
|
||||||
},
|
|
||||||
ignores: ['src/**/*.ts', '!src/cli/**/*.ts'],
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
@ -25,19 +25,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"typecheck": {},
|
"typecheck": {},
|
||||||
"lint": {
|
"lint": {},
|
||||||
"options": {
|
|
||||||
"lintFilePatterns": ["{projectRoot}/src/**/*.{ts,json}"],
|
|
||||||
"maxWarnings": 0
|
|
||||||
},
|
|
||||||
"configurations": {
|
|
||||||
"ci": {
|
|
||||||
"lintFilePatterns": ["{projectRoot}/src/**/*.{ts,json}"],
|
|
||||||
"maxWarnings": 0
|
|
||||||
},
|
|
||||||
"fix": {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"test": {
|
"test": {
|
||||||
"executor": "@nx/jest:jest",
|
"executor": "@nx/jest:jest",
|
||||||
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
{
|
||||||
|
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
||||||
|
"plugins": ["typescript"],
|
||||||
|
"categories": {
|
||||||
|
"correctness": "off"
|
||||||
|
},
|
||||||
|
"ignorePatterns": ["node_modules", "dist"],
|
||||||
|
"rules": {
|
||||||
|
"no-unused-vars": "off",
|
||||||
|
|
||||||
|
"typescript/no-unused-vars": ["warn", {
|
||||||
|
"argsIgnorePattern": "^_"
|
||||||
|
}],
|
||||||
|
"typescript/no-explicit-any": "off"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
import js from '@eslint/js';
|
|
||||||
import tseslint from 'typescript-eslint';
|
|
||||||
|
|
||||||
export default [
|
|
||||||
// Base JS recommended rules
|
|
||||||
js.configs.recommended,
|
|
||||||
|
|
||||||
// TypeScript recommended rules
|
|
||||||
...tseslint.configs.recommended,
|
|
||||||
|
|
||||||
{
|
|
||||||
files: ['**/*.ts', '**/*.tsx'],
|
|
||||||
languageOptions: {
|
|
||||||
parserOptions: {
|
|
||||||
project: true,
|
|
||||||
tsconfigRootDir: import.meta.dirname,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
// Common TypeScript-friendly tweaks
|
|
||||||
'@typescript-eslint/no-unused-vars': [
|
|
||||||
'warn',
|
|
||||||
{ argsIgnorePattern: '^_' },
|
|
||||||
],
|
|
||||||
'@typescript-eslint/no-explicit-any': 'off',
|
|
||||||
'no-unused-vars': 'off', // handled by TS rule
|
|
||||||
},
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
@ -553,8 +553,8 @@ const createPackageJson = async ({
|
||||||
}) => {
|
}) => {
|
||||||
const scripts: Record<string, string> = {
|
const scripts: Record<string, string> = {
|
||||||
twenty: 'twenty',
|
twenty: 'twenty',
|
||||||
lint: 'eslint',
|
lint: 'oxlint -c .oxlintrc.json .',
|
||||||
'lint:fix': 'eslint --fix',
|
'lint:fix': 'oxlint --fix -c .oxlintrc.json .',
|
||||||
};
|
};
|
||||||
|
|
||||||
const devDependencies: Record<string, string> = {
|
const devDependencies: Record<string, string> = {
|
||||||
|
|
@ -562,8 +562,7 @@ const createPackageJson = async ({
|
||||||
'@types/node': '^24.7.2',
|
'@types/node': '^24.7.2',
|
||||||
'@types/react': '^18.2.0',
|
'@types/react': '^18.2.0',
|
||||||
react: '^18.2.0',
|
react: '^18.2.0',
|
||||||
eslint: '^9.32.0',
|
oxlint: '^0.16.0',
|
||||||
'typescript-eslint': '^8.50.0',
|
|
||||||
'twenty-sdk': createTwentyAppPackageJson.version,
|
'twenty-sdk': createTwentyAppPackageJson.version,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
38
packages/twenty-apps/community/apollo-enrich/.oxlintrc.json
Normal file
38
packages/twenty-apps/community/apollo-enrich/.oxlintrc.json
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
{
|
||||||
|
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
||||||
|
"plugins": ["typescript", "import", "unicorn"],
|
||||||
|
"categories": {
|
||||||
|
"correctness": "off"
|
||||||
|
},
|
||||||
|
"ignorePatterns": ["node_modules"],
|
||||||
|
"rules": {
|
||||||
|
"func-style": ["error", "declaration", { "allowArrowFunctions": true }],
|
||||||
|
"no-console": ["warn", { "allow": ["group", "groupCollapsed", "groupEnd"] }],
|
||||||
|
"no-control-regex": "off",
|
||||||
|
"no-debugger": "error",
|
||||||
|
"no-duplicate-imports": "error",
|
||||||
|
"no-undef": "off",
|
||||||
|
"no-unused-vars": "off",
|
||||||
|
"no-redeclare": "off",
|
||||||
|
"import/no-duplicates": "error",
|
||||||
|
"typescript/no-redeclare": "error",
|
||||||
|
"typescript/ban-ts-comment": "error",
|
||||||
|
"typescript/consistent-type-imports": ["error", {
|
||||||
|
"prefer": "type-imports",
|
||||||
|
"fixStyle": "inline-type-imports"
|
||||||
|
}],
|
||||||
|
"typescript/explicit-function-return-type": "off",
|
||||||
|
"typescript/explicit-module-boundary-types": "off",
|
||||||
|
"typescript/no-empty-object-type": ["error", {
|
||||||
|
"allowInterfaces": "with-single-extends"
|
||||||
|
}],
|
||||||
|
"typescript/no-empty-function": "off",
|
||||||
|
"typescript/no-explicit-any": "off",
|
||||||
|
"typescript/no-unused-vars": ["warn", {
|
||||||
|
"vars": "all",
|
||||||
|
"varsIgnorePattern": "^_",
|
||||||
|
"args": "after-used",
|
||||||
|
"argsIgnorePattern": "^_"
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
import js from '@eslint/js';
|
|
||||||
import tseslint from 'typescript-eslint';
|
|
||||||
|
|
||||||
export default [
|
|
||||||
// Base JS recommended rules
|
|
||||||
js.configs.recommended,
|
|
||||||
|
|
||||||
// TypeScript recommended rules
|
|
||||||
...tseslint.configs.recommended,
|
|
||||||
|
|
||||||
{
|
|
||||||
files: ['**/*.ts', '**/*.tsx'],
|
|
||||||
languageOptions: {
|
|
||||||
parserOptions: {
|
|
||||||
project: true,
|
|
||||||
tsconfigRootDir: import.meta.dirname,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
// Common TypeScript-friendly tweaks
|
|
||||||
'@typescript-eslint/no-unused-vars': [
|
|
||||||
'warn',
|
|
||||||
{ argsIgnorePattern: '^_' },
|
|
||||||
],
|
|
||||||
'@typescript-eslint/no-explicit-any': 'off',
|
|
||||||
'no-unused-vars': 'off', // handled by TS rule
|
|
||||||
},
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
@ -10,8 +10,8 @@
|
||||||
"packageManager": "yarn@4.9.2",
|
"packageManager": "yarn@4.9.2",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"twenty": "twenty",
|
"twenty": "twenty",
|
||||||
"lint": "eslint",
|
"lint": "oxlint -c .oxlintrc.json .",
|
||||||
"lint:fix": "eslint --fix"
|
"lint:fix": "oxlint --fix -c .oxlintrc.json ."
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"twenty-sdk": "latest"
|
"twenty-sdk": "latest"
|
||||||
|
|
@ -19,9 +19,8 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^24.7.2",
|
"@types/node": "^24.7.2",
|
||||||
"@types/react": "^18.2.0",
|
"@types/react": "^18.2.0",
|
||||||
"eslint": "^9.32.0",
|
"oxlint": "^0.16.0",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"typescript": "^5.9.3",
|
"typescript": "^5.9.3"
|
||||||
"typescript-eslint": "^8.50.0"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
40
packages/twenty-apps/community/fireflies/.oxlintrc.json
Normal file
40
packages/twenty-apps/community/fireflies/.oxlintrc.json
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
{
|
||||||
|
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
||||||
|
"plugins": ["typescript", "import", "unicorn"],
|
||||||
|
"categories": {
|
||||||
|
"correctness": "off"
|
||||||
|
},
|
||||||
|
"ignorePatterns": ["node_modules"],
|
||||||
|
"rules": {
|
||||||
|
"func-style": ["error", "declaration", { "allowArrowFunctions": true }],
|
||||||
|
"no-console": ["warn", { "allow": ["group", "groupCollapsed", "groupEnd"] }],
|
||||||
|
"no-control-regex": "off",
|
||||||
|
"no-debugger": "error",
|
||||||
|
"no-duplicate-imports": "error",
|
||||||
|
"no-undef": "off",
|
||||||
|
"no-unused-vars": "off",
|
||||||
|
"no-redeclare": "off",
|
||||||
|
|
||||||
|
"import/no-duplicates": "error",
|
||||||
|
|
||||||
|
"typescript/no-redeclare": "error",
|
||||||
|
"typescript/ban-ts-comment": "error",
|
||||||
|
"typescript/consistent-type-imports": ["error", {
|
||||||
|
"prefer": "type-imports",
|
||||||
|
"fixStyle": "inline-type-imports"
|
||||||
|
}],
|
||||||
|
"typescript/explicit-function-return-type": "off",
|
||||||
|
"typescript/explicit-module-boundary-types": "off",
|
||||||
|
"typescript/no-empty-object-type": ["error", {
|
||||||
|
"allowInterfaces": "with-single-extends"
|
||||||
|
}],
|
||||||
|
"typescript/no-empty-function": "off",
|
||||||
|
"typescript/no-explicit-any": "off",
|
||||||
|
"typescript/no-unused-vars": ["warn", {
|
||||||
|
"vars": "all",
|
||||||
|
"varsIgnorePattern": "^_",
|
||||||
|
"args": "after-used",
|
||||||
|
"argsIgnorePattern": "^_"
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -26,21 +26,6 @@
|
||||||
"typecheck": {
|
"typecheck": {
|
||||||
"dependsOn": ["^build"]
|
"dependsOn": ["^build"]
|
||||||
},
|
},
|
||||||
"lint": {
|
"lint": {}
|
||||||
"executor": "@nx/eslint:lint",
|
|
||||||
"outputs": [
|
|
||||||
"{options.outputFile}"
|
|
||||||
],
|
|
||||||
"options": {
|
|
||||||
"lintFilePatterns": [
|
|
||||||
"packages/twenty-apps/community/fireflies/**/*.{ts,tsx,js,jsx}"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"configurations": {
|
|
||||||
"fix": {
|
|
||||||
"fix": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
* Usage: yarn setup:fields
|
* Usage: yarn setup:fields
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* eslint-disable no-console */
|
/* oxlint-disable no-console */
|
||||||
|
|
||||||
import * as dotenv from 'dotenv';
|
import * as dotenv from 'dotenv';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* eslint-disable no-console */
|
/* oxlint-disable no-console */
|
||||||
import * as dotenv from 'dotenv';
|
import * as dotenv from 'dotenv';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import { fileURLToPath } from 'url';
|
import { fileURLToPath } from 'url';
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* eslint-disable no-console */
|
/* oxlint-disable no-console */
|
||||||
import * as dotenv from 'dotenv';
|
import * as dotenv from 'dotenv';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import { fileURLToPath } from 'url';
|
import { fileURLToPath } from 'url';
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* eslint-disable no-console */
|
/* oxlint-disable no-console */
|
||||||
/**
|
/**
|
||||||
* Fetch historical Fireflies meetings and insert into Twenty.
|
* Fetch historical Fireflies meetings and insert into Twenty.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* eslint-disable no-console */
|
/* oxlint-disable no-console */
|
||||||
/**
|
/**
|
||||||
* Fetch a Fireflies meeting by ID and insert it into Twenty using the same path
|
* Fetch a Fireflies meeting by ID and insert it into Twenty using the same path
|
||||||
* as the webhook handler.
|
* as the webhook handler.
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* eslint-disable no-console */
|
/* oxlint-disable no-console */
|
||||||
/**
|
/**
|
||||||
* Test script for Fireflies webhook against local Twenty instance
|
* Test script for Fireflies webhook against local Twenty instance
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ export class AppLogger {
|
||||||
debug(message: string, ...args: unknown[]): void {
|
debug(message: string, ...args: unknown[]): void {
|
||||||
this.captureLog('debug', message, ...args);
|
this.captureLog('debug', message, ...args);
|
||||||
if (this.shouldLog('debug')) {
|
if (this.shouldLog('debug')) {
|
||||||
// eslint-disable-next-line no-console
|
// oxlint-disable-next-line no-console
|
||||||
console.log(`[${this.context}] ${message}`, ...args);
|
console.log(`[${this.context}] ${message}`, ...args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -80,7 +80,7 @@ export class AppLogger {
|
||||||
info(message: string, ...args: unknown[]): void {
|
info(message: string, ...args: unknown[]): void {
|
||||||
this.captureLog('info', message, ...args);
|
this.captureLog('info', message, ...args);
|
||||||
if (this.shouldLog('info')) {
|
if (this.shouldLog('info')) {
|
||||||
// eslint-disable-next-line no-console
|
// oxlint-disable-next-line no-console
|
||||||
console.log(`[${this.context}] ${message}`, ...args);
|
console.log(`[${this.context}] ${message}`, ...args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -88,7 +88,7 @@ export class AppLogger {
|
||||||
warn(message: string, ...args: unknown[]): void {
|
warn(message: string, ...args: unknown[]): void {
|
||||||
this.captureLog('warn', message, ...args);
|
this.captureLog('warn', message, ...args);
|
||||||
if (this.shouldLog('warn')) {
|
if (this.shouldLog('warn')) {
|
||||||
// eslint-disable-next-line no-console
|
// oxlint-disable-next-line no-console
|
||||||
console.warn(`[${this.context}] ${message}`, ...args);
|
console.warn(`[${this.context}] ${message}`, ...args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -96,7 +96,7 @@ export class AppLogger {
|
||||||
error(message: string, ...args: unknown[]): void {
|
error(message: string, ...args: unknown[]): void {
|
||||||
this.captureLog('error', message, ...args);
|
this.captureLog('error', message, ...args);
|
||||||
if (this.shouldLog('error')) {
|
if (this.shouldLog('error')) {
|
||||||
// eslint-disable-next-line no-console
|
// oxlint-disable-next-line no-console
|
||||||
console.error(`[${this.context}] ${message}`, ...args);
|
console.error(`[${this.context}] ${message}`, ...args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -104,7 +104,7 @@ export class AppLogger {
|
||||||
// For fatal errors, security issues, or data corruption - always visible
|
// For fatal errors, security issues, or data corruption - always visible
|
||||||
critical(message: string, ...args: unknown[]): void {
|
critical(message: string, ...args: unknown[]): void {
|
||||||
this.captureLog('error', `CRITICAL: ${message}`, ...args);
|
this.captureLog('error', `CRITICAL: ${message}`, ...args);
|
||||||
// eslint-disable-next-line no-console
|
// oxlint-disable-next-line no-console
|
||||||
console.error(`[${this.context}] CRITICAL: ${message}`, ...args);
|
console.error(`[${this.context}] CRITICAL: ${message}`, ...args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,54 @@
|
||||||
|
{
|
||||||
|
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
||||||
|
"plugins": ["react", "typescript", "import", "unicorn"],
|
||||||
|
"categories": {
|
||||||
|
"correctness": "off"
|
||||||
|
},
|
||||||
|
"ignorePatterns": [
|
||||||
|
"node_modules"
|
||||||
|
],
|
||||||
|
"rules": {
|
||||||
|
"func-style": ["error", "declaration", { "allowArrowFunctions": true }],
|
||||||
|
"no-console": ["warn", { "allow": ["group", "groupCollapsed", "groupEnd"] }],
|
||||||
|
"no-control-regex": "off",
|
||||||
|
"no-debugger": "error",
|
||||||
|
"no-duplicate-imports": "error",
|
||||||
|
"no-undef": "off",
|
||||||
|
"no-unused-vars": "off",
|
||||||
|
"no-redeclare": "off",
|
||||||
|
|
||||||
|
"import/no-duplicates": "error",
|
||||||
|
|
||||||
|
"react/no-unescaped-entities": "off",
|
||||||
|
"react/prop-types": "off",
|
||||||
|
"react/jsx-key": "off",
|
||||||
|
"react/display-name": "off",
|
||||||
|
"react/jsx-uses-react": "off",
|
||||||
|
"react/react-in-jsx-scope": "off",
|
||||||
|
"react/jsx-no-useless-fragment": "off",
|
||||||
|
"react/jsx-props-no-spreading": ["error", { "explicitSpread": "ignore" }],
|
||||||
|
|
||||||
|
"react-hooks/rules-of-hooks": "error",
|
||||||
|
"react-hooks/exhaustive-deps": "warn",
|
||||||
|
|
||||||
|
"typescript/no-redeclare": "error",
|
||||||
|
"typescript/ban-ts-comment": "error",
|
||||||
|
"typescript/consistent-type-imports": ["error", {
|
||||||
|
"prefer": "type-imports",
|
||||||
|
"fixStyle": "inline-type-imports"
|
||||||
|
}],
|
||||||
|
"typescript/explicit-function-return-type": "off",
|
||||||
|
"typescript/explicit-module-boundary-types": "off",
|
||||||
|
"typescript/no-empty-object-type": ["error", {
|
||||||
|
"allowInterfaces": "with-single-extends"
|
||||||
|
}],
|
||||||
|
"typescript/no-empty-function": "off",
|
||||||
|
"typescript/no-explicit-any": "off",
|
||||||
|
"typescript/no-unused-vars": ["warn", {
|
||||||
|
"vars": "all",
|
||||||
|
"varsIgnorePattern": "^_",
|
||||||
|
"args": "after-used",
|
||||||
|
"argsIgnorePattern": "^_"
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,69 +0,0 @@
|
||||||
import typescriptParser from '@typescript-eslint/parser';
|
|
||||||
import path from 'path';
|
|
||||||
import { fileURLToPath } from 'url';
|
|
||||||
import reactConfig from '../../../../twenty-eslint-rules/eslint.config.react.mjs';
|
|
||||||
|
|
||||||
const __filename = fileURLToPath(import.meta.url);
|
|
||||||
const __dirname = path.dirname(__filename);
|
|
||||||
|
|
||||||
export default [
|
|
||||||
// Extend shared React configuration
|
|
||||||
...reactConfig,
|
|
||||||
|
|
||||||
// Global ignores
|
|
||||||
{
|
|
||||||
ignores: [
|
|
||||||
'**/node_modules/**',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
|
|
||||||
// TypeScript project-specific configuration
|
|
||||||
{
|
|
||||||
files: ['**/*.{ts,tsx}'],
|
|
||||||
languageOptions: {
|
|
||||||
parser: typescriptParser,
|
|
||||||
parserOptions: {
|
|
||||||
project: [path.resolve(__dirname, 'tsconfig.*.json')],
|
|
||||||
ecmaFeatures: {
|
|
||||||
jsx: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
'@nx/enforce-module-boundaries': [
|
|
||||||
'error',
|
|
||||||
{
|
|
||||||
enforceBuildableLibDependency: true,
|
|
||||||
allow: [],
|
|
||||||
depConstraints: [
|
|
||||||
{
|
|
||||||
sourceTag: 'scope:sdk',
|
|
||||||
onlyDependOnLibsWithTags: ['scope:sdk'],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourceTag: 'scope:shared',
|
|
||||||
onlyDependOnLibsWithTags: ['scope:shared'],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourceTag: 'scope:backend',
|
|
||||||
onlyDependOnLibsWithTags: ['scope:shared', 'scope:backend'],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourceTag: 'scope:frontend',
|
|
||||||
onlyDependOnLibsWithTags: ['scope:shared', 'scope:frontend'],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourceTag: 'scope:zapier',
|
|
||||||
onlyDependOnLibsWithTags: ['scope:shared'],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sourceTag: 'scope:browser-extension',
|
|
||||||
onlyDependOnLibsWithTags: ['scope:twenty-ui', 'scope:browser-extension']
|
|
||||||
}
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
];
|
|
||||||
38
packages/twenty-apps/hello-world/.oxlintrc.json
Normal file
38
packages/twenty-apps/hello-world/.oxlintrc.json
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
{
|
||||||
|
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
||||||
|
"plugins": ["typescript", "import", "unicorn"],
|
||||||
|
"categories": {
|
||||||
|
"correctness": "off"
|
||||||
|
},
|
||||||
|
"ignorePatterns": ["node_modules"],
|
||||||
|
"rules": {
|
||||||
|
"func-style": ["error", "declaration", { "allowArrowFunctions": true }],
|
||||||
|
"no-console": ["warn", { "allow": ["group", "groupCollapsed", "groupEnd"] }],
|
||||||
|
"no-control-regex": "off",
|
||||||
|
"no-debugger": "error",
|
||||||
|
"no-duplicate-imports": "error",
|
||||||
|
"no-undef": "off",
|
||||||
|
"no-unused-vars": "off",
|
||||||
|
"no-redeclare": "off",
|
||||||
|
"import/no-duplicates": "error",
|
||||||
|
"typescript/no-redeclare": "error",
|
||||||
|
"typescript/ban-ts-comment": "error",
|
||||||
|
"typescript/consistent-type-imports": ["error", {
|
||||||
|
"prefer": "type-imports",
|
||||||
|
"fixStyle": "inline-type-imports"
|
||||||
|
}],
|
||||||
|
"typescript/explicit-function-return-type": "off",
|
||||||
|
"typescript/explicit-module-boundary-types": "off",
|
||||||
|
"typescript/no-empty-object-type": ["error", {
|
||||||
|
"allowInterfaces": "with-single-extends"
|
||||||
|
}],
|
||||||
|
"typescript/no-empty-function": "off",
|
||||||
|
"typescript/no-explicit-any": "off",
|
||||||
|
"typescript/no-unused-vars": ["warn", {
|
||||||
|
"vars": "all",
|
||||||
|
"varsIgnorePattern": "^_",
|
||||||
|
"args": "after-used",
|
||||||
|
"argsIgnorePattern": "^_"
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
import js from '@eslint/js';
|
|
||||||
import tseslint from 'typescript-eslint';
|
|
||||||
|
|
||||||
export default [
|
|
||||||
// Base JS recommended rules
|
|
||||||
js.configs.recommended,
|
|
||||||
|
|
||||||
// TypeScript recommended rules
|
|
||||||
...tseslint.configs.recommended,
|
|
||||||
|
|
||||||
{
|
|
||||||
files: ['**/*.ts', '**/*.tsx'],
|
|
||||||
languageOptions: {
|
|
||||||
parserOptions: {
|
|
||||||
project: true,
|
|
||||||
tsconfigRootDir: import.meta.dirname,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
// Common TypeScript-friendly tweaks
|
|
||||||
'@typescript-eslint/no-unused-vars': [
|
|
||||||
'warn',
|
|
||||||
{ argsIgnorePattern: '^_' },
|
|
||||||
],
|
|
||||||
'@typescript-eslint/no-explicit-any': 'off',
|
|
||||||
'no-unused-vars': 'off', // handled by TS rule
|
|
||||||
},
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
@ -10,19 +10,18 @@
|
||||||
"packageManager": "yarn@4.9.2",
|
"packageManager": "yarn@4.9.2",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"twenty": "twenty",
|
"twenty": "twenty",
|
||||||
"lint": "eslint",
|
"lint": "oxlint -c .oxlintrc.json .",
|
||||||
"lint:fix": "eslint --fix",
|
"lint:fix": "oxlint --fix -c .oxlintrc.json .",
|
||||||
"test": "vitest run",
|
"test": "vitest run",
|
||||||
"test:watch": "vitest"
|
"test:watch": "vitest"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^24.7.2",
|
"@types/node": "^24.7.2",
|
||||||
"@types/react": "^18.2.0",
|
"@types/react": "^18.2.0",
|
||||||
"eslint": "^9.32.0",
|
"oxlint": "^0.16.0",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"twenty-sdk": "0.6.3",
|
"twenty-sdk": "0.6.3",
|
||||||
"typescript": "^5.9.3",
|
"typescript": "^5.9.3",
|
||||||
"typescript-eslint": "^8.50.0",
|
|
||||||
"vite-tsconfig-paths": "^4.2.1",
|
"vite-tsconfig-paths": "^4.2.1",
|
||||||
"vitest": "^3.1.1"
|
"vitest": "^3.1.1"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
38
packages/twenty-apps/internal/call-recording/.oxlintrc.json
Normal file
38
packages/twenty-apps/internal/call-recording/.oxlintrc.json
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
{
|
||||||
|
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
||||||
|
"plugins": ["typescript", "import", "unicorn"],
|
||||||
|
"categories": {
|
||||||
|
"correctness": "off"
|
||||||
|
},
|
||||||
|
"ignorePatterns": ["node_modules"],
|
||||||
|
"rules": {
|
||||||
|
"func-style": ["error", "declaration", { "allowArrowFunctions": true }],
|
||||||
|
"no-console": ["warn", { "allow": ["group", "groupCollapsed", "groupEnd"] }],
|
||||||
|
"no-control-regex": "off",
|
||||||
|
"no-debugger": "error",
|
||||||
|
"no-duplicate-imports": "error",
|
||||||
|
"no-undef": "off",
|
||||||
|
"no-unused-vars": "off",
|
||||||
|
"no-redeclare": "off",
|
||||||
|
"import/no-duplicates": "error",
|
||||||
|
"typescript/no-redeclare": "error",
|
||||||
|
"typescript/ban-ts-comment": "error",
|
||||||
|
"typescript/consistent-type-imports": ["error", {
|
||||||
|
"prefer": "type-imports",
|
||||||
|
"fixStyle": "inline-type-imports"
|
||||||
|
}],
|
||||||
|
"typescript/explicit-function-return-type": "off",
|
||||||
|
"typescript/explicit-module-boundary-types": "off",
|
||||||
|
"typescript/no-empty-object-type": ["error", {
|
||||||
|
"allowInterfaces": "with-single-extends"
|
||||||
|
}],
|
||||||
|
"typescript/no-empty-function": "off",
|
||||||
|
"typescript/no-explicit-any": "off",
|
||||||
|
"typescript/no-unused-vars": ["warn", {
|
||||||
|
"vars": "all",
|
||||||
|
"varsIgnorePattern": "^_",
|
||||||
|
"args": "after-used",
|
||||||
|
"argsIgnorePattern": "^_"
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
import js from '@eslint/js';
|
|
||||||
import tseslint from 'typescript-eslint';
|
|
||||||
|
|
||||||
export default [
|
|
||||||
// Base JS recommended rules
|
|
||||||
js.configs.recommended,
|
|
||||||
|
|
||||||
// TypeScript recommended rules
|
|
||||||
...tseslint.configs.recommended,
|
|
||||||
|
|
||||||
{
|
|
||||||
files: ['**/*.ts', '**/*.tsx'],
|
|
||||||
languageOptions: {
|
|
||||||
parserOptions: {
|
|
||||||
project: true,
|
|
||||||
tsconfigRootDir: import.meta.dirname,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
// Common TypeScript-friendly tweaks
|
|
||||||
'@typescript-eslint/no-unused-vars': [
|
|
||||||
'warn',
|
|
||||||
{ argsIgnorePattern: '^_' },
|
|
||||||
],
|
|
||||||
'@typescript-eslint/no-explicit-any': 'off',
|
|
||||||
'no-unused-vars': 'off', // handled by TS rule
|
|
||||||
},
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
@ -10,8 +10,8 @@
|
||||||
"packageManager": "yarn@4.9.2",
|
"packageManager": "yarn@4.9.2",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"twenty": "twenty",
|
"twenty": "twenty",
|
||||||
"lint": "eslint",
|
"lint": "oxlint -c .oxlintrc.json .",
|
||||||
"lint:fix": "eslint --fix"
|
"lint:fix": "oxlint --fix -c .oxlintrc.json ."
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@emotion/react": "^11.11.1",
|
"@emotion/react": "^11.11.1",
|
||||||
|
|
@ -23,9 +23,8 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^24.7.2",
|
"@types/node": "^24.7.2",
|
||||||
"@types/react": "^18.2.0",
|
"@types/react": "^18.2.0",
|
||||||
"eslint": "^9.32.0",
|
"oxlint": "^0.16.0",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"typescript": "^5.9.3",
|
"typescript": "^5.9.3"
|
||||||
"typescript-eslint": "^8.50.0"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
40
packages/twenty-apps/internal/self-hosting/.oxlintrc.json
Normal file
40
packages/twenty-apps/internal/self-hosting/.oxlintrc.json
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
{
|
||||||
|
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
||||||
|
"plugins": ["typescript", "import", "unicorn"],
|
||||||
|
"categories": {
|
||||||
|
"correctness": "off"
|
||||||
|
},
|
||||||
|
"ignorePatterns": ["node_modules"],
|
||||||
|
"rules": {
|
||||||
|
"func-style": ["error", "declaration", { "allowArrowFunctions": true }],
|
||||||
|
"no-console": ["warn", { "allow": ["group", "groupCollapsed", "groupEnd"] }],
|
||||||
|
"no-control-regex": "off",
|
||||||
|
"no-debugger": "error",
|
||||||
|
"no-duplicate-imports": "error",
|
||||||
|
"no-undef": "off",
|
||||||
|
"no-unused-vars": "off",
|
||||||
|
"no-redeclare": "off",
|
||||||
|
|
||||||
|
"import/no-duplicates": "error",
|
||||||
|
|
||||||
|
"typescript/no-redeclare": "error",
|
||||||
|
"typescript/ban-ts-comment": "error",
|
||||||
|
"typescript/consistent-type-imports": ["error", {
|
||||||
|
"prefer": "type-imports",
|
||||||
|
"fixStyle": "inline-type-imports"
|
||||||
|
}],
|
||||||
|
"typescript/explicit-function-return-type": "off",
|
||||||
|
"typescript/explicit-module-boundary-types": "off",
|
||||||
|
"typescript/no-empty-object-type": ["error", {
|
||||||
|
"allowInterfaces": "with-single-extends"
|
||||||
|
}],
|
||||||
|
"typescript/no-empty-function": "off",
|
||||||
|
"typescript/no-explicit-any": "off",
|
||||||
|
"typescript/no-unused-vars": ["warn", {
|
||||||
|
"vars": "all",
|
||||||
|
"varsIgnorePattern": "^_",
|
||||||
|
"args": "after-used",
|
||||||
|
"argsIgnorePattern": "^_"
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -10,11 +10,12 @@
|
||||||
"packageManager": "yarn@4.9.2",
|
"packageManager": "yarn@4.9.2",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"twenty": "twenty",
|
"twenty": "twenty",
|
||||||
"lint": "eslint",
|
"lint": "oxlint -c .oxlintrc.json .",
|
||||||
"lint:fix": "eslint --fix"
|
"lint:fix": "oxlint --fix -c .oxlintrc.json ."
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^24.7.2",
|
"@types/node": "^24.7.2",
|
||||||
|
"oxlint": "^0.16.0",
|
||||||
"twenty-sdk": "0.6.2"
|
"twenty-sdk": "0.6.2"
|
||||||
},
|
},
|
||||||
"$schema": "https://raw.githubusercontent.com/twentyhq/twenty/main/packages/twenty-cli/src/constants/schemas/appManifest.schema.json",
|
"$schema": "https://raw.githubusercontent.com/twentyhq/twenty/main/packages/twenty-cli/src/constants/schemas/appManifest.schema.json",
|
||||||
|
|
|
||||||
4
packages/twenty-companion/.gitignore
vendored
4
packages/twenty-companion/.gitignore
vendored
|
|
@ -45,8 +45,8 @@ typings/
|
||||||
# Optional npm cache directory
|
# Optional npm cache directory
|
||||||
.npm
|
.npm
|
||||||
|
|
||||||
# Optional eslint cache
|
# Optional oxlint cache
|
||||||
.eslintcache
|
.oxlintcache
|
||||||
|
|
||||||
# Optional REPL history
|
# Optional REPL history
|
||||||
.node_repl_history
|
.node_repl_history
|
||||||
|
|
|
||||||
1231
packages/twenty-companion/package-lock.json
generated
1231
packages/twenty-companion/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -8,7 +8,7 @@ COPY ./yarn.lock .
|
||||||
COPY ./.yarnrc.yml .
|
COPY ./.yarnrc.yml .
|
||||||
COPY ./.yarn/releases /app/.yarn/releases
|
COPY ./.yarn/releases /app/.yarn/releases
|
||||||
COPY ./.yarn/patches /app/.yarn/patches
|
COPY ./.yarn/patches /app/.yarn/patches
|
||||||
COPY ./packages/twenty-eslint-rules /app/packages/twenty-eslint-rules
|
COPY ./packages/twenty-oxlint-rules /app/packages/twenty-oxlint-rules
|
||||||
COPY ./packages/twenty-ui/package.json /app/packages/twenty-ui/
|
COPY ./packages/twenty-ui/package.json /app/packages/twenty-ui/
|
||||||
COPY ./packages/twenty-shared/package.json /app/packages/twenty-shared/
|
COPY ./packages/twenty-shared/package.json /app/packages/twenty-shared/
|
||||||
COPY ./packages/twenty-website/package.json /app/packages/twenty-website/package.json
|
COPY ./packages/twenty-website/package.json /app/packages/twenty-website/package.json
|
||||||
|
|
|
||||||
34
packages/twenty-docs/.oxlintrc.json
Normal file
34
packages/twenty-docs/.oxlintrc.json
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
{
|
||||||
|
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
||||||
|
"plugins": ["typescript", "import", "unicorn"],
|
||||||
|
"ignorePatterns": ["node_modules", ".next", "storybook-static"],
|
||||||
|
"rules": {
|
||||||
|
"func-style": ["error", "declaration", { "allowArrowFunctions": true }],
|
||||||
|
"no-console": ["warn", { "allow": ["group", "groupCollapsed", "groupEnd"] }],
|
||||||
|
"no-control-regex": "off",
|
||||||
|
"no-debugger": "error",
|
||||||
|
"no-duplicate-imports": "error",
|
||||||
|
"no-undef": "off",
|
||||||
|
"no-unused-vars": "off",
|
||||||
|
"no-redeclare": "off",
|
||||||
|
"import/no-duplicates": "error",
|
||||||
|
"typescript/no-redeclare": "error",
|
||||||
|
"typescript/consistent-type-imports": ["error", {
|
||||||
|
"prefer": "type-imports",
|
||||||
|
"fixStyle": "inline-type-imports"
|
||||||
|
}],
|
||||||
|
"typescript/explicit-function-return-type": "off",
|
||||||
|
"typescript/explicit-module-boundary-types": "off",
|
||||||
|
"typescript/no-empty-object-type": ["error", {
|
||||||
|
"allowInterfaces": "with-single-extends"
|
||||||
|
}],
|
||||||
|
"typescript/no-empty-function": "off",
|
||||||
|
"typescript/no-explicit-any": "off",
|
||||||
|
"typescript/no-unused-vars": ["warn", {
|
||||||
|
"vars": "all",
|
||||||
|
"varsIgnorePattern": "^_",
|
||||||
|
"args": "after-used",
|
||||||
|
"argsIgnorePattern": "^_"
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -92,7 +92,7 @@ Here's what the tech stack now looks like.
|
||||||
|
|
||||||
**Tooling**
|
**Tooling**
|
||||||
- [Yarn](https://yarnpkg.com/)
|
- [Yarn](https://yarnpkg.com/)
|
||||||
- [ESLint](https://eslint.org/)
|
- [Oxlint](https://oxc.rs/docs/guide/usage/linter.html)
|
||||||
|
|
||||||
**Development**
|
**Development**
|
||||||
- [AWS EKS](https://aws.amazon.com/eks/)
|
- [AWS EKS](https://aws.amazon.com/eks/)
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ The project has a clean and simple stack, with minimal boilerplate code.
|
||||||
|
|
||||||
- [Yarn](https://yarnpkg.com/)
|
- [Yarn](https://yarnpkg.com/)
|
||||||
- [Craco](https://craco.js.org/docs/)
|
- [Craco](https://craco.js.org/docs/)
|
||||||
- [ESLint](https://eslint.org/)
|
- [Oxlint](https://oxc.rs/docs/guide/usage/linter.html)
|
||||||
|
|
||||||
## Architecture
|
## Architecture
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -260,7 +260,7 @@ const StyledButton = styled.button`
|
||||||
```
|
```
|
||||||
## Enforcing No-Type Imports
|
## Enforcing No-Type Imports
|
||||||
|
|
||||||
Avoid type imports. To enforce this standard, an ESLint rule checks for and reports any type imports. This helps maintain consistency and readability in the TypeScript code.
|
Avoid type imports. To enforce this standard, an Oxlint rule checks for and reports any type imports. This helps maintain consistency and readability in the TypeScript code.
|
||||||
|
|
||||||
```tsx
|
```tsx
|
||||||
// ❌ Bad
|
// ❌ Bad
|
||||||
|
|
@ -281,11 +281,11 @@ import { Meta, StoryObj } from '@storybook/react';
|
||||||
|
|
||||||
- **Maintainability**: It enhances codebase maintainability because developers can identify and locate type-only imports when reviewing or modifying code.
|
- **Maintainability**: It enhances codebase maintainability because developers can identify and locate type-only imports when reviewing or modifying code.
|
||||||
|
|
||||||
### ESLint Rule
|
### Oxlint Rule
|
||||||
|
|
||||||
An ESLint rule, `@typescript-eslint/consistent-type-imports`, enforces the no-type import standard. This rule will generate errors or warnings for any type import violations.
|
An Oxlint rule, `typescript/consistent-type-imports`, enforces the no-type import standard. This rule will generate errors or warnings for any type import violations.
|
||||||
|
|
||||||
Please note that this rule specifically addresses rare edge cases where unintentional type imports occur. TypeScript itself discourages this practice, as mentioned in the [TypeScript 3.8 release notes](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html). In most situations, you should not need to use type-only imports.
|
Please note that this rule specifically addresses rare edge cases where unintentional type imports occur. TypeScript itself discourages this practice, as mentioned in the [TypeScript 3.8 release notes](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html). In most situations, you should not need to use type-only imports.
|
||||||
|
|
||||||
To ensure your code complies with this rule, make sure to run ESLint as part of your development workflow.
|
To ensure your code complies with this rule, make sure to run Oxlint as part of your development workflow.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ my-twenty-app/
|
||||||
.yarnrc.yml
|
.yarnrc.yml
|
||||||
.yarn/
|
.yarn/
|
||||||
install-state.gz
|
install-state.gz
|
||||||
eslint.config.mjs
|
.oxlintrc.json
|
||||||
tsconfig.json
|
tsconfig.json
|
||||||
README.md
|
README.md
|
||||||
public/ # Public assets folder (images, fonts, etc.)
|
public/ # Public assets folder (images, fonts, etc.)
|
||||||
|
|
@ -129,7 +129,7 @@ At a high level:
|
||||||
- **.gitignore**: Ignores common artifacts such as `node_modules`, `.yarn`, `generated/` (typed client), `dist/`, `build/`, coverage folders, log files, and `.env*` files.
|
- **.gitignore**: Ignores common artifacts such as `node_modules`, `.yarn`, `generated/` (typed client), `dist/`, `build/`, coverage folders, log files, and `.env*` files.
|
||||||
- **yarn.lock**, **.yarnrc.yml**, **.yarn/**: Lock and configure the Yarn 4 toolchain used by the project.
|
- **yarn.lock**, **.yarnrc.yml**, **.yarn/**: Lock and configure the Yarn 4 toolchain used by the project.
|
||||||
- **.nvmrc**: Pins the Node.js version expected by the project.
|
- **.nvmrc**: Pins the Node.js version expected by the project.
|
||||||
- **eslint.config.mjs** and **tsconfig.json**: Provide linting and TypeScript configuration for your app's TypeScript sources.
|
- **.oxlintrc.json** and **tsconfig.json**: Provide linting and TypeScript configuration for your app's TypeScript sources.
|
||||||
- **README.md**: A short README in the app root with basic instructions.
|
- **README.md**: A short README in the app root with basic instructions.
|
||||||
- **public/**: A folder for storing public assets (images, fonts, static files) that will be served with your application. Files placed here are uploaded during sync and accessible at runtime.
|
- **public/**: A folder for storing public assets (images, fonts, static files) that will be served with your application. Files placed here are uploaded during sync and accessible at runtime.
|
||||||
- **src/**: The main place where you define your application-as-code
|
- **src/**: The main place where you define your application-as-code
|
||||||
|
|
|
||||||
|
|
@ -54,12 +54,12 @@ Make sure to run yarn in the root directory and then run `npx nx server:dev twen
|
||||||
|
|
||||||
#### Lint on Save not working
|
#### Lint on Save not working
|
||||||
|
|
||||||
This should work out of the box with the eslint extension installed. If this doesn't work try adding this to your vscode setting (on the dev container scope):
|
This should work out of the box with the Oxc extension (`oxc.oxc-vscode`) installed. If this doesn't work try adding this to your vscode setting (on the dev container scope):
|
||||||
|
|
||||||
```
|
```
|
||||||
"editor.codeActionsOnSave": {
|
"editor.codeActionsOnSave": {
|
||||||
|
|
||||||
"source.fixAll.eslint": "explicit"
|
"source.fixAll.oxc": "explicit"
|
||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
import baseConfig from '../../eslint.config.mjs';
|
|
||||||
|
|
||||||
export default [...baseConfig];
|
|
||||||
|
|
||||||
|
|
@ -96,7 +96,7 @@ Prisma كان أول ORM استخدمناه. ولكن للسماح للمستخ
|
||||||
**الأدوات**
|
**الأدوات**
|
||||||
|
|
||||||
* [Yarn](https://yarnpkg.com/)
|
* [Yarn](https://yarnpkg.com/)
|
||||||
* [ESLint](https://eslint.org/)
|
* [Oxlint](https://oxc.rs/docs/guide/usage/linter.html)
|
||||||
|
|
||||||
**التطوير**
|
**التطوير**
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ title: أوامر الواجهة الأمامية
|
||||||
|
|
||||||
* [Yarn](https://yarnpkg.com/)
|
* [Yarn](https://yarnpkg.com/)
|
||||||
* "[Craco](https://craco.js.org/docs/)"
|
* "[Craco](https://craco.js.org/docs/)"
|
||||||
* [ESLint](https://eslint.org/)
|
* [Oxlint](https://oxc.rs/docs/guide/usage/linter.html)
|
||||||
|
|
||||||
## "الهيكلية"
|
## "الهيكلية"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -260,7 +260,7 @@ const StyledButton = styled.button`
|
||||||
|
|
||||||
## تطبيق قاعدة "عدم استيراد الأنواع"
|
## تطبيق قاعدة "عدم استيراد الأنواع"
|
||||||
|
|
||||||
تجنب استيراد الأنواع. للحد من هذه الممارسة، تتحقق قاعدة ESLint وتبلغ عن أي استيرادات من هذا النوع. يساعد هذا على الحفاظ على الاتساق وقابلية القراءة في كود TypeScript.
|
تجنب استيراد الأنواع. للحد من هذه الممارسة، تتحقق قاعدة Oxlint وتبلغ عن أي استيرادات من هذا النوع. يساعد هذا على الحفاظ على الاتساق وقابلية القراءة في كود TypeScript.
|
||||||
|
|
||||||
```tsx
|
```tsx
|
||||||
// ❌ Bad
|
// ❌ Bad
|
||||||
|
|
@ -281,10 +281,10 @@ import { Meta, StoryObj } from '@storybook/react';
|
||||||
|
|
||||||
* **الصيانة**: يعزز الصيانة داخل قاعدة الكود لأن المطوّرين يمكنهم تحديد مواقع استيرادات الأنواع فقط عند استعراض أو تعديل الكود.
|
* **الصيانة**: يعزز الصيانة داخل قاعدة الكود لأن المطوّرين يمكنهم تحديد مواقع استيرادات الأنواع فقط عند استعراض أو تعديل الكود.
|
||||||
|
|
||||||
### قاعدة ESLint
|
### قاعدة Oxlint
|
||||||
|
|
||||||
تفرض قاعدة ESLint، `@typescript-eslint/consistent-type-imports`, معيار عدم استيراد الأنواع. ستولد هذه القاعدة تحذيرات أو أخطاء عن أي انتهاكات لاستيراد الأنواع.
|
تفرض قاعدة Oxlint، `typescript/consistent-type-imports`, معيار عدم استيراد الأنواع. ستولد هذه القاعدة تحذيرات أو أخطاء عن أي انتهاكات لاستيراد الأنواع.
|
||||||
|
|
||||||
يرجى ملاحظة أن هذه القاعدة تتناول بشكل خاص حالات الحافة النادرة حيث تحدث استيرادات الأنواع دون قصد. يمنع TypeScript نفسه هذه الممارسة، كما هو موضح في [ملاحظات إصدار TypeScript 3.8](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html). في معظم الحالات، لا ينبغي لك أن تستخدم استيرادات الأنواع وحدها.
|
يرجى ملاحظة أن هذه القاعدة تتناول بشكل خاص حالات الحافة النادرة حيث تحدث استيرادات الأنواع دون قصد. يمنع TypeScript نفسه هذه الممارسة، كما هو موضح في [ملاحظات إصدار TypeScript 3.8](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html). في معظم الحالات، لا ينبغي لك أن تستخدم استيرادات الأنواع وحدها.
|
||||||
|
|
||||||
لضمان امتثال الكود الخاص بك لهذه القاعدة، تأكد من تشغيل ESLint كجزء من سير العمل الخاص بالتطوير لديك.
|
لضمان امتثال الكود الخاص بك لهذه القاعدة، تأكد من تشغيل Oxlint كجزء من سير العمل الخاص بالتطوير لديك.
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ my-twenty-app/
|
||||||
.yarnrc.yml
|
.yarnrc.yml
|
||||||
.yarn/
|
.yarn/
|
||||||
install-state.gz
|
install-state.gz
|
||||||
eslint.config.mjs
|
.oxlintrc.json
|
||||||
tsconfig.json
|
tsconfig.json
|
||||||
README.md
|
README.md
|
||||||
public/ # مجلد الأصول العامة (صور، خطوط، إلخ)
|
public/ # مجلد الأصول العامة (صور، خطوط، إلخ)
|
||||||
|
|
@ -130,7 +130,7 @@ my-twenty-app/
|
||||||
* **.gitignore**: يتجاهل العناصر الشائعة مثل `node_modules` و`.yarn` و`generated/` (عميل مضبوط الأنواع) و`dist/` و`build/` ومجلدات التغطية وملفات السجلات وملفات `.env*`.
|
* **.gitignore**: يتجاهل العناصر الشائعة مثل `node_modules` و`.yarn` و`generated/` (عميل مضبوط الأنواع) و`dist/` و`build/` ومجلدات التغطية وملفات السجلات وملفات `.env*`.
|
||||||
* **yarn.lock**، **.yarnrc.yml**، **.yarn/**: تقوم بقفل وتكوين حزمة أدوات Yarn 4 المستخدمة في المشروع.
|
* **yarn.lock**، **.yarnrc.yml**، **.yarn/**: تقوم بقفل وتكوين حزمة أدوات Yarn 4 المستخدمة في المشروع.
|
||||||
* **.nvmrc**: يثبّت إصدار Node.js المتوقع للمشروع.
|
* **.nvmrc**: يثبّت إصدار Node.js المتوقع للمشروع.
|
||||||
* **eslint.config.mjs** و**tsconfig.json**: يقدّمان إعدادات الفحص والتهيئة لـ TypeScript لمصادر TypeScript في تطبيقك.
|
* **.oxlintrc.json** و**tsconfig.json**: يقدّمان إعدادات الفحص والتهيئة لـ TypeScript لمصادر TypeScript في تطبيقك.
|
||||||
* **README.md**: ملف README قصير في جذر التطبيق يتضمن تعليمات أساسية.
|
* **README.md**: ملف README قصير في جذر التطبيق يتضمن تعليمات أساسية.
|
||||||
* **public/**: مجلد لتخزين الأصول العامة (صور، خطوط، ملفات ثابتة) التي سيتم تقديمها مع تطبيقك. الملفات الموضوعة هنا تُرفع أثناء المزامنة وتكون متاحة أثناء وقت التشغيل.
|
* **public/**: مجلد لتخزين الأصول العامة (صور، خطوط، ملفات ثابتة) التي سيتم تقديمها مع تطبيقك. الملفات الموضوعة هنا تُرفع أثناء المزامنة وتكون متاحة أثناء وقت التشغيل.
|
||||||
* **src/**: المكان الرئيسي حيث تعرّف تطبيقك ككود
|
* **src/**: المكان الرئيسي حيث تعرّف تطبيقك ككود
|
||||||
|
|
|
||||||
|
|
@ -53,12 +53,12 @@ git config --global core.autocrlf false
|
||||||
|
|
||||||
#### التحقق من العمليات عند الحفظ لا يعمل
|
#### التحقق من العمليات عند الحفظ لا يعمل
|
||||||
|
|
||||||
هذا يجب أن يعمل تلقائيًا مع تثبيت إضافة eslint. إذا لم يعمل ذلك، حاول إضافة هذا إلى إعدادات vscode (ضمن نطاق حاوية التطوير):
|
هذا يجب أن يعمل تلقائيًا مع تثبيت إضافة Oxc (`oxc.oxc-vscode`). إذا لم يعمل ذلك، حاول إضافة هذا إلى إعدادات vscode (ضمن نطاق حاوية التطوير):
|
||||||
|
|
||||||
```
|
```
|
||||||
"editor.codeActionsOnSave": {
|
"editor.codeActionsOnSave": {
|
||||||
|
|
||||||
"source.fixAll.eslint": "explicit"
|
"source.fixAll.oxc": "explicit"
|
||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ Takto nyní vypadá technologický stack.
|
||||||
**Nástroje**
|
**Nástroje**
|
||||||
|
|
||||||
* [Yarn](https://yarnpkg.com/)
|
* [Yarn](https://yarnpkg.com/)
|
||||||
* [ESLint](https://eslint.org/)
|
* [Oxlint](https://oxc.rs/docs/guide/usage/linter.html)
|
||||||
|
|
||||||
**Vývoj**
|
**Vývoj**
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ Projekt má čistý a jednoduchý stack s minimálním počtem šablonových kó
|
||||||
|
|
||||||
* [Yarn](https://yarnpkg.com/)
|
* [Yarn](https://yarnpkg.com/)
|
||||||
* [Craco](https://craco.js.org/docs/)
|
* [Craco](https://craco.js.org/docs/)
|
||||||
* [ESLint](https://eslint.org/)
|
* [Oxlint](https://oxc.rs/docs/guide/usage/linter.html)
|
||||||
|
|
||||||
## Architektura
|
## Architektura
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -260,7 +260,7 @@ const StyledButton = styled.button`
|
||||||
|
|
||||||
## Prosazování Zákazu Importů Typů
|
## Prosazování Zákazu Importů Typů
|
||||||
|
|
||||||
Vyhýbejte se typovým importům. K prosazení tohoto standardu pravidlo ESLint kontroluje a hlásí jakékoli typové importy. To pomáhá udržovat konzistenci a čitelnost v TypeScript kódu.
|
Vyhýbejte se typovým importům. K prosazení tohoto standardu Pravidlo Oxlint kontroluje a hlásí jakékoli typové importy. To pomáhá udržovat konzistenci a čitelnost v TypeScript kódu.
|
||||||
|
|
||||||
```tsx
|
```tsx
|
||||||
// ❌ Bad
|
// ❌ Bad
|
||||||
|
|
@ -281,10 +281,10 @@ import { Meta, StoryObj } from '@storybook/react';
|
||||||
|
|
||||||
* **Udržovatelnost**: Zvyšuje udržovatelnost kódové základny, protože vývojáři mohou při revizi nebo úpravách kódu identifikovat a najít importy pouze typů.
|
* **Udržovatelnost**: Zvyšuje udržovatelnost kódové základny, protože vývojáři mohou při revizi nebo úpravách kódu identifikovat a najít importy pouze typů.
|
||||||
|
|
||||||
### Pravidlo ESLint
|
### Pravidlo Oxlint
|
||||||
|
|
||||||
Pravidlo ESLint, `@typescript-eslint/consistent-type-imports`, prosazuje standard zákazu importů typů. Toto pravidlo generuje chyby nebo varování pro jakékoli porušení typového importu.
|
Pravidlo Oxlint, `typescript/consistent-type-imports`, prosazuje standard zákazu importů typů. Toto pravidlo generuje chyby nebo varování pro jakékoli porušení typového importu.
|
||||||
|
|
||||||
Upozorňujeme, že toto pravidlo konkrétně řeší vzácné okrajové případy, kdy dochází k neúmyslným typovým importům. TypeScript sám odrazuje tuto praxi, jak je uvedeno v [poznámkách k verzi TypeScript 3.8](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html). Ve většině případů byste neměli potřebovat používat pouze typové importy.
|
Upozorňujeme, že toto pravidlo konkrétně řeší vzácné okrajové případy, kdy dochází k neúmyslným typovým importům. TypeScript sám odrazuje tuto praxi, jak je uvedeno v [poznámkách k verzi TypeScript 3.8](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html). Ve většině případů byste neměli potřebovat používat pouze typové importy.
|
||||||
|
|
||||||
Aby váš kód splňoval toto pravidlo, spusťte ESLint jako součást svého vývojového pracovního postupu.
|
Aby váš kód splňoval toto pravidlo, spusťte Oxlint jako součást svého vývojového pracovního postupu.
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ my-twenty-app/
|
||||||
.yarnrc.yml
|
.yarnrc.yml
|
||||||
.yarn/
|
.yarn/
|
||||||
install-state.gz
|
install-state.gz
|
||||||
eslint.config.mjs
|
.oxlintrc.json
|
||||||
tsconfig.json
|
tsconfig.json
|
||||||
README.md
|
README.md
|
||||||
public/ # Složka s veřejnými prostředky (obrázky, písma apod.)
|
public/ # Složka s veřejnými prostředky (obrázky, písma apod.)
|
||||||
|
|
@ -130,7 +130,7 @@ V kostce:
|
||||||
* **.gitignore**: Ignoruje běžné artefakty jako `node_modules`, `.yarn`, `generated/` (typovaný klient), `dist/`, `build/`, složky s coverage, logy a soubory `.env*`.
|
* **.gitignore**: Ignoruje běžné artefakty jako `node_modules`, `.yarn`, `generated/` (typovaný klient), `dist/`, `build/`, složky s coverage, logy a soubory `.env*`.
|
||||||
* **yarn.lock**, **.yarnrc.yml**, **.yarn/**: Zamykají a konfigurují nástrojový řetězec Yarn 4 používaný projektem.
|
* **yarn.lock**, **.yarnrc.yml**, **.yarn/**: Zamykají a konfigurují nástrojový řetězec Yarn 4 používaný projektem.
|
||||||
* **.nvmrc**: Fixuje verzi Node.js požadovanou projektem.
|
* **.nvmrc**: Fixuje verzi Node.js požadovanou projektem.
|
||||||
* **eslint.config.mjs** a **tsconfig.json**: Poskytují lintování a konfiguraci TypeScriptu pro zdrojové soubory vaší aplikace v TypeScriptu.
|
* **.oxlintrc.json** a **tsconfig.json**: Poskytují lintování a konfiguraci TypeScriptu pro zdrojové soubory vaší aplikace v TypeScriptu.
|
||||||
* **README.md**: Krátké README v kořeni aplikace se základními pokyny.
|
* **README.md**: Krátké README v kořeni aplikace se základními pokyny.
|
||||||
* **public/**: Složka pro ukládání veřejných prostředků (obrázky, písma, statické soubory), které bude vaše aplikace poskytovat. Soubory umístěné zde se během synchronizace nahrají a jsou za běhu dostupné.
|
* **public/**: Složka pro ukládání veřejných prostředků (obrázky, písma, statické soubory), které bude vaše aplikace poskytovat. Soubory umístěné zde se během synchronizace nahrají a jsou za běhu dostupné.
|
||||||
* **src/**: Hlavní místo, kde definujete svou aplikaci jako kód
|
* **src/**: Hlavní místo, kde definujete svou aplikaci jako kód
|
||||||
|
|
|
||||||
|
|
@ -54,12 +54,12 @@ Ujistěte se, že v kořenovém adresáři spouštíte `yarn` a poté spusťte `
|
||||||
|
|
||||||
#### Lint při ukládání nefunguje
|
#### Lint při ukládání nefunguje
|
||||||
|
|
||||||
Toto by mělo fungovat přímo s nainstalovaným rozšířením eslint. Pokud to nefunguje, zkuste přidat toto do svého nastavení vscode (v rozsahu dev containeru):
|
Toto by mělo fungovat přímo s nainstalovaným rozšířením Oxc (`oxc.oxc-vscode`). Pokud to nefunguje, zkuste přidat toto do svého nastavení vscode (v rozsahu dev containeru):
|
||||||
|
|
||||||
```
|
```
|
||||||
"editor.codeActionsOnSave": {
|
"editor.codeActionsOnSave": {
|
||||||
|
|
||||||
"source.fixAll.eslint": "explicit"
|
"source.fixAll.oxc": "explicit"
|
||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ So sieht der Tech-Stack jetzt aus.
|
||||||
**Tools**
|
**Tools**
|
||||||
|
|
||||||
* [Yarn](https://yarnpkg.com/)
|
* [Yarn](https://yarnpkg.com/)
|
||||||
* [ESLint](https://eslint.org/)
|
* [Oxlint](https://oxc.rs/docs/guide/usage/linter.html)
|
||||||
|
|
||||||
**Entwicklung**
|
**Entwicklung**
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ Das Projekt hat einen sauberen und einfachen Stack mit minimalem Boilerplate-Cod
|
||||||
|
|
||||||
* [Yarn](https://yarnpkg.com/)
|
* [Yarn](https://yarnpkg.com/)
|
||||||
* [Craco](https://craco.js.org/docs/)
|
* [Craco](https://craco.js.org/docs/)
|
||||||
* [ESLint](https://eslint.org/)
|
* [Oxlint](https://oxc.rs/docs/guide/usage/linter.html)
|
||||||
|
|
||||||
## Architektur
|
## Architektur
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -260,7 +260,7 @@ const StyledButton = styled.button`
|
||||||
|
|
||||||
## Durchsetzung von No-Type Imports
|
## Durchsetzung von No-Type Imports
|
||||||
|
|
||||||
Vermeiden Sie Typ-Importe. Um diesen Standard durchzusetzen, überprüft eine ESLint-Regel alle Typ-Importe und meldet sie. Dies trägt zur Konsistenz und Lesbarkeit des TypeScript-Codes bei.
|
Vermeiden Sie Typ-Importe. Um diesen Standard durchzusetzen, überprüft Eine Oxlint-Regel alle Typ-Importe und meldet sie. Dies trägt zur Konsistenz und Lesbarkeit des TypeScript-Codes bei.
|
||||||
|
|
||||||
```tsx
|
```tsx
|
||||||
// ❌ Bad
|
// ❌ Bad
|
||||||
|
|
@ -281,10 +281,10 @@ import { Meta, StoryObj } from '@storybook/react';
|
||||||
|
|
||||||
* **Wartbarkeit**: Es verbessert die Wartbarkeit der Codebasis, da Entwickler Typ-Only-Imports beim Überprüfen oder Ändern von Code identifizieren und lokalisieren können.
|
* **Wartbarkeit**: Es verbessert die Wartbarkeit der Codebasis, da Entwickler Typ-Only-Imports beim Überprüfen oder Ändern von Code identifizieren und lokalisieren können.
|
||||||
|
|
||||||
### ESLint-Regel
|
### Oxlint-Regel
|
||||||
|
|
||||||
Eine ESLint-Regel, `@typescript-eslint/consistent-type-imports`, setzt den No-Type-Import-Standard durch. Diese Regel generiert Fehler oder Warnungen bei Verstößen gegen Typ-Importe.
|
Eine Oxlint-Regel, `typescript/consistent-type-imports`, setzt den No-Type-Import-Standard durch. Diese Regel generiert Fehler oder Warnungen bei Verstößen gegen Typ-Importe.
|
||||||
|
|
||||||
Bitte beachten Sie, dass diese Regel speziell seltene Randfälle behandelt, in denen unbeabsichtigte Typ-Importe auftreten. TypeScript selbst lehnt diese Praxis ab, wie in den [TypeScript 3.8 Release Notes](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html) erwähnt. In den meisten Situationen sollten Typ-Only-Imports nicht benötigt werden.
|
Bitte beachten Sie, dass diese Regel speziell seltene Randfälle behandelt, in denen unbeabsichtigte Typ-Importe auftreten. TypeScript selbst lehnt diese Praxis ab, wie in den [TypeScript 3.8 Release Notes](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html) erwähnt. In den meisten Situationen sollten Typ-Only-Imports nicht benötigt werden.
|
||||||
|
|
||||||
Um sicherzustellen, dass Ihr Code mit dieser Regel übereinstimmt, achten Sie darauf, ESLint als Teil Ihres Entwicklungsworkflows auszuführen.
|
Um sicherzustellen, dass Ihr Code mit dieser Regel übereinstimmt, achten Sie darauf, Oxlint als Teil Ihres Entwicklungsworkflows auszuführen.
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ my-twenty-app/
|
||||||
.yarnrc.yml
|
.yarnrc.yml
|
||||||
.yarn/
|
.yarn/
|
||||||
install-state.gz
|
install-state.gz
|
||||||
eslint.config.mjs
|
.oxlintrc.json
|
||||||
tsconfig.json
|
tsconfig.json
|
||||||
README.md
|
README.md
|
||||||
public/ # Ordner für öffentliche Assets (Bilder, Schriftarten usw.)
|
public/ # Ordner für öffentliche Assets (Bilder, Schriftarten usw.)
|
||||||
|
|
@ -130,7 +130,7 @@ Auf hoher Ebene:
|
||||||
* **.gitignore**: Ignoriert übliche Artefakte wie `node_modules`, `.yarn`, `generated/` (typisierter Client), `dist/`, `build/`, Coverage-Ordner, Logdateien und `.env*`-Dateien.
|
* **.gitignore**: Ignoriert übliche Artefakte wie `node_modules`, `.yarn`, `generated/` (typisierter Client), `dist/`, `build/`, Coverage-Ordner, Logdateien und `.env*`-Dateien.
|
||||||
* **yarn.lock**, **.yarnrc.yml**, **.yarn/**: Fixieren und konfigurieren die vom Projekt verwendete Yarn-4-Toolchain.
|
* **yarn.lock**, **.yarnrc.yml**, **.yarn/**: Fixieren und konfigurieren die vom Projekt verwendete Yarn-4-Toolchain.
|
||||||
* **.nvmrc**: Legt die vom Projekt erwartete Node.js-Version fest.
|
* **.nvmrc**: Legt die vom Projekt erwartete Node.js-Version fest.
|
||||||
* **eslint.config.mjs** und **tsconfig.json**: Stellen Linting und TypeScript-Konfiguration für die TypeScript-Quellen Ihrer App bereit.
|
* **.oxlintrc.json** und **tsconfig.json**: Stellen Linting und TypeScript-Konfiguration für die TypeScript-Quellen Ihrer App bereit.
|
||||||
* **README.md**: Ein kurzes README im App-Root mit grundlegenden Anweisungen.
|
* **README.md**: Ein kurzes README im App-Root mit grundlegenden Anweisungen.
|
||||||
* **public/**: Ein Ordner zum Speichern öffentlicher Assets (Bilder, Schriftarten, statische Dateien), die zusammen mit Ihrer Anwendung bereitgestellt werden. Hier abgelegte Dateien werden während der Synchronisierung hochgeladen und sind zur Laufzeit zugänglich.
|
* **public/**: Ein Ordner zum Speichern öffentlicher Assets (Bilder, Schriftarten, statische Dateien), die zusammen mit Ihrer Anwendung bereitgestellt werden. Hier abgelegte Dateien werden während der Synchronisierung hochgeladen und sind zur Laufzeit zugänglich.
|
||||||
* **src/**: Der Hauptort, an dem Sie Ihre Anwendung als Code definieren
|
* **src/**: Der Hauptort, an dem Sie Ihre Anwendung als Code definieren
|
||||||
|
|
|
||||||
|
|
@ -53,12 +53,12 @@ Stellen Sie sicher, dass Sie `yarn` im Root-Verzeichnis ausführen und dann `npx
|
||||||
|
|
||||||
#### Lint beim Speichern funktioniert nicht
|
#### Lint beim Speichern funktioniert nicht
|
||||||
|
|
||||||
Normalerweise sollte dies sofort mit der installierten eslint-Erweiterung funktionieren. Wenn es nicht funktioniert, versuchen Sie, dies zu Ihren vscode-Einstellungen hinzuzufügen (im Entwicklungscontainer-Bereich):
|
Normalerweise sollte dies sofort mit der installierten Oxc-Erweiterung (`oxc.oxc-vscode`) funktionieren. Wenn es nicht funktioniert, versuchen Sie, dies zu Ihren vscode-Einstellungen hinzuzufügen (im Entwicklungscontainer-Bereich):
|
||||||
|
|
||||||
```
|
```
|
||||||
"editor.codeActionsOnSave": {
|
"editor.codeActionsOnSave": {
|
||||||
|
|
||||||
"source.fixAll.eslint": "explicit"
|
"source.fixAll.oxc": "explicit"
|
||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ Así es como se ve la pila tecnológica ahora.
|
||||||
**Herramientas**
|
**Herramientas**
|
||||||
|
|
||||||
* [Yarn](https://yarnpkg.com/)
|
* [Yarn](https://yarnpkg.com/)
|
||||||
* [ESLint](https://eslint.org/)
|
* [Oxlint](https://oxc.rs/docs/guide/usage/linter.html)
|
||||||
|
|
||||||
**Desarrollo**
|
**Desarrollo**
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ El proyecto tiene un stack limpio y sencillo, con un código boilerplate mínimo
|
||||||
|
|
||||||
* [Yarn](https://yarnpkg.com/)
|
* [Yarn](https://yarnpkg.com/)
|
||||||
* [Craco](https://craco.js.org/docs/)
|
* [Craco](https://craco.js.org/docs/)
|
||||||
* [ESLint](https://eslint.org/)
|
* [Oxlint](https://oxc.rs/docs/guide/usage/linter.html)
|
||||||
|
|
||||||
## Arquitectura
|
## Arquitectura
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -260,7 +260,7 @@ const StyledButton = styled.button`
|
||||||
|
|
||||||
## Aplicando No-Type Imports
|
## Aplicando No-Type Imports
|
||||||
|
|
||||||
Evita las importaciones de tipo. Para reforzar este estándar, una regla de ESLint verifica y reporta cualquier importación de tipo. Esto ayuda a mantener la consistencia y la legibilidad en el código TypeScript.
|
Evita las importaciones de tipo. Para reforzar este estándar, una regla de Oxlint verifica y reporta cualquier importación de tipo. Esto ayuda a mantener la consistencia y la legibilidad en el código TypeScript.
|
||||||
|
|
||||||
```tsx
|
```tsx
|
||||||
// ❌ Bad
|
// ❌ Bad
|
||||||
|
|
@ -281,10 +281,10 @@ import { Meta, StoryObj } from '@storybook/react';
|
||||||
|
|
||||||
* **Mantenibilidad**: Mejora la mantenibilidad de la base de código porque los desarrolladores pueden identificar y localizar importaciones solo de tipo al revisar o modificar el código.
|
* **Mantenibilidad**: Mejora la mantenibilidad de la base de código porque los desarrolladores pueden identificar y localizar importaciones solo de tipo al revisar o modificar el código.
|
||||||
|
|
||||||
### Regla de ESLint
|
### regla de Oxlint
|
||||||
|
|
||||||
Una regla de ESLint, `@typescript-eslint/consistent-type-imports`, impone el estándar de no usar "type" en las importaciones. Esta regla generará errores o advertencias sobre cualquier violación de importación de tipo.
|
Una regla de Oxlint, `typescript/consistent-type-imports`, impone el estándar de no usar "type" en las importaciones. Esta regla generará errores o advertencias sobre cualquier violación de importación de tipo.
|
||||||
|
|
||||||
Por favor, ten en cuenta que esta regla específicamente aborda extraños casos límite donde ocurren importaciones de tipo no intencionadas. TypeScript en sí mismo desaconseja esta práctica, como se menciona en las [notas de lanzamiento de TypeScript 3.8](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html). En la mayoría de situaciones, no deberías necesitar usar importaciones solo de tipo.
|
Por favor, ten en cuenta que esta regla específicamente aborda extraños casos límite donde ocurren importaciones de tipo no intencionadas. TypeScript en sí mismo desaconseja esta práctica, como se menciona en las [notas de lanzamiento de TypeScript 3.8](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html). En la mayoría de situaciones, no deberías necesitar usar importaciones solo de tipo.
|
||||||
|
|
||||||
Para asegurarte de que tu código cumpla con esta regla, asegúrate de ejecutar ESLint como parte de tu flujo de trabajo de desarrollo.
|
Para asegurarte de que tu código cumpla con esta regla, asegúrate de ejecutar Oxlint como parte de tu flujo de trabajo de desarrollo.
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ my-twenty-app/
|
||||||
.yarnrc.yml
|
.yarnrc.yml
|
||||||
.yarn/
|
.yarn/
|
||||||
install-state.gz
|
install-state.gz
|
||||||
eslint.config.mjs
|
.oxlintrc.json
|
||||||
tsconfig.json
|
tsconfig.json
|
||||||
README.md
|
README.md
|
||||||
public/ # Carpeta de recursos públicos (imágenes, fuentes, etc.)
|
public/ # Carpeta de recursos públicos (imágenes, fuentes, etc.)
|
||||||
|
|
@ -158,7 +158,7 @@ A grandes rasgos:
|
||||||
* **.gitignore**: Ignora artefactos comunes como `node_modules`, `.yarn`, `generated/` (cliente tipado), `dist/`, `build/`, carpetas de cobertura, archivos de registro y archivos `.env*`.
|
* **.gitignore**: Ignora artefactos comunes como `node_modules`, `.yarn`, `generated/` (cliente tipado), `dist/`, `build/`, carpetas de cobertura, archivos de registro y archivos `.env*`.
|
||||||
* **yarn.lock**, **.yarnrc.yml**, **.yarn/**: Bloquean y configuran la cadena de herramientas Yarn 4 utilizada por el proyecto.
|
* **yarn.lock**, **.yarnrc.yml**, **.yarn/**: Bloquean y configuran la cadena de herramientas Yarn 4 utilizada por el proyecto.
|
||||||
* **.nvmrc**: Fija la versión de Node.js esperada por el proyecto.
|
* **.nvmrc**: Fija la versión de Node.js esperada por el proyecto.
|
||||||
* **eslint.config.mjs** y **tsconfig.json**: Proporcionan linting y configuración de TypeScript para las fuentes de TypeScript de tu aplicación.
|
* **.oxlintrc.json** y **tsconfig.json**: Proporcionan linting y configuración de TypeScript para las fuentes de TypeScript de tu aplicación.
|
||||||
* **README.md**: Un README breve en la raíz de la aplicación con instrucciones básicas.
|
* **README.md**: Un README breve en la raíz de la aplicación con instrucciones básicas.
|
||||||
* **public/**: Una carpeta para almacenar recursos públicos (imágenes, fuentes, archivos estáticos) que se servirán con tu aplicación. Los archivos colocados aquí se cargan durante la sincronización y son accesibles en tiempo de ejecución.
|
* **public/**: Una carpeta para almacenar recursos públicos (imágenes, fuentes, archivos estáticos) que se servirán con tu aplicación. Los archivos colocados aquí se cargan durante la sincronización y son accesibles en tiempo de ejecución.
|
||||||
* **src/**: El lugar principal donde defines tu aplicación como código:
|
* **src/**: El lugar principal donde defines tu aplicación como código:
|
||||||
|
|
|
||||||
|
|
@ -53,12 +53,12 @@ Asegúrese de ejecutar yarn en el directorio raíz y luego ejecute `npx nx serve
|
||||||
|
|
||||||
#### Lint on Save no funciona
|
#### Lint on Save no funciona
|
||||||
|
|
||||||
Esto debería funcionar sin configuración adicional con la extensión de ESLint instalada. Si esto no funciona, intente agregar esto a su configuración de vscode (en el ámbito del contenedor de desarrollo):
|
Esto debería funcionar sin configuración adicional con la extensión de Oxlint instalada. Si esto no funciona, intente agregar esto a su configuración de vscode (en el ámbito del contenedor de desarrollo):
|
||||||
|
|
||||||
```
|
```
|
||||||
"editor.codeActionsOnSave": {
|
"editor.codeActionsOnSave": {
|
||||||
|
|
||||||
"source.fixAll.eslint": "explicit"
|
"source.fixAll.oxc": "explicit"
|
||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ Voici à quoi ressemble maintenant la pile technologique.
|
||||||
**Outils**
|
**Outils**
|
||||||
|
|
||||||
* [Yarn](https://yarnpkg.com/)
|
* [Yarn](https://yarnpkg.com/)
|
||||||
* [ESLint](https://eslint.org/)
|
* [Oxlint](https://oxc.rs/docs/guide/usage/linter.html)
|
||||||
|
|
||||||
**Développement**
|
**Développement**
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ Le projet a une stack simple et propre, avec un code boilerplate minimal.
|
||||||
|
|
||||||
* [Yarn](https://yarnpkg.com/)
|
* [Yarn](https://yarnpkg.com/)
|
||||||
* [Craco](https://craco.js.org/docs/)
|
* [Craco](https://craco.js.org/docs/)
|
||||||
* [ESLint](https://eslint.org/)
|
* [Oxlint](https://oxc.rs/docs/guide/usage/linter.html)
|
||||||
|
|
||||||
## Architecture
|
## Architecture
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -260,7 +260,7 @@ const StyledButton = styled.button`
|
||||||
|
|
||||||
## Application d'interdiction d'importations de type
|
## Application d'interdiction d'importations de type
|
||||||
|
|
||||||
Évitez les importations de type. Pour appliquer cette norme, une règle ESLint vérifie et signale toutes les importations de type. Cela aide à maintenir la cohérence et la lisibilité dans le code TypeScript.
|
Évitez les importations de type. Pour appliquer cette norme, une règle Oxlint vérifie et signale toutes les importations de type. Cela aide à maintenir la cohérence et la lisibilité dans le code TypeScript.
|
||||||
|
|
||||||
```tsx
|
```tsx
|
||||||
// ❌ Bad
|
// ❌ Bad
|
||||||
|
|
@ -281,10 +281,10 @@ import { Meta, StoryObj } from '@storybook/react';
|
||||||
|
|
||||||
* **Maintenabilité** : Cela améliore la maintenabilité de la base de code car les développeurs peuvent identifier et localiser les importations uniquement de type lors de la révision ou de la modification du code.
|
* **Maintenabilité** : Cela améliore la maintenabilité de la base de code car les développeurs peuvent identifier et localiser les importations uniquement de type lors de la révision ou de la modification du code.
|
||||||
|
|
||||||
### Règle ESLint
|
### règle Oxlint
|
||||||
|
|
||||||
Une règle ESLint, `@typescript-eslint/consistent-type-imports`, impose la convention des imports "type-only". Cette règle génère des erreurs ou des avertissements pour toutes les violations d'importations de type.
|
Une règle Oxlint, `typescript/consistent-type-imports`, impose la convention des imports "type-only". Cette règle génère des erreurs ou des avertissements pour toutes les violations d'importations de type.
|
||||||
|
|
||||||
Veillez à ce que cette règle aborde spécifiquement les rares cas particuliers où se produisent des importations de type involontaires. TypeScript lui-même déconseille cette pratique, comme mentionné dans les [notes de version de TypeScript 3.8](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html). Dans la majorité des situations, vous ne devriez pas avoir besoin d'utiliser des importations uniquement de type.
|
Veillez à ce que cette règle aborde spécifiquement les rares cas particuliers où se produisent des importations de type involontaires. TypeScript lui-même déconseille cette pratique, comme mentionné dans les [notes de version de TypeScript 3.8](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html). Dans la majorité des situations, vous ne devriez pas avoir besoin d'utiliser des importations uniquement de type.
|
||||||
|
|
||||||
Pour garantir la conformité de votre code avec cette règle, assurez-vous d'exécuter ESLint dans le cadre de votre flux de travail de développement.
|
Pour garantir la conformité de votre code avec cette règle, assurez-vous d'exécuter Oxlint dans le cadre de votre flux de travail de développement.
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ my-twenty-app/
|
||||||
.yarnrc.yml
|
.yarnrc.yml
|
||||||
.yarn/
|
.yarn/
|
||||||
install-state.gz
|
install-state.gz
|
||||||
eslint.config.mjs
|
.oxlintrc.json
|
||||||
tsconfig.json
|
tsconfig.json
|
||||||
README.md
|
README.md
|
||||||
public/ # Dossier de ressources publiques (images, polices, etc.)
|
public/ # Dossier de ressources publiques (images, polices, etc.)
|
||||||
|
|
@ -158,7 +158,7 @@ Dans les grandes lignes :
|
||||||
* **.gitignore** : Ignore les artefacts courants tels que `node_modules`, `.yarn`, `generated/` (client typé), `dist/`, `build/`, les dossiers de couverture, les fichiers journaux et les fichiers `.env*`.
|
* **.gitignore** : Ignore les artefacts courants tels que `node_modules`, `.yarn`, `generated/` (client typé), `dist/`, `build/`, les dossiers de couverture, les fichiers journaux et les fichiers `.env*`.
|
||||||
* **yarn.lock**, **.yarnrc.yml**, **.yarn/** : Verrouillent et configurent la chaîne d’outils Yarn 4 utilisée par le projet.
|
* **yarn.lock**, **.yarnrc.yml**, **.yarn/** : Verrouillent et configurent la chaîne d’outils Yarn 4 utilisée par le projet.
|
||||||
* **.nvmrc** : Fige la version de Node.js attendue par le projet.
|
* **.nvmrc** : Fige la version de Node.js attendue par le projet.
|
||||||
* **eslint.config.mjs** et **tsconfig.json** : Fournissent la configuration de linting et TypeScript pour les sources TypeScript de votre application.
|
* **.oxlintrc.json** et **tsconfig.json** : Fournissent la configuration de linting et TypeScript pour les sources TypeScript de votre application.
|
||||||
* **README.md** : Un bref README à la racine de l’application avec des instructions de base.
|
* **README.md** : Un bref README à la racine de l’application avec des instructions de base.
|
||||||
* **public/**: Un dossier pour stocker des ressources publiques (images, polices, fichiers statiques) qui seront servies avec votre application. Les fichiers placés ici sont téléversés lors de la synchronisation et accessibles à l'exécution.
|
* **public/**: Un dossier pour stocker des ressources publiques (images, polices, fichiers statiques) qui seront servies avec votre application. Les fichiers placés ici sont téléversés lors de la synchronisation et accessibles à l'exécution.
|
||||||
* **src/** : L’endroit principal où vous définissez votre application sous forme de code :
|
* **src/** : L’endroit principal où vous définissez votre application sous forme de code :
|
||||||
|
|
|
||||||
|
|
@ -53,12 +53,12 @@ Assurez-vous d'exécuter yarn dans le répertoire racine, puis d'exécuter `npx
|
||||||
|
|
||||||
#### Lint à l'enregistrement ne fonctionne pas
|
#### Lint à l'enregistrement ne fonctionne pas
|
||||||
|
|
||||||
Cela devrait fonctionner directement avec l'extension eslint installée. Si cela ne fonctionne pas, essayez d'ajouter ceci aux paramètres de votre vscode (dans le champ du conteneur de développement) :
|
Cela devrait fonctionner directement avec l'extension Oxc (`oxc.oxc-vscode`) installée. Si cela ne fonctionne pas, essayez d'ajouter ceci aux paramètres de votre vscode (dans le champ du conteneur de développement) :
|
||||||
|
|
||||||
```
|
```
|
||||||
"editor.codeActionsOnSave": {
|
"editor.codeActionsOnSave": {
|
||||||
|
|
||||||
"source.fixAll.eslint": "explicit"
|
"source.fixAll.oxc": "explicit"
|
||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ Ecco come appare ora lo stack tecnologico.
|
||||||
**Strumenti**
|
**Strumenti**
|
||||||
|
|
||||||
* [Yarn](https://yarnpkg.com/)
|
* [Yarn](https://yarnpkg.com/)
|
||||||
* [ESLint](https://eslint.org/)
|
* [Oxlint](https://oxc.rs/docs/guide/usage/linter.html)
|
||||||
|
|
||||||
**Sviluppo**
|
**Sviluppo**
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ Il progetto ha una struttura chiara e semplice, con un codice boilerplate minimo
|
||||||
|
|
||||||
* [Yarn](https://yarnpkg.com/)
|
* [Yarn](https://yarnpkg.com/)
|
||||||
* [Craco](https://craco.js.org/docs/)
|
* [Craco](https://craco.js.org/docs/)
|
||||||
* [ESLint](https://eslint.org/)
|
* [Oxlint](https://oxc.rs/docs/guide/usage/linter.html)
|
||||||
|
|
||||||
## Architettura
|
## Architettura
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -260,7 +260,7 @@ const StyledButton = styled.button`
|
||||||
|
|
||||||
## Applicare importazioni senza tipo
|
## Applicare importazioni senza tipo
|
||||||
|
|
||||||
Evita le importazioni di tipo. Per far rispettare questo standard, una regola di ESLint controlla e segnala qualsiasi violazione delle importazioni di tipo. Questo aiuta a mantenere la coerenza e la leggibilità del codice TypeScript.
|
Evita le importazioni di tipo. Per far rispettare questo standard, una regola di Oxlint controlla e segnala qualsiasi violazione delle importazioni di tipo. Questo aiuta a mantenere la coerenza e la leggibilità del codice TypeScript.
|
||||||
|
|
||||||
```tsx
|
```tsx
|
||||||
// ❌ Male
|
// ❌ Male
|
||||||
|
|
@ -281,10 +281,10 @@ import { Meta, StoryObj } from '@storybook/react';
|
||||||
|
|
||||||
* **Manutenibilità**: Migliora la manutenibilità della codebase perché gli sviluppatori possono identificare e individuare gli import solo di tipo durante la revisione o la modifica del codice.
|
* **Manutenibilità**: Migliora la manutenibilità della codebase perché gli sviluppatori possono identificare e individuare gli import solo di tipo durante la revisione o la modifica del codice.
|
||||||
|
|
||||||
### Regola ESLint
|
### Regola Oxlint
|
||||||
|
|
||||||
Una regola di ESLint, `@typescript-eslint/consistent-type-imports`, impone lo standard di coerenza per gli import di tipo. Questa regola genererà errori o avvisi per qualsiasi violazione relativa agli import di tipo.
|
Una regola di Oxlint, `typescript/consistent-type-imports`, impone lo standard di coerenza per gli import di tipo. Questa regola genererà errori o avvisi per qualsiasi violazione relativa agli import di tipo.
|
||||||
|
|
||||||
Tieni presente che questa regola affronta specificamente rari casi limite in cui si verificano import di tipo involontari. TypeScript stesso scoraggia questa pratica, come menzionato nelle [note di rilascio di TypeScript 3.8](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html). Nella maggior parte delle situazioni, non si dovrebbe aver bisogno di usare importazioni di solo tipo.
|
Tieni presente che questa regola affronta specificamente rari casi limite in cui si verificano import di tipo involontari. TypeScript stesso scoraggia questa pratica, come menzionato nelle [note di rilascio di TypeScript 3.8](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html). Nella maggior parte delle situazioni, non si dovrebbe aver bisogno di usare importazioni di solo tipo.
|
||||||
|
|
||||||
Per assicurarti che il tuo codice sia conforme a questa regola, assicurati di eseguire ESLint come parte del tuo flusso di lavoro di sviluppo.
|
Per assicurarti che il tuo codice sia conforme a questa regola, assicurati di eseguire Oxlint come parte del tuo flusso di lavoro di sviluppo.
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ my-twenty-app/
|
||||||
.yarnrc.yml
|
.yarnrc.yml
|
||||||
.yarn/
|
.yarn/
|
||||||
install-state.gz
|
install-state.gz
|
||||||
eslint.config.mjs
|
.oxlintrc.json
|
||||||
tsconfig.json
|
tsconfig.json
|
||||||
README.md
|
README.md
|
||||||
public/ # Cartella delle risorse pubbliche (immagini, font, ecc.)
|
public/ # Cartella delle risorse pubbliche (immagini, font, ecc.)
|
||||||
|
|
@ -130,7 +130,7 @@ A livello generale:
|
||||||
* **.gitignore**: Ignora i file generati comuni come `node_modules`, `.yarn`, `generated/` (client tipizzato), `dist/`, `build/`, cartelle di coverage, file di log e file `.env*`.
|
* **.gitignore**: Ignora i file generati comuni come `node_modules`, `.yarn`, `generated/` (client tipizzato), `dist/`, `build/`, cartelle di coverage, file di log e file `.env*`.
|
||||||
* **yarn.lock**, **.yarnrc.yml**, **.yarn/**: Bloccano e configurano la toolchain Yarn 4 utilizzata dal progetto.
|
* **yarn.lock**, **.yarnrc.yml**, **.yarn/**: Bloccano e configurano la toolchain Yarn 4 utilizzata dal progetto.
|
||||||
* **.nvmrc**: Fissa la versione di Node.js prevista dal progetto.
|
* **.nvmrc**: Fissa la versione di Node.js prevista dal progetto.
|
||||||
* **eslint.config.mjs** e **tsconfig.json**: Forniscono linting e configurazione TypeScript per i sorgenti TypeScript della tua app.
|
* **.oxlintrc.json** e **tsconfig.json**: Forniscono linting e configurazione TypeScript per i sorgenti TypeScript della tua app.
|
||||||
* **README.md**: Un breve README nella radice dell'app con istruzioni di base.
|
* **README.md**: Un breve README nella radice dell'app con istruzioni di base.
|
||||||
* **public/**: Una cartella per archiviare risorse pubbliche (immagini, font, file statici) che saranno servite con la tua applicazione. I file collocati qui vengono caricati durante la sincronizzazione e sono accessibili in fase di esecuzione.
|
* **public/**: Una cartella per archiviare risorse pubbliche (immagini, font, file statici) che saranno servite con la tua applicazione. I file collocati qui vengono caricati durante la sincronizzazione e sono accessibili in fase di esecuzione.
|
||||||
* **src/**: Il luogo principale in cui definisci la tua applicazione come codice
|
* **src/**: Il luogo principale in cui definisci la tua applicazione come codice
|
||||||
|
|
|
||||||
|
|
@ -54,12 +54,12 @@ Assicurati di eseguire yarn nella directory principale e poi esegui `npx nx serv
|
||||||
|
|
||||||
#### Lint on Save not working
|
#### Lint on Save not working
|
||||||
|
|
||||||
Questo dovrebbe funzionare direttamente con l'estensione eslint installata. Se questo non funziona prova ad aggiungere questo alle impostazioni di vscode (nello scope del container di sviluppo):
|
Questo dovrebbe funzionare direttamente con l'estensione Oxc (`oxc.oxc-vscode`) installata. Se questo non funziona prova ad aggiungere questo alle impostazioni di vscode (nello scope del container di sviluppo):
|
||||||
|
|
||||||
```
|
```
|
||||||
"editor.codeActionsOnSave": {
|
"editor.codeActionsOnSave": {
|
||||||
|
|
||||||
"source.fixAll.eslint": "explicit"
|
"source.fixAll.oxc": "explicit"
|
||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ Twenty は主にバックエンドに NestJS を使用しています。
|
||||||
**ツール**
|
**ツール**
|
||||||
|
|
||||||
* [Yarn](https://yarnpkg.com/)
|
* [Yarn](https://yarnpkg.com/)
|
||||||
* [ESLint](https://eslint.org/)
|
* [Oxlint](https://oxc.rs/docs/guide/usage/linter.html)
|
||||||
|
|
||||||
**開発**
|
**開発**
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ npx nx run twenty-front:storybook:coverage # (needs yarn storybook:serve:dev to
|
||||||
|
|
||||||
* [Yarn](https://yarnpkg.com/)
|
* [Yarn](https://yarnpkg.com/)
|
||||||
* [Craco](https://craco.js.org/docs/)
|
* [Craco](https://craco.js.org/docs/)
|
||||||
* [ESLint](https://eslint.org/)
|
* [Oxlint](https://oxc.rs/docs/guide/usage/linter.html)
|
||||||
|
|
||||||
## アーキテクチャ
|
## アーキテクチャ
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -260,7 +260,7 @@ const StyledButton = styled.button`
|
||||||
|
|
||||||
## タイプ無しのインポートの強制
|
## タイプ無しのインポートの強制
|
||||||
|
|
||||||
タイプインポートを避けてください。 タイプインポートを避けてください。 この標準を強制するために、ESLintルールがどのタイプのインポートもチェックして報告します。 これにより、TypeScriptコードの一貫性と可読性が維持されます。 これにより、TypeScriptコードの一貫性と可読性が維持されます。
|
タイプインポートを避けてください。 タイプインポートを避けてください。 この標準を強制するために、Oxlintルールがどのタイプのインポートもチェックして報告します。 これにより、TypeScriptコードの一貫性と可読性が維持されます。 これにより、TypeScriptコードの一貫性と可読性が維持されます。
|
||||||
|
|
||||||
```tsx
|
```tsx
|
||||||
// ❌ Bad
|
// ❌ Bad
|
||||||
|
|
@ -281,10 +281,10 @@ import { Meta, StoryObj } from '@storybook/react';
|
||||||
|
|
||||||
* **維持性**: コードベースの維持性を向上させます。開発者がコードを確認/変更する際に、タイプのみのインポートを特定して見つけることができるからです。
|
* **維持性**: コードベースの維持性を向上させます。開発者がコードを確認/変更する際に、タイプのみのインポートを特定して見つけることができるからです。
|
||||||
|
|
||||||
### ESLintルール
|
### Oxlintルール
|
||||||
|
|
||||||
ESLint のルール `@typescript-eslint/consistent-type-imports` は、型専用インポートの標準を強制します。 このルールは、タイプインポート違反のエラーや警告を生成します。
|
Oxlint のルール `typescript/consistent-type-imports` は、型専用インポートの標準を強制します。 このルールは、タイプインポート違反のエラーや警告を生成します。
|
||||||
|
|
||||||
このルールは、意図せず型をインポートしてしまう稀なエッジケースに特化して対処することに留意してください。 TypeScript自体、[TypeScript 3.8 リリースノート](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html)でこのプラクティスを避けています。 ほとんどの状況で、タイプのみのインポートを使用する必要はありません。 ほとんどの状況で、タイプのみのインポートを使用する必要はありません。 ほとんどの状況で、タイプのみのインポートを使用する必要はありません。
|
このルールは、意図せず型をインポートしてしまう稀なエッジケースに特化して対処することに留意してください。 TypeScript自体、[TypeScript 3.8 リリースノート](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html)でこのプラクティスを避けています。 ほとんどの状況で、タイプのみのインポートを使用する必要はありません。 ほとんどの状況で、タイプのみのインポートを使用する必要はありません。 ほとんどの状況で、タイプのみのインポートを使用する必要はありません。
|
||||||
|
|
||||||
コードがこのルールに準拠していることを確実にするため、開発ワークフローの一環として ESLint を実行してください。
|
コードがこのルールに準拠していることを確実にするため、開発ワークフローの一環として Oxlint を実行してください。
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ my-twenty-app/
|
||||||
.yarnrc.yml
|
.yarnrc.yml
|
||||||
.yarn/
|
.yarn/
|
||||||
install-state.gz
|
install-state.gz
|
||||||
eslint.config.mjs
|
.oxlintrc.json
|
||||||
tsconfig.json
|
tsconfig.json
|
||||||
README.md
|
README.md
|
||||||
src/
|
src/
|
||||||
|
|
@ -157,7 +157,7 @@ src/
|
||||||
* **.gitignore**: `node_modules`、`.yarn`、`generated/`(型付きクライアント)、`dist/`、`build/`、カバレッジ用フォルダー、ログファイル、`.env*` ファイルなどの一般的な生成物を無視します。
|
* **.gitignore**: `node_modules`、`.yarn`、`generated/`(型付きクライアント)、`dist/`、`build/`、カバレッジ用フォルダー、ログファイル、`.env*` ファイルなどの一般的な生成物を無視します。
|
||||||
* **yarn.lock**、**.yarnrc.yml**、**.yarn/**: プロジェクトで使用する Yarn 4 ツールチェーンをロックおよび構成します。
|
* **yarn.lock**、**.yarnrc.yml**、**.yarn/**: プロジェクトで使用する Yarn 4 ツールチェーンをロックおよび構成します。
|
||||||
* **.nvmrc**: プロジェクトで想定する Node.js バージョンを固定します。
|
* **.nvmrc**: プロジェクトで想定する Node.js バージョンを固定します。
|
||||||
* **eslint.config.mjs** と **tsconfig.json**: アプリの TypeScript ソース向けの Lint と TypeScript 設定を提供します。
|
* **.oxlintrc.json** と **tsconfig.json**: アプリの TypeScript ソース向けの Lint と TypeScript 設定を提供します。
|
||||||
* **README.md**: アプリのルートにある、基本的な手順を記した短い README。
|
* **README.md**: アプリのルートにある、基本的な手順を記した短い README。
|
||||||
* **src/**: The main place where you define your application-as-code:
|
* **src/**: The main place where you define your application-as-code:
|
||||||
* `application.config.ts`: アプリのグローバル設定(メタデータとランタイムの接続)。 「アプリケーション設定」を参照してください。
|
* `application.config.ts`: アプリのグローバル設定(メタデータとランタイムの接続)。 「アプリケーション設定」を参照してください。
|
||||||
|
|
|
||||||
|
|
@ -57,12 +57,12 @@ Twentyのインストール中に、postgresデータベースを適切なスキ
|
||||||
|
|
||||||
#### 保存時のLintが機能しない
|
#### 保存時のLintが機能しない
|
||||||
|
|
||||||
eslint拡張子がインストールされている場合、これは標準設定で動作するはずです。 eslint拡張子がインストールされている場合、これは標準設定で動作するはずです。 もしこれが機能しない場合、vscode設定で以下を追加してみてください(開発コンテナ範囲内で)。
|
Oxc拡張子 (`oxc.oxc-vscode`)がインストールされている場合、これは標準設定で動作するはずです。 もしこれが機能しない場合、vscode設定で以下を追加してみてください(開発コンテナ範囲内で)。
|
||||||
|
|
||||||
```
|
```
|
||||||
"editor.codeActionsOnSave": {
|
"editor.codeActionsOnSave": {
|
||||||
|
|
||||||
"source.fixAll.eslint": "explicit"
|
"source.fixAll.oxc": "explicit"
|
||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ Prisma가 우리가 처음으로 사용한 ORM이었습니다. 그러나 사용
|
||||||
**도구**
|
**도구**
|
||||||
|
|
||||||
* [Yarn](https://yarnpkg.com/)
|
* [Yarn](https://yarnpkg.com/)
|
||||||
* [ESLint](https://eslint.org/)
|
* [Oxlint](https://oxc.rs/docs/guide/usage/linter.html)
|
||||||
|
|
||||||
**개발**
|
**개발**
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ npx nx run twenty-front:storybook:coverage # (needs yarn storybook:serve:dev to
|
||||||
|
|
||||||
* [Yarn](https://yarnpkg.com/)
|
* [Yarn](https://yarnpkg.com/)
|
||||||
* [Craco](https://craco.js.org/docs/)
|
* [Craco](https://craco.js.org/docs/)
|
||||||
* [ESLint](https://eslint.org/)
|
* [Oxlint](https://oxc.rs/docs/guide/usage/linter.html)
|
||||||
|
|
||||||
## 아키텍처
|
## 아키텍처
|
||||||
|
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue