Skip to content

The open alternative to Salesforce, designed for AI.

5.5 KB
Raw Blame
import { definePlugin } from '@oxlint/plugins';

import {
  rule as applicationTargetGuards,
  RULE_NAME as applicationTargetGuardsName,
} from './rules/application-target-guards';
import {
  rule as componentPropsNaming,
  RULE_NAME as componentPropsNamingName,
} from './rules/component-props-naming';
import {
  rule as effectComponents,
  RULE_NAME as effectComponentsName,
} from './rules/effect-components';
import {
  rule as enforceModuleBoundaries,
  RULE_NAME as enforceModuleBoundariesName,
} from './rules/enforce-module-boundaries';
import {
  rule as folderStructure,
  RULE_NAME as folderStructureName,
} from './rules/folder-structure';
import {
  rule as graphqlResolversShouldBeGuarded,
  RULE_NAME as graphqlResolversShouldBeGuardedName,
} from './rules/graphql-resolvers-should-be-guarded';
import {
  rule as injectWorkspaceRepository,
  RULE_NAME as injectWorkspaceRepositoryName,
} from './rules/inject-workspace-repository';
import {
  rule as matchingStateVariable,
  RULE_NAME as matchingStateVariableName,
} from './rules/matching-state-variable';
import {
  rule as maxConstsPerFile,
  RULE_NAME as maxConstsPerFileName,
} from './rules/max-consts-per-file';
import {
  rule as noDataMutationInFastInstanceCommand,
  RULE_NAME as noDataMutationInFastInstanceCommandName,
} from './rules/no-data-mutation-in-fast-instance-command';
import {
  rule as noDirectAtomFamilyInSelector,
  RULE_NAME as noDirectAtomFamilyInSelectorName,
} from './rules/no-direct-atom-family-in-selector';
import {
  rule as noHardcodedColors,
  RULE_NAME as noHardcodedColorsName,
} from './rules/no-hardcoded-colors';
import {
  rule as noIcuEscapingApostrophe,
  RULE_NAME as noIcuEscapingApostropheName,
} from './rules/no-icu-escaping-apostrophe';
import {
  rule as noJotaiStoreInSelector,
  RULE_NAME as noJotaiStoreInSelectorName,
} from './rules/no-jotai-store-in-selector';
import {
  rule as noMiscasedAcronymInIdentifier,
  RULE_NAME as noMiscasedAcronymInIdentifierName,
} from './rules/no-miscased-acronym-in-identifier';
import {
  rule as noMiscasedAcronymInMessage,
  RULE_NAME as noMiscasedAcronymInMessageName,
} from './rules/no-miscased-acronym-in-message';
import {
  rule as noNavigatePreferLink,
  RULE_NAME as noNavigatePreferLinkName,
} from './rules/no-navigate-prefer-link';
import {
  rule as noRuntimeImportFromUpgradeCommand,
  RULE_NAME as noRuntimeImportFromUpgradeCommandName,
} from './rules/no-runtime-import-from-upgrade-command';
import {
  rule as noStateUseref,
  RULE_NAME as noStateUserefName,
} from './rules/no-state-useref';
import {
  rule as noStorybookA11yDisable,
  RULE_NAME as noStorybookA11yDisableName,
} from './rules/no-storybook-a11y-disable';
import {
  rule as noTwentyUiOverride,
  RULE_NAME as noTwentyUiOverrideName,
} from './rules/no-twenty-ui-override';
import {
  rule as noWindowOpen,
  RULE_NAME as noWindowOpenName,
} from './rules/no-window-open';
import {
  rule as preferWorkspaceScopedRepository,
  RULE_NAME as preferWorkspaceScopedRepositoryName,
} from './rules/prefer-workspace-scoped-repository';
import {
  rule as restApiMethodsShouldBeGuarded,
  RULE_NAME as restApiMethodsShouldBeGuardedName,
} from './rules/rest-api-methods-should-be-guarded';
import {
  rule as sortCssPropertiesAlphabetically,
  RULE_NAME as sortCssPropertiesAlphabeticallyName,
} from './rules/sort-css-properties-alphabetically';
import {
  rule as styledComponentsPrefixedWithStyled,
  RULE_NAME as styledComponentsPrefixedWithStyledName,
} from './rules/styled-components-prefixed-with-styled';
import {
  rule as typesFolderFilename,
  RULE_NAME as typesFolderFilenameName,
} from './rules/types-folder-filename';
import {
  rule as upgradeCommandFilename,
  RULE_NAME as upgradeCommandFilenameName,
} from './rules/upgrade-command-filename';

export default definePlugin({
  meta: { name: 'twenty' },
  rules: {
    [applicationTargetGuardsName]: applicationTargetGuards,
    [componentPropsNamingName]: componentPropsNaming,
    [effectComponentsName]: effectComponents,
    [enforceModuleBoundariesName]: enforceModuleBoundaries,
    [folderStructureName]: folderStructure,
    [graphqlResolversShouldBeGuardedName]: graphqlResolversShouldBeGuarded,
    [injectWorkspaceRepositoryName]: injectWorkspaceRepository,
    [matchingStateVariableName]: matchingStateVariable,
    [maxConstsPerFileName]: maxConstsPerFile,
    [noDataMutationInFastInstanceCommandName]:
      noDataMutationInFastInstanceCommand,
    [noDirectAtomFamilyInSelectorName]: noDirectAtomFamilyInSelector,
    [noHardcodedColorsName]: noHardcodedColors,
    [noIcuEscapingApostropheName]: noIcuEscapingApostrophe,
    [noJotaiStoreInSelectorName]: noJotaiStoreInSelector,
    [noMiscasedAcronymInIdentifierName]: noMiscasedAcronymInIdentifier,
    [noMiscasedAcronymInMessageName]: noMiscasedAcronymInMessage,
    [noNavigatePreferLinkName]: noNavigatePreferLink,
    [noRuntimeImportFromUpgradeCommandName]: noRuntimeImportFromUpgradeCommand,
    [noStateUserefName]: noStateUseref,
    [noStorybookA11yDisableName]: noStorybookA11yDisable,
    [noTwentyUiOverrideName]: noTwentyUiOverride,
    [noWindowOpenName]: noWindowOpen,
    [preferWorkspaceScopedRepositoryName]: preferWorkspaceScopedRepository,
    [restApiMethodsShouldBeGuardedName]: restApiMethodsShouldBeGuarded,
    [sortCssPropertiesAlphabeticallyName]: sortCssPropertiesAlphabetically,
    [styledComponentsPrefixedWithStyledName]:
      styledComponentsPrefixedWithStyled,
    [typesFolderFilenameName]: typesFolderFilename,
    [upgradeCommandFilenameName]: upgradeCommandFilename,
  },
});