js-browser-architecture-contract_v2

ID 4
UUID 35d63221-a407-4ede-a60b-577f5fbfad61
Version 2.0
Status active
Scope
Erstellt 2025-12-20 10:59:58 von migration
Aktualisiert 2025-12-22 09:43:02

YAML-Inhalt

contract:
  name: js-browser-architecture
  version: "2.0"
  status: active
  description: |
    Architektur-Contract für native Browser-JavaScript (ES Modules).
    Migriert auf Meta-Schema v1.0 am 22.12.2025.

  created: "2025-12-15"
  author: migration

  scope:
    paths:
      - "/public/js/**/*.js"
    excludes:
      - "/public/js/vendor/**"

  rules:
    - id: no-var
      check_type: forbidden_pattern
      patterns:
        - "var "
      in_files: "**/*.js"
      severity: major
      description: "var ist verboten - verwende const oder let"

    - id: no-double-equals
      check_type: forbidden_pattern
      patterns:
        - "=="
        - "!="
      in_files: "**/*.js"
      exclude_files:
        - "**/vendor/**"
      severity: major
      description: "== und != sind verboten - verwende === und !=="

    - id: no-commonjs
      check_type: forbidden_pattern
      patterns:
        - "require("
        - "module.exports"
      in_files: "**/*.js"
      severity: critical
      description: "CommonJS ist verboten - verwende ES Modules"

    - id: no-eval
      check_type: forbidden_pattern
      patterns:
        - "eval("
        - "new Function("
      in_files: "**/*.js"
      severity: critical
      description: "eval und new Function sind verboten (Security)"

    - id: no-global-variables
      check_type: forbidden_pattern
      patterns:
        - "window."
        - "document."
      in_files: "**/*.js"
      exclude_files:
        - "**/adapters/**"
      severity: major
      description: "Globale Zugriffe nur in Adapters erlaubt"

    - id: es-modules
      check_type: required_pattern
      patterns:
        - "export"
        - "import"
      in_files: "**/*.js"
      exclude_files:
        - "**/vendor/**"
      severity: info
      description: "ES Module Syntax verwenden"

  enforcement:
    on_violation: warn

  pass_threshold:
    critical_max: 0
    major_max: 2
    minor_max: 5

Aktionen

Bearbeiten

Versionshistorie

Version Geändert am Von Beschreibung
2.0 (aktuell) 2025-12-22 09:43:02 - -
1.0 2025-12-22 09:43:02 claude Migration auf Meta-Schema v1.0: scope.paths als Array, rules extrahiert

← Zurück zur Übersicht