2024-01-10 19:42:11 +03:00
|
|
|
// eslint-disable-next-line
|
2024-01-04 01:07:25 +03:00
|
|
|
const path = require('path');
|
|
|
|
|
2022-12-02 14:03:29 +03:00
|
|
|
module.exports = {
|
2024-01-04 01:07:25 +03:00
|
|
|
extends: [
|
|
|
|
'plugin:@nx/react',
|
|
|
|
'plugin:react/recommended',
|
|
|
|
'plugin:react-hooks/recommended',
|
|
|
|
'plugin:storybook/recommended',
|
|
|
|
'../../.eslintrc.js',
|
|
|
|
],
|
|
|
|
plugins: ['react-hooks', 'react-refresh'],
|
|
|
|
ignorePatterns: [
|
|
|
|
'!**/*',
|
|
|
|
'node_modules',
|
|
|
|
'mockServiceWorker.js',
|
|
|
|
'**/generated*/*',
|
2024-01-10 19:42:11 +03:00
|
|
|
'tsup.config.ts',
|
|
|
|
'build',
|
|
|
|
'coverage',
|
|
|
|
'storybook-static',
|
2024-01-04 01:07:25 +03:00
|
|
|
'**/*config.js',
|
|
|
|
'codegen*',
|
|
|
|
'tsup.ui.index.tsx',
|
|
|
|
],
|
2023-12-10 18:22:43 +03:00
|
|
|
rules: {
|
|
|
|
'no-restricted-imports': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
patterns: [
|
|
|
|
{
|
|
|
|
group: ['@tabler/icons-react'],
|
2024-01-12 14:10:42 +03:00
|
|
|
message: 'Icon imports are only allowed for `@/ui/display/icon`',
|
2023-12-10 18:22:43 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
group: ['react-hotkeys-web-hook'],
|
|
|
|
importNames: ['useHotkeys'],
|
|
|
|
message: 'Please use the custom wrapper: `useScopedHotkeys`',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
2024-01-04 01:07:25 +03:00
|
|
|
|
|
|
|
'@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': [
|
2023-12-10 18:22:43 +03:00
|
|
|
'error',
|
2024-01-04 01:07:25 +03:00
|
|
|
{
|
|
|
|
explicitSpread: 'ignore',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
|
|
|
|
'react-hooks/exhaustive-deps': [
|
|
|
|
'warn',
|
|
|
|
{
|
|
|
|
additionalHooks: 'useRecoilCallback',
|
|
|
|
},
|
2023-12-10 18:22:43 +03:00
|
|
|
],
|
|
|
|
},
|
2023-06-04 12:23:09 +03:00
|
|
|
overrides: [
|
2023-10-05 22:16:02 +03:00
|
|
|
{
|
2024-01-04 01:07:25 +03:00
|
|
|
files: ['*.ts', '*.tsx', '*.js', '*.jsx'],
|
|
|
|
parserOptions: {
|
|
|
|
project: ['packages/twenty-front/tsconfig.*?.json'],
|
2023-12-10 18:22:43 +03:00
|
|
|
},
|
2024-01-04 01:07:25 +03:00
|
|
|
rules: {},
|
2023-10-05 22:16:02 +03:00
|
|
|
},
|
2023-06-04 12:23:09 +03:00
|
|
|
{
|
2024-01-04 01:07:25 +03:00
|
|
|
files: ['.storybook/main.@(js|cjs|mjs|ts)'],
|
2023-06-04 12:23:09 +03:00
|
|
|
rules: {
|
2024-01-04 01:07:25 +03:00
|
|
|
'storybook/no-uninstalled-addons': [
|
2023-09-16 04:41:10 +03:00
|
|
|
'error',
|
2024-01-05 16:59:58 +03:00
|
|
|
{ packageJsonLocation: path.resolve('../../package.json') },
|
2023-08-29 14:40:17 +03:00
|
|
|
],
|
|
|
|
},
|
2023-12-10 18:22:43 +03:00
|
|
|
},
|
2024-01-04 01:07:25 +03:00
|
|
|
{
|
|
|
|
files: ['.storybook/**/*', '**/*.stories.tsx', '**/*.test.@(ts|tsx)'],
|
|
|
|
rules: {
|
|
|
|
'no-console': 'off',
|
|
|
|
},
|
|
|
|
},
|
2023-12-10 18:22:43 +03:00
|
|
|
],
|
2023-04-20 12:44:47 +03:00
|
|
|
};
|