Files
twenty/packages/twenty-eslint-rules/index.ts
T
Charles Bochet 121788c42f Fully deprecate old recoil (#18210)
## Summary

Removes the `recoil` dependency entirely from `package.json` and
`twenty-front/package.json`, completing the migration to Jotai as the
sole state management library.

Removes all Recoil infrastructure: `RecoilRoot` wrapper from `App.tsx`
and test decorators, `RecoilDebugObserver`, Recoil-specific ESLint rules
(`use-getLoadable-and-getValue-to-get-atoms`,
`useRecoilCallback-has-dependency-array`), and legacy Recoil utility
hooks/types (`useRecoilComponentState`, `useRecoilComponentValue`,
`createComponentState`, `createFamilyState`, `getSnapshotValue`,
`cookieStorageEffect`, `localStorageEffect`, etc.).

Renames all `V2`-suffixed Jotai state files and types to their canonical
names (e.g., `ComponentStateV2` -> `ComponentState`,
`agentChatInputStateV2` -> `agentChatInputState`, `SelectorCallbacksV2`
-> `SelectorCallbacks`), and removes the now-redundant V1 counterparts.

Updates ~433 files across the codebase to use the renamed Jotai imports,
remove Recoil imports, and clean up test wrappers (`RecoilRootDecorator`
-> `JotaiRootDecorator`).
2026-02-25 12:26:42 +01:00

108 lines
3.5 KiB
TypeScript

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 explicitBooleanPredicatesInIf,
RULE_NAME as explicitBooleanPredicatesInIfName,
} from './rules/explicit-boolean-predicates-in-if';
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 mdxComponentNewlines,
RULE_NAME as mdxComponentNewlinesName,
} from './rules/mdx-component-newlines';
import {
rule as noAngleBracketPlaceholders,
RULE_NAME as noAngleBracketPlaceholdersName,
} from './rules/no-angle-bracket-placeholders';
import {
rule as noHardcodedColors,
RULE_NAME as noHardcodedColorsName,
} from './rules/no-hardcoded-colors';
import {
rule as noNavigatePreferLink,
RULE_NAME as noNavigatePreferLinkName,
} from './rules/no-navigate-prefer-link';
import {
rule as noStateUseref,
RULE_NAME as noStateUserefName,
} from './rules/no-state-useref';
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 your custom workspace rules at the top of this file.
*
* For example:
*
* import { RULE_NAME as myCustomRuleName, rule as myCustomRule } from './rules/my-custom-rule';
*
* In order to quickly get started with writing rules you can use the
* following generator command and provide your desired rule name:
*
* ```sh
* npx nx g @nx/eslint:workspace-rule {{ NEW_RULE_NAME }}
* ```
*/
module.exports = {
/**
* Apply the imported custom rules here.
*
* For example (using the example import above):
*
* rules: {
* [myCustomRuleName]: myCustomRule
* }
*/
rules: {
[componentPropsNamingName]: componentPropsNaming,
[effectComponentsName]: effectComponents,
[matchingStateVariableName]: matchingStateVariable,
[noHardcodedColorsName]: noHardcodedColors,
[noStateUserefName]: noStateUseref,
[sortCssPropertiesAlphabeticallyName]: sortCssPropertiesAlphabetically,
[styledComponentsPrefixedWithStyledName]:
styledComponentsPrefixedWithStyled,
[explicitBooleanPredicatesInIfName]: explicitBooleanPredicatesInIf,
[maxConstsPerFileName]: maxConstsPerFile,
[noNavigatePreferLinkName]: noNavigatePreferLink,
[injectWorkspaceRepositoryName]: injectWorkspaceRepository,
[restApiMethodsShouldBeGuardedName]: restApiMethodsShouldBeGuarded,
[graphqlResolversShouldBeGuardedName]: graphqlResolversShouldBeGuarded,
[mdxComponentNewlinesName]: mdxComponentNewlines,
[noAngleBracketPlaceholdersName]: noAngleBracketPlaceholders,
},
};