Fix lint issues (#11475)

This commit is contained in:
Charles Bochet
2025-04-09 17:35:25 +02:00
committed by GitHub
parent b6c079f050
commit e23688cb41
10 changed files with 123 additions and 77 deletions

View File

@ -1,5 +1,6 @@
REACT_APP_SERVER_BASE_URL=http://localhost:3000
VITE_BUILD_SOURCEMAP=false
VITE_DISABLE_ESLINT_CHECKER=true
# ———————— Optional ————————

View File

@ -1,19 +1,22 @@
const path = require('path');
module.exports = {
extends: ['../../.eslintrc.global.cjs', '../../.eslintrc.react.cjs'],
extends: ['../../.eslintrc.react.cjs'],
ignorePatterns: [
'node_modules',
'mockServiceWorker.js',
'**/generated*/*',
'**/generated/standard-metadata-query-result.ts',
'tsup.config.ts',
'build',
'coverage',
'storybook-static',
'**/*config.js',
'jest.config.ts',
'emotion.d.ts',
'lingui.config.ts',
'vite.config.ts',
'setupTests.ts',
'codegen*',
'tsup.ui.index.tsx',
'__mocks__',
],
overrides: [
@ -22,66 +25,6 @@ module.exports = {
parserOptions: {
project: ['packages/twenty-front/tsconfig.*.json'],
},
// plugins: ['project-structure'],
settings: {
// 'project-structure/folder-structure-config-path': path.join(
// __dirname,
// 'folderStructure.json',
// ),
},
rules: {
// 'project-structure/folder-structure': 'error',
/*
Uncomment this rule when we have a way to work on
'lingui/no-unlocalized-strings': [
'error',
{
ignore: [
'^(?![A-Z])\\S+$',
'^[A-Z0-9_-]+$'
],
ignoreNames: [
{ regex: { pattern: 'className', flags: 'i' } },
{ regex: { pattern: '^[A-Z0-9_-]+$' } },
'styleName',
'src',
'srcSet',
'type',
'id',
'width',
'height',
'displayName',
'Authorization'
],
ignoreFunctions: [
'cva',
'cn',
'track',
'Error',
'console.*',
'*headers.set',
'*.addEventListener',
'*.removeEventListener',
'*.postMessage',
'*.getElementById',
'*.dispatch',
'*.commit',
'*.includes',
'*.indexOf',
'*.endsWith',
'*.startsWith',
'require'
],
useTsTypes: true,
ignoreMethodsOnTypes: [
'Map.get',
'Map.has',
'Set.has'
]
}
]
*/
},
},
],
};

View File

@ -1,4 +1,3 @@
/* eslint-disable @nx/workspace-max-consts-per-file */
import { getTimezoneOffset } from 'date-fns-tz';
import { AVAILABLE_TIME_ZONE_OPTIONS_BY_LABEL } from '@/settings/accounts/constants/AvailableTimezoneOptionsByLabel';
@ -6,7 +5,6 @@ import { AVAILABLE_TIME_ZONE_OPTIONS_BY_LABEL } from '@/settings/accounts/consta
export const AVAILABLE_TIMEZONE_OPTIONS = Object.values(
AVAILABLE_TIME_ZONE_OPTIONS_BY_LABEL,
).sort((optionA, optionB) => {
// eslint-disable-next-line @typescript-eslint/naming-convention
const difference =
getTimezoneOffset(optionA.value) - getTimezoneOffset(optionB.value);

View File

@ -1,5 +1,3 @@
/* eslint-disable @typescript-eslint/naming-convention */
/* eslint-disable @nx/workspace-max-consts-per-file */
import { IANA_TIME_ZONES } from '@/localization/constants/IanaTimeZones';
import { formatTimeZoneLabel } from '@/localization/utils/formatTimeZoneLabel';
import { SelectOption } from 'twenty-ui/input';

View File

@ -3,7 +3,6 @@ import { Select, SelectValue } from '@/ui/input/components/Select';
import styled from '@emotion/styled';
import { Meta, StoryObj } from '@storybook/react';
import { useState } from 'react';
import { ComponentDecorator } from 'twenty-ui/testing';
import {
IconLanguage,
IconLayoutKanban,
@ -12,6 +11,7 @@ import {
IconTable,
IconUsers,
} from 'twenty-ui/display';
import { ComponentDecorator } from 'twenty-ui/testing';
const StyledContainer = styled.div`
width: 480px;

View File

@ -1,18 +1,15 @@
import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import { useEffect, useMemo, useRef, useState } from 'react';
import { IMaskInput, IMaskInputProps } from 'react-imask';
import { useRegisterInputEvents } from '@/object-record/record-field/meta-types/input/hooks/useRegisterInputEvents';
import { SETTINGS_FIELD_CURRENCY_CODES } from '@/settings/data-model/constants/SettingsFieldCurrencyCodes';
import { CurrencyPickerDropdownButton } from '@/ui/input/components/internal/currency/components/CurrencyPickerDropdownButton';
import { IMaskInput } from 'react-imask';
import { IconComponent } from 'twenty-ui/display';
import { TEXT_INPUT_STYLE } from 'twenty-ui/theme';
type StyledInputProps = React.ComponentProps<'input'> &
IMaskInputProps<HTMLInputElement>;
export const StyledIMaskInput = styled(IMaskInput)<StyledInputProps>`
export const StyledIMaskInput = styled(IMaskInput)`
margin: 0;
${TEXT_INPUT_STYLE}
width: 100%;

View File

@ -1,4 +1,3 @@
/* eslint-disable no-redeclare */
/* eslint-disable prefer-arrow/prefer-arrow-functions */
import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';
import { ComponentFamilyReadOnlySelectorV2 } from '@/ui/utilities/state/component-state/types/ComponentFamilyReadOnlySelectorV2';

View File

@ -1,4 +1,3 @@
/* eslint-disable no-redeclare */
/* eslint-disable prefer-arrow/prefer-arrow-functions */
import { selectorFamily, SerializableParam } from 'recoil';

View File

@ -1,4 +1,3 @@
/* eslint-disable no-redeclare */
/* eslint-disable prefer-arrow/prefer-arrow-functions */
import { selectorFamily } from 'recoil';