diff --git a/.eslintrc.js b/.eslintrc.cjs similarity index 88% rename from .eslintrc.js rename to .eslintrc.cjs index 4299282996..f3c5d3d0a8 100644 --- a/.eslintrc.js +++ b/.eslintrc.cjs @@ -4,6 +4,7 @@ module.exports = { plugins: [ '@nx', 'prefer-arrow', + 'import', 'simple-import-sort', 'unused-imports', 'unicorn', @@ -11,9 +12,10 @@ module.exports = { rules: { 'func-style': ['error', 'declaration', { allowArrowFunctions: true }], 'no-console': ['warn', { allow: ['group', 'groupCollapsed', 'groupEnd'] }], - 'no-unused-vars': 'off', 'no-control-regex': 0, + 'no-duplicate-imports': 'error', 'no-undef': 'off', + 'no-unused-vars': 'off', '@nx/enforce-module-boundaries': [ 'error', @@ -29,6 +31,10 @@ module.exports = { }, ], + 'import/no-relative-packages': 'error', + 'import/no-useless-path-segments': 'error', + 'import/no-duplicates': ['error', { considerQueryString: true }], + 'prefer-arrow/prefer-arrow-functions': [ 'error', { @@ -43,7 +49,7 @@ module.exports = { { groups: [ ['^react', '^@?\\w'], - ['^(@|~)(/.*|$)'], + ['^(@|~|src)(/.*|$)'], ['^\\u0000'], ['^\\.\\.(?!/?$)', '^\\.\\./?$'], ['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'], @@ -70,9 +76,20 @@ module.exports = { extends: ['plugin:@nx/typescript'], rules: { '@typescript-eslint/ban-ts-comment': 'error', - '@typescript-eslint/interface-name-prefix': 'off', + '@typescript-eslint/consistent-type-imports': [ + 'error', + { prefer: 'no-type-imports' }, + ], '@typescript-eslint/explicit-function-return-type': 'off', '@typescript-eslint/explicit-module-boundary-types': 'off', + '@typescript-eslint/interface-name-prefix': 'off', + '@typescript-eslint/no-empty-function': 'off', + '@typescript-eslint/no-empty-interface': [ + 'error', + { + allowSingleExtends: true, + }, + ], '@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/no-empty-function': 'off', '@typescript-eslint/no-unused-vars': [ @@ -84,14 +101,6 @@ module.exports = { argsIgnorePattern: '^_', }, ], - '@typescript-eslint/consistent-type-imports': [ - 'error', - { prefer: 'no-type-imports' }, - ], - '@typescript-eslint/no-empty-interface': [ - 'error', - { allowSingleExtends: true }, - ], }, }, { @@ -108,12 +117,6 @@ module.exports = { '@typescript-eslint/no-non-null-assertion': 'off', }, }, - { - files: ['*.stories.@(ts|tsx|js|jsx)'], - rules: { - '@typescript-eslint/no-non-null-assertion': 'off', - }, - }, { files: ['**/constants/*.ts', '**/*.constants.ts'], rules: { @@ -135,5 +138,9 @@ module.exports = { '@nx/workspace-max-consts-per-file': ['error', { max: 1 }], }, }, + { + files: ['*.json'], + parser: 'jsonc-eslint-parser', + }, ], }; diff --git a/.eslintrc.react.cjs b/.eslintrc.react.cjs new file mode 100644 index 0000000000..22000fa33f --- /dev/null +++ b/.eslintrc.react.cjs @@ -0,0 +1,80 @@ +module.exports = { + extends: [ + 'plugin:@nx/react', + 'plugin:react/recommended', + 'plugin:react-hooks/recommended', + 'plugin:storybook/recommended', + ], + plugins: ['react-hooks', 'react-refresh'], + overrides: [ + { + files: ['*.ts', '*.tsx'], + parserOptions: { + project: ['./tsconfig.base.{json,*.json}'], + }, + rules: { + 'no-restricted-imports': [ + 'error', + { + patterns: [ + { + group: ['@tabler/icons-react'], + message: 'Please import icons from `twenty-ui`', + }, + { + group: ['react-hotkeys-web-hook'], + importNames: ['useHotkeys'], + message: + 'Please use the custom wrapper: `useScopedHotkeys` from `twenty-ui`', + }, + ], + }, + ], + '@nx/workspace-effect-components': 'error', + '@nx/workspace-no-hardcoded-colors': 'error', + '@nx/workspace-matching-state-variable': 'error', + '@nx/workspace-sort-css-properties-alphabetically': 'error', + '@nx/workspace-styled-components-prefixed-with-styled': 'error', + '@nx/workspace-no-state-useref': 'error', + '@nx/workspace-component-props-naming': 'error', + '@nx/workspace-explicit-boolean-predicates-in-if': 'error', + '@nx/workspace-use-getLoadable-and-getValue-to-get-atoms': 'error', + '@nx/workspace-useRecoilCallback-has-dependency-array': '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': [ + 'error', + { + explicitSpread: 'ignore', + }, + ], + 'react-hooks/exhaustive-deps': [ + 'warn', + { + additionalHooks: 'useRecoilCallback', + }, + ], + }, + }, + { + files: ['*.stories.@(ts|tsx|js|jsx)'], + rules: { + '@typescript-eslint/no-non-null-assertion': 'off', + }, + }, + { + files: ['.storybook/main.@(js|cjs|mjs|ts)'], + rules: { + 'storybook/no-uninstalled-addons': [ + 'error', + { packageJsonLocation: '../../package.json' }, + ], + }, + }, + ], +}; diff --git a/.gitignore b/.gitignore index 61f4800487..fb8264316f 100644 --- a/.gitignore +++ b/.gitignore @@ -16,9 +16,10 @@ !.yarn/releases !.yarn/sdks !.yarn/versions -coverage .vercel **/**/logs/** +coverage +dist storybook-static diff --git a/package.json b/package.json index 1b3e438b05..9f26feabca 100644 --- a/package.json +++ b/package.json @@ -193,6 +193,7 @@ "@nestjs/cli": "^9.0.0", "@nestjs/schematics": "^9.0.0", "@nestjs/testing": "^9.0.0", + "@next/eslint-plugin-next": "^14.1.4", "@nx/eslint": "18.1.3", "@nx/eslint-plugin": "18.1.3", "@nx/jest": "18.1.3", @@ -269,7 +270,7 @@ "eslint": "^8.53.0", "eslint-config-next": "14.0.4", "eslint-config-prettier": "^9.1.0", - "eslint-plugin-import": "^2.27.5", + "eslint-plugin-import": "2.29.1", "eslint-plugin-jsx-a11y": "^6.8.0", "eslint-plugin-prefer-arrow": "^1.2.3", "eslint-plugin-prettier": "^5.1.2", diff --git a/packages/twenty-chrome-extension/.eslintrc.cjs b/packages/twenty-chrome-extension/.eslintrc.cjs index afc60a95a6..8dbe0179d2 100644 --- a/packages/twenty-chrome-extension/.eslintrc.cjs +++ b/packages/twenty-chrome-extension/.eslintrc.cjs @@ -1,60 +1,14 @@ -// eslint-disable-next-line -const path = require('path'); - module.exports = { - extends: [ - 'plugin:@nx/react', - 'plugin:react/recommended', - 'plugin:react-hooks/recommended', - 'plugin:storybook/recommended', - '../../.eslintrc.js', - ], - plugins: ['react-hooks', 'react-refresh'], + extends: ['../../.eslintrc.cjs', '../../.eslintrc.react.cjs'], ignorePatterns: ['!**/*', 'node_modules', 'dist', 'src/generated/*.tsx'], - rules: { - '@nx/workspace-effect-components': 'error', - '@nx/workspace-no-hardcoded-colors': 'error', - '@nx/workspace-matching-state-variable': 'error', - '@nx/workspace-sort-css-properties-alphabetically': 'error', - '@nx/workspace-styled-components-prefixed-with-styled': 'error', - '@nx/workspace-no-state-useref': 'error', - '@nx/workspace-component-props-naming': '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': [ - 'error', - { - explicitSpread: 'ignore', - }, - ], - }, overrides: [ { - files: ['*.ts', '*.tsx', '*.js', '*.jsx'], + files: ['*.ts', '*.tsx'], parserOptions: { - project: ['packages/twenty-chrome-extension/tsconfig.*?.json'], + project: ['packages/twenty-chrome-extension/tsconfig.{json,*.json}'], }, - rules: {}, - }, - { - files: ['.storybook/main.@(js|cjs|mjs|ts)'], rules: { - 'storybook/no-uninstalled-addons': [ - 'error', - { packageJsonLocation: path.resolve('../../package.json') }, - ], - }, - }, - { - files: ['.storybook/**/*', '**/*.stories.tsx', '**/*.test.@(ts|tsx)'], - rules: { - 'no-console': 'off', + '@nx/workspace-explicit-boolean-predicates-in-if': 'warn', }, }, ], diff --git a/packages/twenty-chrome-extension/src/utils/requestDb.ts b/packages/twenty-chrome-extension/src/utils/requestDb.ts index 727a73b25b..a160a58aa2 100644 --- a/packages/twenty-chrome-extension/src/utils/requestDb.ts +++ b/packages/twenty-chrome-extension/src/utils/requestDb.ts @@ -1,4 +1,5 @@ import { OperationVariables } from '@apollo/client'; +import { isUndefined } from '@sniptt/guards'; import { DocumentNode } from 'graphql'; import getApolloClient from '~/utils/apolloClient'; @@ -11,11 +12,9 @@ export const callQuery = async ( const { data, error } = await client.query({ query, variables }); - if (error) throw new Error(error.message); + if (!isUndefined(error)) throw new Error(error.message); - if (data) return data; - - return null; + return data ?? null; }; export const callMutation = async ( @@ -26,9 +25,7 @@ export const callMutation = async ( const { data, errors } = await client.mutate({ mutation, variables }); - if (errors) throw new Error(errors[0].message); + if (!isUndefined(errors)) throw new Error(errors[0].message); - if (data) return data; - - return null; + return data ?? null; }; diff --git a/packages/twenty-emails/.eslintrc.cjs b/packages/twenty-emails/.eslintrc.cjs new file mode 100644 index 0000000000..fba68ff6c3 --- /dev/null +++ b/packages/twenty-emails/.eslintrc.cjs @@ -0,0 +1,15 @@ +module.exports = { + extends: ['../../.eslintrc.cjs', '../../.eslintrc.react.cjs'], + ignorePatterns: ['!**/*'], + overrides: [ + { + files: ['*.ts', '*.tsx'], + parserOptions: { + project: ['packages/twenty-emails/tsconfig.{json,*.json}'], + }, + rules: { + '@nx/dependency-checks': 'error', + }, + }, + ], +}; diff --git a/packages/twenty-emails/.eslintrc.json b/packages/twenty-emails/.eslintrc.json deleted file mode 100644 index d3e61a2ea8..0000000000 --- a/packages/twenty-emails/.eslintrc.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "extends": ["../../.eslintrc.js"], - "ignorePatterns": ["!**/*"], - "overrides": [ - { - "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], - "rules": {} - }, - { - "files": ["*.ts", "*.tsx"], - "rules": {} - }, - { - "files": ["*.js", "*.jsx"], - "rules": {} - } - ] -} diff --git a/packages/twenty-front/.eslintrc.cjs b/packages/twenty-front/.eslintrc.cjs index f19d1c35aa..b6e293abcb 100644 --- a/packages/twenty-front/.eslintrc.cjs +++ b/packages/twenty-front/.eslintrc.cjs @@ -1,15 +1,5 @@ -// eslint-disable-next-line -const path = require('path'); - module.exports = { - extends: [ - 'plugin:@nx/react', - 'plugin:react/recommended', - 'plugin:react-hooks/recommended', - 'plugin:storybook/recommended', - '../../.eslintrc.js', - ], - plugins: ['react-hooks', 'react-refresh'], + extends: ['../../.eslintrc.cjs', '../../.eslintrc.react.cjs'], ignorePatterns: [ '!**/*', 'node_modules', @@ -24,78 +14,13 @@ module.exports = { 'tsup.ui.index.tsx', '__mocks__', ], - rules: { - 'no-restricted-imports': [ - 'error', - { - patterns: [ - { - group: ['@tabler/icons-react'], - message: 'Icon imports are only allowed for `@/ui/display/icon`', - }, - { - group: ['react-hotkeys-web-hook'], - importNames: ['useHotkeys'], - message: 'Please use the custom wrapper: `useScopedHotkeys`', - }, - ], - }, - ], - - '@nx/workspace-effect-components': 'error', - '@nx/workspace-no-hardcoded-colors': 'error', - '@nx/workspace-matching-state-variable': 'error', - '@nx/workspace-sort-css-properties-alphabetically': 'error', - '@nx/workspace-styled-components-prefixed-with-styled': 'error', - '@nx/workspace-no-state-useref': 'error', - '@nx/workspace-component-props-naming': 'error', - '@nx/workspace-explicit-boolean-predicates-in-if': 'error', - '@nx/workspace-use-getLoadable-and-getValue-to-get-atoms': 'error', - '@nx/workspace-useRecoilCallback-has-dependency-array': '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': [ - 'error', - { - explicitSpread: 'ignore', - }, - ], - - 'react-hooks/exhaustive-deps': [ - 'warn', - { - additionalHooks: 'useRecoilCallback', - }, - ], - }, overrides: [ { - files: ['*.ts', '*.tsx', '*.js', '*.jsx'], + files: ['*.ts', '*.tsx'], parserOptions: { project: ['packages/twenty-front/tsconfig.{json,*.json}'], }, rules: {}, }, - { - files: ['.storybook/main.@(js|cjs|mjs|ts)'], - rules: { - 'storybook/no-uninstalled-addons': [ - 'error', - { packageJsonLocation: path.resolve('../../package.json') }, - ], - }, - }, - { - files: ['.storybook/**/*', '**/*.stories.tsx', '**/*.test.@(ts|tsx)'], - rules: { - 'no-console': 'off', - }, - }, ], }; diff --git a/packages/twenty-front/public/manifest.json b/packages/twenty-front/public/manifest.json index 0323bf8138..e78ded6840 100644 --- a/packages/twenty-front/public/manifest.json +++ b/packages/twenty-front/public/manifest.json @@ -6,453 +6,453 @@ "theme_color": "#000000", "background_color": "#ffffff", "icons": [ - { - "src": "icons/windows11/SmallTile.scale-100.png", - "sizes": "71x71" - }, - { - "src": "icons/windows11/SmallTile.scale-125.png", - "sizes": "89x89" - }, - { - "src": "icons/windows11/SmallTile.scale-150.png", - "sizes": "107x107" - }, - { - "src": "icons/windows11/SmallTile.scale-200.png", - "sizes": "142x142" - }, - { - "src": "icons/windows11/SmallTile.scale-400.png", - "sizes": "284x284" - }, - { - "src": "icons/windows11/Square150x150Logo.scale-100.png", - "sizes": "150x150" - }, - { - "src": "icons/windows11/Square150x150Logo.scale-125.png", - "sizes": "188x188" - }, - { - "src": "icons/windows11/Square150x150Logo.scale-150.png", - "sizes": "225x225" - }, - { - "src": "icons/windows11/Square150x150Logo.scale-200.png", - "sizes": "300x300" - }, - { - "src": "icons/windows11/Square150x150Logo.scale-400.png", - "sizes": "600x600" - }, - { - "src": "icons/windows11/Wide310x150Logo.scale-100.png", - "sizes": "310x150" - }, - { - "src": "icons/windows11/Wide310x150Logo.scale-125.png", - "sizes": "388x188" - }, - { - "src": "icons/windows11/Wide310x150Logo.scale-150.png", - "sizes": "465x225" - }, - { - "src": "icons/windows11/Wide310x150Logo.scale-200.png", - "sizes": "620x300" - }, - { - "src": "icons/windows11/Wide310x150Logo.scale-400.png", - "sizes": "1240x600" - }, - { - "src": "icons/windows11/LargeTile.scale-100.png", - "sizes": "310x310" - }, - { - "src": "icons/windows11/LargeTile.scale-125.png", - "sizes": "388x388" - }, - { - "src": "icons/windows11/LargeTile.scale-150.png", - "sizes": "465x465" - }, - { - "src": "icons/windows11/LargeTile.scale-200.png", - "sizes": "620x620" - }, - { - "src": "icons/windows11/LargeTile.scale-400.png", - "sizes": "1240x1240" - }, - { - "src": "icons/windows11/Square44x44Logo.scale-100.png", - "sizes": "44x44" - }, - { - "src": "icons/windows11/Square44x44Logo.scale-125.png", - "sizes": "55x55" - }, - { - "src": "icons/windows11/Square44x44Logo.scale-150.png", - "sizes": "66x66" - }, - { - "src": "icons/windows11/Square44x44Logo.scale-200.png", - "sizes": "88x88" - }, - { - "src": "icons/windows11/Square44x44Logo.scale-400.png", - "sizes": "176x176" - }, - { - "src": "icons/windows11/StoreLogo.scale-100.png", - "sizes": "50x50" - }, - { - "src": "icons/windows11/StoreLogo.scale-125.png", - "sizes": "63x63" - }, - { - "src": "icons/windows11/StoreLogo.scale-150.png", - "sizes": "75x75" - }, - { - "src": "icons/windows11/StoreLogo.scale-200.png", - "sizes": "100x100" - }, - { - "src": "icons/windows11/StoreLogo.scale-400.png", - "sizes": "200x200" - }, - { - "src": "icons/windows11/SplashScreen.scale-100.png", - "sizes": "620x300" - }, - { - "src": "icons/windows11/SplashScreen.scale-125.png", - "sizes": "775x375" - }, - { - "src": "icons/windows11/SplashScreen.scale-150.png", - "sizes": "930x450" - }, - { - "src": "icons/windows11/SplashScreen.scale-200.png", - "sizes": "1240x600" - }, - { - "src": "icons/windows11/SplashScreen.scale-400.png", - "sizes": "2480x1200" - }, - { - "src": "icons/windows11/Square44x44Logo.targetsize-16.png", - "sizes": "16x16" - }, - { - "src": "icons/windows11/Square44x44Logo.targetsize-20.png", - "sizes": "20x20" - }, - { - "src": "icons/windows11/Square44x44Logo.targetsize-24.png", - "sizes": "24x24" - }, - { - "src": "icons/windows11/Square44x44Logo.targetsize-30.png", - "sizes": "30x30" - }, - { - "src": "icons/windows11/Square44x44Logo.targetsize-32.png", - "sizes": "32x32" - }, - { - "src": "icons/windows11/Square44x44Logo.targetsize-36.png", - "sizes": "36x36" - }, - { - "src": "icons/windows11/Square44x44Logo.targetsize-40.png", - "sizes": "40x40" - }, - { - "src": "icons/windows11/Square44x44Logo.targetsize-44.png", - "sizes": "44x44" - }, - { - "src": "icons/windows11/Square44x44Logo.targetsize-48.png", - "sizes": "48x48" - }, - { - "src": "icons/windows11/Square44x44Logo.targetsize-60.png", - "sizes": "60x60" - }, - { - "src": "icons/windows11/Square44x44Logo.targetsize-64.png", - "sizes": "64x64" - }, - { - "src": "icons/windows11/Square44x44Logo.targetsize-72.png", - "sizes": "72x72" - }, - { - "src": "icons/windows11/Square44x44Logo.targetsize-80.png", - "sizes": "80x80" - }, - { - "src": "icons/windows11/Square44x44Logo.targetsize-96.png", - "sizes": "96x96" - }, - { - "src": "icons/windows11/Square44x44Logo.targetsize-256.png", - "sizes": "256x256" - }, - { - "src": "icons/windows11/Square44x44Logo.altform-unplated_targetsize-16.png", - "sizes": "16x16" - }, - { - "src": "icons/windows11/Square44x44Logo.altform-unplated_targetsize-20.png", - "sizes": "20x20" - }, - { - "src": "icons/windows11/Square44x44Logo.altform-unplated_targetsize-24.png", - "sizes": "24x24" - }, - { - "src": "icons/windows11/Square44x44Logo.altform-unplated_targetsize-30.png", - "sizes": "30x30" - }, - { - "src": "icons/windows11/Square44x44Logo.altform-unplated_targetsize-32.png", - "sizes": "32x32" - }, - { - "src": "icons/windows11/Square44x44Logo.altform-unplated_targetsize-36.png", - "sizes": "36x36" - }, - { - "src": "icons/windows11/Square44x44Logo.altform-unplated_targetsize-40.png", - "sizes": "40x40" - }, - { - "src": "icons/windows11/Square44x44Logo.altform-unplated_targetsize-44.png", - "sizes": "44x44" - }, - { - "src": "icons/windows11/Square44x44Logo.altform-unplated_targetsize-48.png", - "sizes": "48x48" - }, - { - "src": "icons/windows11/Square44x44Logo.altform-unplated_targetsize-60.png", - "sizes": "60x60" - }, - { - "src": "icons/windows11/Square44x44Logo.altform-unplated_targetsize-64.png", - "sizes": "64x64" - }, - { - "src": "icons/windows11/Square44x44Logo.altform-unplated_targetsize-72.png", - "sizes": "72x72" - }, - { - "src": "icons/windows11/Square44x44Logo.altform-unplated_targetsize-80.png", - "sizes": "80x80" - }, - { - "src": "icons/windows11/Square44x44Logo.altform-unplated_targetsize-96.png", - "sizes": "96x96" - }, - { - "src": "icons/windows11/Square44x44Logo.altform-unplated_targetsize-256.png", - "sizes": "256x256" - }, - { - "src": "icons/windows11/Square44x44Logo.altform-lightunplated_targetsize-16.png", - "sizes": "16x16" - }, - { - "src": "icons/windows11/Square44x44Logo.altform-lightunplated_targetsize-20.png", - "sizes": "20x20" - }, - { - "src": "icons/windows11/Square44x44Logo.altform-lightunplated_targetsize-24.png", - "sizes": "24x24" - }, - { - "src": "icons/windows11/Square44x44Logo.altform-lightunplated_targetsize-30.png", - "sizes": "30x30" - }, - { - "src": "icons/windows11/Square44x44Logo.altform-lightunplated_targetsize-32.png", - "sizes": "32x32" - }, - { - "src": "icons/windows11/Square44x44Logo.altform-lightunplated_targetsize-36.png", - "sizes": "36x36" - }, - { - "src": "icons/windows11/Square44x44Logo.altform-lightunplated_targetsize-40.png", - "sizes": "40x40" - }, - { - "src": "icons/windows11/Square44x44Logo.altform-lightunplated_targetsize-44.png", - "sizes": "44x44" - }, - { - "src": "icons/windows11/Square44x44Logo.altform-lightunplated_targetsize-48.png", - "sizes": "48x48" - }, - { - "src": "icons/windows11/Square44x44Logo.altform-lightunplated_targetsize-60.png", - "sizes": "60x60" - }, - { - "src": "icons/windows11/Square44x44Logo.altform-lightunplated_targetsize-64.png", - "sizes": "64x64" - }, - { - "src": "icons/windows11/Square44x44Logo.altform-lightunplated_targetsize-72.png", - "sizes": "72x72" - }, - { - "src": "icons/windows11/Square44x44Logo.altform-lightunplated_targetsize-80.png", - "sizes": "80x80" - }, - { - "src": "icons/windows11/Square44x44Logo.altform-lightunplated_targetsize-96.png", - "sizes": "96x96" - }, - { - "src": "icons/windows11/Square44x44Logo.altform-lightunplated_targetsize-256.png", - "sizes": "256x256" - }, - { - "src": "icons/android/android-launchericon-512-512.png", - "sizes": "512x512" - }, - { - "src": "icons/android/android-launchericon-192-192.png", - "sizes": "192x192" - }, - { - "src": "icons/android/android-launchericon-144-144.png", - "sizes": "144x144" - }, - { - "src": "icons/android/android-launchericon-96-96.png", - "sizes": "96x96" - }, - { - "src": "icons/android/android-launchericon-72-72.png", - "sizes": "72x72" - }, - { - "src": "icons/android/android-launchericon-48-48.png", - "sizes": "48x48" - }, - { - "src": "icons/ios/16.png", - "sizes": "16x16" - }, - { - "src": "icons/ios/20.png", - "sizes": "20x20" - }, - { - "src": "icons/ios/29.png", - "sizes": "29x29" - }, - { - "src": "icons/ios/32.png", - "sizes": "32x32" - }, - { - "src": "icons/ios/40.png", - "sizes": "40x40" - }, - { - "src": "icons/ios/50.png", - "sizes": "50x50" - }, - { - "src": "icons/ios/57.png", - "sizes": "57x57" - }, - { - "src": "icons/ios/58.png", - "sizes": "58x58" - }, - { - "src": "icons/ios/60.png", - "sizes": "60x60" - }, - { - "src": "icons/ios/64.png", - "sizes": "64x64" - }, - { - "src": "icons/ios/72.png", - "sizes": "72x72" - }, - { - "src": "icons/ios/76.png", - "sizes": "76x76" - }, - { - "src": "icons/ios/80.png", - "sizes": "80x80" - }, - { - "src": "icons/ios/87.png", - "sizes": "87x87" - }, - { - "src": "icons/ios/100.png", - "sizes": "100x100" - }, - { - "src": "icons/ios/114.png", - "sizes": "114x114" - }, - { - "src": "icons/ios/120.png", - "sizes": "120x120" - }, - { - "src": "icons/ios/128.png", - "sizes": "128x128" - }, - { - "src": "icons/ios/144.png", - "sizes": "144x144" - }, - { - "src": "icons/ios/152.png", - "sizes": "152x152" - }, - { - "src": "icons/ios/167.png", - "sizes": "167x167" - }, - { - "src": "icons/ios/180.png", - "sizes": "180x180" - }, - { - "src": "icons/ios/192.png", - "sizes": "192x192" - }, - { - "src": "icons/ios/256.png", - "sizes": "256x256" - }, - { - "src": "icons/ios/512.png", - "sizes": "512x512" - }, - { - "src": "icons/ios/1024.png", - "sizes": "1024x1024" - } + { + "src": "icons/windows11/SmallTile.scale-100.png", + "sizes": "71x71" + }, + { + "src": "icons/windows11/SmallTile.scale-125.png", + "sizes": "89x89" + }, + { + "src": "icons/windows11/SmallTile.scale-150.png", + "sizes": "107x107" + }, + { + "src": "icons/windows11/SmallTile.scale-200.png", + "sizes": "142x142" + }, + { + "src": "icons/windows11/SmallTile.scale-400.png", + "sizes": "284x284" + }, + { + "src": "icons/windows11/Square150x150Logo.scale-100.png", + "sizes": "150x150" + }, + { + "src": "icons/windows11/Square150x150Logo.scale-125.png", + "sizes": "188x188" + }, + { + "src": "icons/windows11/Square150x150Logo.scale-150.png", + "sizes": "225x225" + }, + { + "src": "icons/windows11/Square150x150Logo.scale-200.png", + "sizes": "300x300" + }, + { + "src": "icons/windows11/Square150x150Logo.scale-400.png", + "sizes": "600x600" + }, + { + "src": "icons/windows11/Wide310x150Logo.scale-100.png", + "sizes": "310x150" + }, + { + "src": "icons/windows11/Wide310x150Logo.scale-125.png", + "sizes": "388x188" + }, + { + "src": "icons/windows11/Wide310x150Logo.scale-150.png", + "sizes": "465x225" + }, + { + "src": "icons/windows11/Wide310x150Logo.scale-200.png", + "sizes": "620x300" + }, + { + "src": "icons/windows11/Wide310x150Logo.scale-400.png", + "sizes": "1240x600" + }, + { + "src": "icons/windows11/LargeTile.scale-100.png", + "sizes": "310x310" + }, + { + "src": "icons/windows11/LargeTile.scale-125.png", + "sizes": "388x388" + }, + { + "src": "icons/windows11/LargeTile.scale-150.png", + "sizes": "465x465" + }, + { + "src": "icons/windows11/LargeTile.scale-200.png", + "sizes": "620x620" + }, + { + "src": "icons/windows11/LargeTile.scale-400.png", + "sizes": "1240x1240" + }, + { + "src": "icons/windows11/Square44x44Logo.scale-100.png", + "sizes": "44x44" + }, + { + "src": "icons/windows11/Square44x44Logo.scale-125.png", + "sizes": "55x55" + }, + { + "src": "icons/windows11/Square44x44Logo.scale-150.png", + "sizes": "66x66" + }, + { + "src": "icons/windows11/Square44x44Logo.scale-200.png", + "sizes": "88x88" + }, + { + "src": "icons/windows11/Square44x44Logo.scale-400.png", + "sizes": "176x176" + }, + { + "src": "icons/windows11/StoreLogo.scale-100.png", + "sizes": "50x50" + }, + { + "src": "icons/windows11/StoreLogo.scale-125.png", + "sizes": "63x63" + }, + { + "src": "icons/windows11/StoreLogo.scale-150.png", + "sizes": "75x75" + }, + { + "src": "icons/windows11/StoreLogo.scale-200.png", + "sizes": "100x100" + }, + { + "src": "icons/windows11/StoreLogo.scale-400.png", + "sizes": "200x200" + }, + { + "src": "icons/windows11/SplashScreen.scale-100.png", + "sizes": "620x300" + }, + { + "src": "icons/windows11/SplashScreen.scale-125.png", + "sizes": "775x375" + }, + { + "src": "icons/windows11/SplashScreen.scale-150.png", + "sizes": "930x450" + }, + { + "src": "icons/windows11/SplashScreen.scale-200.png", + "sizes": "1240x600" + }, + { + "src": "icons/windows11/SplashScreen.scale-400.png", + "sizes": "2480x1200" + }, + { + "src": "icons/windows11/Square44x44Logo.targetsize-16.png", + "sizes": "16x16" + }, + { + "src": "icons/windows11/Square44x44Logo.targetsize-20.png", + "sizes": "20x20" + }, + { + "src": "icons/windows11/Square44x44Logo.targetsize-24.png", + "sizes": "24x24" + }, + { + "src": "icons/windows11/Square44x44Logo.targetsize-30.png", + "sizes": "30x30" + }, + { + "src": "icons/windows11/Square44x44Logo.targetsize-32.png", + "sizes": "32x32" + }, + { + "src": "icons/windows11/Square44x44Logo.targetsize-36.png", + "sizes": "36x36" + }, + { + "src": "icons/windows11/Square44x44Logo.targetsize-40.png", + "sizes": "40x40" + }, + { + "src": "icons/windows11/Square44x44Logo.targetsize-44.png", + "sizes": "44x44" + }, + { + "src": "icons/windows11/Square44x44Logo.targetsize-48.png", + "sizes": "48x48" + }, + { + "src": "icons/windows11/Square44x44Logo.targetsize-60.png", + "sizes": "60x60" + }, + { + "src": "icons/windows11/Square44x44Logo.targetsize-64.png", + "sizes": "64x64" + }, + { + "src": "icons/windows11/Square44x44Logo.targetsize-72.png", + "sizes": "72x72" + }, + { + "src": "icons/windows11/Square44x44Logo.targetsize-80.png", + "sizes": "80x80" + }, + { + "src": "icons/windows11/Square44x44Logo.targetsize-96.png", + "sizes": "96x96" + }, + { + "src": "icons/windows11/Square44x44Logo.targetsize-256.png", + "sizes": "256x256" + }, + { + "src": "icons/windows11/Square44x44Logo.altform-unplated_targetsize-16.png", + "sizes": "16x16" + }, + { + "src": "icons/windows11/Square44x44Logo.altform-unplated_targetsize-20.png", + "sizes": "20x20" + }, + { + "src": "icons/windows11/Square44x44Logo.altform-unplated_targetsize-24.png", + "sizes": "24x24" + }, + { + "src": "icons/windows11/Square44x44Logo.altform-unplated_targetsize-30.png", + "sizes": "30x30" + }, + { + "src": "icons/windows11/Square44x44Logo.altform-unplated_targetsize-32.png", + "sizes": "32x32" + }, + { + "src": "icons/windows11/Square44x44Logo.altform-unplated_targetsize-36.png", + "sizes": "36x36" + }, + { + "src": "icons/windows11/Square44x44Logo.altform-unplated_targetsize-40.png", + "sizes": "40x40" + }, + { + "src": "icons/windows11/Square44x44Logo.altform-unplated_targetsize-44.png", + "sizes": "44x44" + }, + { + "src": "icons/windows11/Square44x44Logo.altform-unplated_targetsize-48.png", + "sizes": "48x48" + }, + { + "src": "icons/windows11/Square44x44Logo.altform-unplated_targetsize-60.png", + "sizes": "60x60" + }, + { + "src": "icons/windows11/Square44x44Logo.altform-unplated_targetsize-64.png", + "sizes": "64x64" + }, + { + "src": "icons/windows11/Square44x44Logo.altform-unplated_targetsize-72.png", + "sizes": "72x72" + }, + { + "src": "icons/windows11/Square44x44Logo.altform-unplated_targetsize-80.png", + "sizes": "80x80" + }, + { + "src": "icons/windows11/Square44x44Logo.altform-unplated_targetsize-96.png", + "sizes": "96x96" + }, + { + "src": "icons/windows11/Square44x44Logo.altform-unplated_targetsize-256.png", + "sizes": "256x256" + }, + { + "src": "icons/windows11/Square44x44Logo.altform-lightunplated_targetsize-16.png", + "sizes": "16x16" + }, + { + "src": "icons/windows11/Square44x44Logo.altform-lightunplated_targetsize-20.png", + "sizes": "20x20" + }, + { + "src": "icons/windows11/Square44x44Logo.altform-lightunplated_targetsize-24.png", + "sizes": "24x24" + }, + { + "src": "icons/windows11/Square44x44Logo.altform-lightunplated_targetsize-30.png", + "sizes": "30x30" + }, + { + "src": "icons/windows11/Square44x44Logo.altform-lightunplated_targetsize-32.png", + "sizes": "32x32" + }, + { + "src": "icons/windows11/Square44x44Logo.altform-lightunplated_targetsize-36.png", + "sizes": "36x36" + }, + { + "src": "icons/windows11/Square44x44Logo.altform-lightunplated_targetsize-40.png", + "sizes": "40x40" + }, + { + "src": "icons/windows11/Square44x44Logo.altform-lightunplated_targetsize-44.png", + "sizes": "44x44" + }, + { + "src": "icons/windows11/Square44x44Logo.altform-lightunplated_targetsize-48.png", + "sizes": "48x48" + }, + { + "src": "icons/windows11/Square44x44Logo.altform-lightunplated_targetsize-60.png", + "sizes": "60x60" + }, + { + "src": "icons/windows11/Square44x44Logo.altform-lightunplated_targetsize-64.png", + "sizes": "64x64" + }, + { + "src": "icons/windows11/Square44x44Logo.altform-lightunplated_targetsize-72.png", + "sizes": "72x72" + }, + { + "src": "icons/windows11/Square44x44Logo.altform-lightunplated_targetsize-80.png", + "sizes": "80x80" + }, + { + "src": "icons/windows11/Square44x44Logo.altform-lightunplated_targetsize-96.png", + "sizes": "96x96" + }, + { + "src": "icons/windows11/Square44x44Logo.altform-lightunplated_targetsize-256.png", + "sizes": "256x256" + }, + { + "src": "icons/android/android-launchericon-512-512.png", + "sizes": "512x512" + }, + { + "src": "icons/android/android-launchericon-192-192.png", + "sizes": "192x192" + }, + { + "src": "icons/android/android-launchericon-144-144.png", + "sizes": "144x144" + }, + { + "src": "icons/android/android-launchericon-96-96.png", + "sizes": "96x96" + }, + { + "src": "icons/android/android-launchericon-72-72.png", + "sizes": "72x72" + }, + { + "src": "icons/android/android-launchericon-48-48.png", + "sizes": "48x48" + }, + { + "src": "icons/ios/16.png", + "sizes": "16x16" + }, + { + "src": "icons/ios/20.png", + "sizes": "20x20" + }, + { + "src": "icons/ios/29.png", + "sizes": "29x29" + }, + { + "src": "icons/ios/32.png", + "sizes": "32x32" + }, + { + "src": "icons/ios/40.png", + "sizes": "40x40" + }, + { + "src": "icons/ios/50.png", + "sizes": "50x50" + }, + { + "src": "icons/ios/57.png", + "sizes": "57x57" + }, + { + "src": "icons/ios/58.png", + "sizes": "58x58" + }, + { + "src": "icons/ios/60.png", + "sizes": "60x60" + }, + { + "src": "icons/ios/64.png", + "sizes": "64x64" + }, + { + "src": "icons/ios/72.png", + "sizes": "72x72" + }, + { + "src": "icons/ios/76.png", + "sizes": "76x76" + }, + { + "src": "icons/ios/80.png", + "sizes": "80x80" + }, + { + "src": "icons/ios/87.png", + "sizes": "87x87" + }, + { + "src": "icons/ios/100.png", + "sizes": "100x100" + }, + { + "src": "icons/ios/114.png", + "sizes": "114x114" + }, + { + "src": "icons/ios/120.png", + "sizes": "120x120" + }, + { + "src": "icons/ios/128.png", + "sizes": "128x128" + }, + { + "src": "icons/ios/144.png", + "sizes": "144x144" + }, + { + "src": "icons/ios/152.png", + "sizes": "152x152" + }, + { + "src": "icons/ios/167.png", + "sizes": "167x167" + }, + { + "src": "icons/ios/180.png", + "sizes": "180x180" + }, + { + "src": "icons/ios/192.png", + "sizes": "192x192" + }, + { + "src": "icons/ios/256.png", + "sizes": "256x256" + }, + { + "src": "icons/ios/512.png", + "sizes": "512x512" + }, + { + "src": "icons/ios/1024.png", + "sizes": "1024x1024" + } ] } diff --git a/packages/twenty-front/src/modules/object-record/relation-picker/hooks/useMultiObjectSearchSelectedItemsQuery.ts b/packages/twenty-front/src/modules/object-record/relation-picker/hooks/useMultiObjectSearchSelectedItemsQuery.ts index 008c8b2f4e..155b584c3a 100644 --- a/packages/twenty-front/src/modules/object-record/relation-picker/hooks/useMultiObjectSearchSelectedItemsQuery.ts +++ b/packages/twenty-front/src/modules/object-record/relation-picker/hooks/useMultiObjectSearchSelectedItemsQuery.ts @@ -1,5 +1,4 @@ -import { useQuery } from '@apollo/client'; -import { gql } from '@apollo/client'; +import { gql, useQuery } from '@apollo/client'; import { isNonEmptyArray } from '@sniptt/guards'; import { useRecoilValue } from 'recoil'; diff --git a/packages/twenty-front/src/modules/settings/data-model/validation-schemas/__tests__/settingsCreateObjectInputSchema.test.ts b/packages/twenty-front/src/modules/settings/data-model/validation-schemas/__tests__/settingsCreateObjectInputSchema.test.ts index ff28a7a822..21b168a50b 100644 --- a/packages/twenty-front/src/modules/settings/data-model/validation-schemas/__tests__/settingsCreateObjectInputSchema.test.ts +++ b/packages/twenty-front/src/modules/settings/data-model/validation-schemas/__tests__/settingsCreateObjectInputSchema.test.ts @@ -2,7 +2,7 @@ import { SafeParseSuccess } from 'zod'; import { CreateObjectInput } from '~/generated-metadata/graphql'; -import { settingsCreateObjectInputSchema } from '..//settingsCreateObjectInputSchema'; +import { settingsCreateObjectInputSchema } from '../settingsCreateObjectInputSchema'; describe('settingsCreateObjectInputSchema', () => { it('validates a valid input and adds name properties', () => { diff --git a/packages/twenty-front/src/modules/ui/input/states/iconPickerState.ts b/packages/twenty-front/src/modules/ui/input/states/iconPickerState.ts index f2774db3f0..8d744bee4a 100644 --- a/packages/twenty-front/src/modules/ui/input/states/iconPickerState.ts +++ b/packages/twenty-front/src/modules/ui/input/states/iconPickerState.ts @@ -1,5 +1,4 @@ -import { createState } from 'twenty-ui'; -import { IconApps } from 'twenty-ui'; +import { createState, IconApps } from 'twenty-ui'; import { IconComponent } from '@/ui/display/icon/types/IconComponent'; diff --git a/packages/twenty-front/src/modules/ui/layout/animated-placeholder/components/AnimatedPlaceholder.tsx b/packages/twenty-front/src/modules/ui/layout/animated-placeholder/components/AnimatedPlaceholder.tsx index 87b0fa7915..cd173e0aea 100644 --- a/packages/twenty-front/src/modules/ui/layout/animated-placeholder/components/AnimatedPlaceholder.tsx +++ b/packages/twenty-front/src/modules/ui/layout/animated-placeholder/components/AnimatedPlaceholder.tsx @@ -1,8 +1,7 @@ import { useEffect } from 'react'; import { useTheme } from '@emotion/react'; import styled from '@emotion/styled'; -import { motion, useMotionValue, useTransform } from 'framer-motion'; -import { animate } from 'framer-motion'; +import { animate, motion, useMotionValue, useTransform } from 'framer-motion'; import { BACKGROUND } from '@/ui/layout/animated-placeholder/constants/Background'; import { DARK_BACKGROUND } from '@/ui/layout/animated-placeholder/constants/DarkBackground'; diff --git a/packages/twenty-front/src/modules/ui/layout/page/DefaultLayout.tsx b/packages/twenty-front/src/modules/ui/layout/page/DefaultLayout.tsx index 7213c614a8..8cbe647b5e 100644 --- a/packages/twenty-front/src/modules/ui/layout/page/DefaultLayout.tsx +++ b/packages/twenty-front/src/modules/ui/layout/page/DefaultLayout.tsx @@ -2,8 +2,7 @@ import { useMemo } from 'react'; import { Outlet } from 'react-router-dom'; import { css, Global, useTheme } from '@emotion/react'; import styled from '@emotion/styled'; -import { motion } from 'framer-motion'; -import { AnimatePresence, LayoutGroup } from 'framer-motion'; +import { AnimatePresence, LayoutGroup, motion } from 'framer-motion'; import { AuthModal } from '@/auth/components/Modal'; import { useOnboardingStatus } from '@/auth/hooks/useOnboardingStatus'; diff --git a/packages/twenty-front/src/modules/views/hooks/__tests__/useViewBar.test.tsx b/packages/twenty-front/src/modules/views/hooks/__tests__/useViewBar.test.tsx index 3dabf65e0f..1906765f63 100644 --- a/packages/twenty-front/src/modules/views/hooks/__tests__/useViewBar.test.tsx +++ b/packages/twenty-front/src/modules/views/hooks/__tests__/useViewBar.test.tsx @@ -40,10 +40,13 @@ const Wrapper = ({ children }: { children: React.ReactNode }) => ( ); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars const _renderHookConfig = { wrapper: Wrapper, }; +// eslint-disable-next-line @typescript-eslint/no-unused-vars const _viewBarId = 'viewBarTestId'; describe('useViewBar', () => { diff --git a/packages/twenty-front/src/modules/views/hooks/useHandleViews.ts b/packages/twenty-front/src/modules/views/hooks/useHandleViews.ts index a27bd8c71c..e0acd68598 100644 --- a/packages/twenty-front/src/modules/views/hooks/useHandleViews.ts +++ b/packages/twenty-front/src/modules/views/hooks/useHandleViews.ts @@ -41,7 +41,7 @@ export const useHandleViews = (viewBarComponentId?: string) => { const { saveCurrentViewFilterAndSorts } = useSaveCurrentViewFiltersAndSorts(viewBarComponentId); - const [_, setSearchParams] = useSearchParams(); + const [, setSearchParams] = useSearchParams(); const removeView = useRecoilCallback( () => async (viewId: string) => { diff --git a/packages/twenty-front/tsconfig.json b/packages/twenty-front/tsconfig.json index a726af1277..3c411c5783 100644 --- a/packages/twenty-front/tsconfig.json +++ b/packages/twenty-front/tsconfig.json @@ -28,7 +28,7 @@ "noUnusedLocals": false, "noUnusedParameters": false, "noFallthroughCasesInSwitch": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true }, "files": [], "include": [], @@ -39,5 +39,5 @@ { "path": "./tsconfig.spec.json" } - ], + ] } diff --git a/packages/twenty-ui/.eslintrc.cjs b/packages/twenty-ui/.eslintrc.cjs new file mode 100644 index 0000000000..ccb1c6e414 --- /dev/null +++ b/packages/twenty-ui/.eslintrc.cjs @@ -0,0 +1,32 @@ +module.exports = { + extends: ['../../.eslintrc.cjs', '../../.eslintrc.react.cjs'], + ignorePatterns: ['!**/*'], + overrides: [ + { + files: ['*.ts', '*.tsx'], + parserOptions: { + project: ['packages/twenty-ui/tsconfig.{json,*.json}'], + }, + rules: { + 'no-restricted-imports': [ + 'error', + { + patterns: [ + { + group: ['@tabler/icons-react'], + message: 'Please import icons from `src/display`', + }, + { + group: ['react-hotkeys-web-hook'], + importNames: ['useHotkeys'], + message: + 'Please use the custom wrapper: `useScopedHotkeys` from `src/utilities`', + }, + ], + }, + ], + '@nx/dependency-checks': 'error', + }, + }, + ], +}; diff --git a/packages/twenty-ui/.eslintrc.json b/packages/twenty-ui/.eslintrc.json deleted file mode 100644 index 4ea0d7f3b9..0000000000 --- a/packages/twenty-ui/.eslintrc.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "extends": ["../../.eslintrc.js"], - "ignorePatterns": ["!**/*", "storybook-static"], - "overrides": [ - { - "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], - "rules": {} - }, - { - "files": ["*.ts", "*.tsx"], - "rules": {} - }, - { - "files": ["*.js", "*.jsx"], - "rules": {} - }, - { - "files": ["*.json"], - "parser": "jsonc-eslint-parser", - "rules": { - "@nx/dependency-checks": "error" - } - } - ] -} diff --git a/packages/twenty-ui/.gitignore b/packages/twenty-ui/.gitignore deleted file mode 100644 index 53c37a1660..0000000000 --- a/packages/twenty-ui/.gitignore +++ /dev/null @@ -1 +0,0 @@ -dist \ No newline at end of file diff --git a/packages/twenty-ui/project.json b/packages/twenty-ui/project.json index 5bfb8cafef..bb7b8dd3dc 100644 --- a/packages/twenty-ui/project.json +++ b/packages/twenty-ui/project.json @@ -13,7 +13,18 @@ }, "lint": { "executor": "@nx/eslint:lint", - "outputs": ["{options.outputFile}"] + "options": { + "eslintConfig": "{projectRoot}/.eslintrc.cjs", + "ignorePath": "{workspaceRoot}/.gitignore", + "lintFilePatterns": [ + "{projectRoot}/src/**/*.{ts,tsx,json}", + "{projectRoot}/package.json" + ] + }, + "configurations": { + "ci": { "lintFilePatterns": ["{projectRoot}/**/*.{ts,tsx,json}"] }, + "fix": { "fix": true } + } }, "test": { "executor": "@nx/jest:jest", diff --git a/packages/twenty-ui/tsconfig.lib.json b/packages/twenty-ui/tsconfig.lib.json index d30d8333f0..80f30dbd61 100644 --- a/packages/twenty-ui/tsconfig.lib.json +++ b/packages/twenty-ui/tsconfig.lib.json @@ -2,17 +2,15 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "../../dist/out-tsc", - "declaration": true, - "types": ["node", "vite/client"] + "types": ["node"] }, - "include": ["src/**/*.ts"], "exclude": [ - "jest.config.ts", - "src/**/*.spec.ts", - "src/**/*.test.ts", + "**/*.spec.ts", + "**/*.spec.tsx", "**/*.stories.ts", - "**/*.stories.js", - "**/*.stories.jsx", - "**/*.stories.tsx" - ] + "**/*.stories.tsx", + "**/*.test.ts", + "**/*.test.tsx" + ], + "include": ["src/**/*.d.ts", "src/**/*.ts", "src/**/*.tsx"] } diff --git a/packages/twenty-ui/tsconfig.spec.json b/packages/twenty-ui/tsconfig.spec.json index 9b2a121d11..8cf4b5eb89 100644 --- a/packages/twenty-ui/tsconfig.spec.json +++ b/packages/twenty-ui/tsconfig.spec.json @@ -7,8 +7,9 @@ }, "include": [ "jest.config.ts", - "src/**/*.test.ts", + "src/**/*.d.ts", "src/**/*.spec.ts", - "src/**/*.d.ts" + "src/**/*.test.ts", + "vite.config.ts" ] } diff --git a/packages/twenty-ui/tsconfig.storybook.json b/packages/twenty-ui/tsconfig.storybook.json index f565786702..495fa64c07 100644 --- a/packages/twenty-ui/tsconfig.storybook.json +++ b/packages/twenty-ui/tsconfig.storybook.json @@ -4,29 +4,12 @@ "emitDecoratorMetadata": true, "outDir": "" }, - "files": [ - "../../node_modules/@nx/react/typings/styled-jsx.d.ts", - "../../node_modules/@nx/react/typings/cssmodule.d.ts", - "../../node_modules/@nx/react/typings/image.d.ts" - ], - "exclude": [ - "src/**/*.spec.ts", - "src/**/*.test.ts", - "src/**/*.spec.js", - "src/**/*.test.js", - "src/**/*.spec.tsx", - "src/**/*.test.tsx", - "src/**/*.spec.jsx", - "src/**/*.test.js" - ], "include": [ - "src/**/*.stories.ts", - "src/**/*.stories.js", - "src/**/*.stories.jsx", - "src/**/*.stories.tsx", - "src/**/*.stories.mdx", - ".storybook/*.js", ".storybook/*.ts", - ".storybook/main.tsx" + ".storybook/*.tsx", + "src/**/*.d.ts", + "src/**/*.stories.mdx", + "src/**/*.stories.ts", + "src/**/*.stories.tsx" ] } diff --git a/packages/twenty-website/.eslintrc.js b/packages/twenty-website/.eslintrc.js index 115862f93f..3afe9205c7 100644 --- a/packages/twenty-website/.eslintrc.js +++ b/packages/twenty-website/.eslintrc.js @@ -1,5 +1,5 @@ module.exports = { - extends: ['../../.eslintrc.js'], + extends: ['../../.eslintrc.cjs', 'plugin:@next/next/recommended'], rules: { 'no-console': 'off', 'prefer-arrow/prefer-arrow-functions': 'off', diff --git a/packages/twenty-website/src/app/_components/user-guide/UserGuideSidebarSection.tsx b/packages/twenty-website/src/app/_components/user-guide/UserGuideSidebarSection.tsx index 6bdc2724c6..8a5a0a70f2 100644 --- a/packages/twenty-website/src/app/_components/user-guide/UserGuideSidebarSection.tsx +++ b/packages/twenty-website/src/app/_components/user-guide/UserGuideSidebarSection.tsx @@ -2,8 +2,7 @@ import { useState } from 'react'; import styled from '@emotion/styled'; -import { useRouter } from 'next/navigation'; -import { usePathname } from 'next/navigation'; +import { usePathname, useRouter } from 'next/navigation'; import { IconChevronDown, IconChevronRight } from '@/app/_components/ui/icons'; import { Theme } from '@/app/_components/ui/theme/theme'; diff --git a/yarn.lock b/yarn.lock index 9a8c500efb..88e5ded124 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8245,6 +8245,15 @@ __metadata: languageName: node linkType: hard +"@next/eslint-plugin-next@npm:^14.1.4": + version: 14.1.4 + resolution: "@next/eslint-plugin-next@npm:14.1.4" + dependencies: + glob: "npm:10.3.10" + checksum: fb49237153bf528ef3939e1ceae0f658e44abcf0ca155d8042c7961f523e4d9aeba3de18532b633734f3b5524b644e9c3c5187089e0d400896c1c35812bbbdd3 + languageName: node + linkType: hard + "@next/swc-darwin-arm64@npm:14.0.4": version: 14.0.4 resolution: "@next/swc-darwin-arm64@npm:14.0.4" @@ -25805,7 +25814,7 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-import@npm:^2.27.5, eslint-plugin-import@npm:^2.28.1": +"eslint-plugin-import@npm:2.29.1, eslint-plugin-import@npm:^2.28.1": version: 2.29.1 resolution: "eslint-plugin-import@npm:2.29.1" dependencies: @@ -45876,6 +45885,7 @@ __metadata: "@nestjs/terminus": "npm:^9.2.2" "@nestjs/testing": "npm:^9.0.0" "@nestjs/typeorm": "npm:^10.0.0" + "@next/eslint-plugin-next": "npm:^14.1.4" "@nivo/calendar": "npm:^0.84.0" "@nivo/core": "npm:^0.84.0" "@nx/eslint": "npm:18.1.3" @@ -45997,7 +46007,7 @@ __metadata: eslint: "npm:^8.53.0" eslint-config-next: "npm:14.0.4" eslint-config-prettier: "npm:^9.1.0" - eslint-plugin-import: "npm:^2.27.5" + eslint-plugin-import: "npm:2.29.1" eslint-plugin-jsx-a11y: "npm:^6.8.0" eslint-plugin-prefer-arrow: "npm:^1.2.3" eslint-plugin-prettier: "npm:^5.1.2"