Skip to content

The micro-VM for AI agents — light enough to embed on your laptop, elastic enough to power an agentic cloud.

3.1 KB
Raw Blame
import nx from '@nx/eslint-plugin'
import react from 'eslint-plugin-react'
import reactHooks from 'eslint-plugin-react-hooks'

/** @type {import('eslint').Linter.Config[]} */
export default [
  ...nx.configs['flat/base'],
  ...nx.configs['flat/typescript'],
  ...nx.configs['flat/javascript'],
  {
    // Workspace-wide ignores. Patterns are relative to this config (apps/).
    // Adapted from the upstream project's root-level config for the
    // BoxLite layout where lint scripts run with cwd=apps/ instead of root.
    ignores: [
      '**/dist',
      '**/node_modules/**',
      '**/.nx/**',
      '**/.sst/**',
      '**/vite.config.*.timestamp*',
      '**/vitest.config.*.timestamp*',
      'docs/**',
      'libs/*api-client*/**',
    ],
  },
  {
    files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
    plugins: {
      react,
      'react-hooks': reactHooks,
    },
    rules: {
      '@nx/enforce-module-boundaries': [
        'error',
        {
          enforceBuildableLibDependency: true,
          allow: [
            '^.*/eslint(\\.base)?\\.config\\.[cm]?js$',
            // Plain shared modules with no package of their own: the API and mdeploy parse
            // FILESTORE_INSTANCES with one parser, and mbuild's workflow tests read the same
            // .github sources as mdeploy's. A package would add a link and build step to each.
            '^\\.\\./\\.\\./\\.\\./shared/filestore-instances(\\.ts)?$',
            '^\\.\\./\\.\\./mdeploy/test/workflow-source\\.js$',
          ],
          // Bootstrap and deployment load these helpers eagerly; mdeploy CLI entry points stay lazy.
          checkDynamicDependenciesExceptions: [
            'mdeploy/hosts',
            'mdeploy/runner-binary',
            'mdeploy/runner-kernel',
            'mdeploy/clickhouse-retention',
          ],
          depConstraints: [
            {
              sourceTag: '*',
              onlyDependOnLibsWithTags: ['*'],
            },
          ],
        },
      ],
    },
  },
  {
    files: ['**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts', '**/*.js', '**/*.jsx', '**/*.cjs', '**/*.mjs'],
    // Override or add rules here. Rules disabled below cover pre-existing
    // patterns in the BoxLite apps workspace (e.g. SST-generated config in
    // apps/infra/sst.config.ts uses triple-slash refs + $-escapes; empty
    // arrow/method stubs in test fixtures; `let`s never reassigned in
    // existing code) that the lint pipeline is not in scope to refactor.
    rules: {
      '@typescript-eslint/interface-name-prefix': 'off',
      '@typescript-eslint/explicit-function-return-type': 'off',
      '@typescript-eslint/explicit-module-boundary-types': 'off',
      '@typescript-eslint/no-explicit-any': 'off',
      '@typescript-eslint/no-useless-escape': 'off',
      '@typescript-eslint/triple-slash-reference': 'off',
      '@typescript-eslint/no-empty-function': 'off',
      'no-useless-escape': 'off',
      'prefer-const': 'off',
    },
  },
  {
    // Match migration files in any subproject (e.g. apps/api/src/migrations/...).
    files: ['**/src/migrations/**/*.ts'],
    rules: {
      quotes: 'off',
    },
  },
]