Skip to content

The open alternative to Salesforce, designed for AI.

3.9 KB
Raw Blame
{
  "$schema": "./node_modules/oxlint/configuration_schema.json",
  "plugins": ["react", "typescript", "import", "unicorn", "jsx-a11y"],
  "jsPlugins": ["../twenty-oxlint-rules/dist/oxlint-plugin.mjs"],
  "categories": {
    "correctness": "off"
  },
  "ignorePatterns": ["node_modules", "generated", "**/*.module.scss.d.ts"],
  "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": "off",

    "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": "^_"
      }
    ],

    "twenty/no-miscased-acronym-in-identifier": "error",
    "twenty/enforce-module-boundaries": [
      "error",
      {
        "depConstraints": [
          {
            "sourceTag": "scope:shared",
            "onlyDependOnLibsWithTags": ["scope:shared"]
          }
        ]
      }
    ],
    "twenty/no-storybook-a11y-disable": "error",

    "jsx-a11y/alt-text": "error",
    "jsx-a11y/anchor-has-content": "error",
    "jsx-a11y/anchor-is-valid": "error",
    "jsx-a11y/aria-activedescendant-has-tabindex": "error",
    "jsx-a11y/aria-props": "error",
    "jsx-a11y/aria-proptypes": "error",
    "jsx-a11y/aria-role": "error",
    "jsx-a11y/aria-unsupported-elements": "error",
    "jsx-a11y/heading-has-content": "error",
    "jsx-a11y/iframe-has-title": "error",
    "jsx-a11y/img-redundant-alt": "error",
    "jsx-a11y/label-has-associated-control": "error",
    "jsx-a11y/no-access-key": "error",
    "jsx-a11y/no-aria-hidden-on-focusable": "error",
    "jsx-a11y/no-noninteractive-tabindex": "error",
    "jsx-a11y/no-redundant-roles": "error",
    "jsx-a11y/role-has-required-aria-props": "error",
    "jsx-a11y/role-supports-aria-props": "error",
    "jsx-a11y/tabindex-no-positive": "error",
    "jsx-a11y/click-events-have-key-events": "error",
    "jsx-a11y/mouse-events-have-key-events": "error",

    "jsx-a11y/no-static-element-interactions": "warn",
    "jsx-a11y/no-autofocus": "warn"
  },
  "overrides": [
    {
      "files": [
        "src/theme/*.ts",
        "src/theme/*.tsx",
        "src/theme/constants/**/*.ts",
        "src/theme/internal/**/*.ts"
      ],
      "rules": {
        "no-restricted-imports": [
          "error",
          {
            "paths": [
              {
                "name": "react",
                "allowImportNames": ["default"],
                "allowTypeImports": true,
                "message": "twenty-ui/theme must load under the react-server condition, where React has no createContext or hooks. Import React as a default and call its APIs, such as React.useState, at render time."
              }
            ]
          }
        ]
      }
    }
  ]
}