2022-12-02 14:03:29 +03:00
|
|
|
module.exports = {
|
|
|
|
parser: '@typescript-eslint/parser',
|
2023-12-10 18:22:43 +03:00
|
|
|
root: true,
|
|
|
|
env: {
|
|
|
|
browser: true,
|
|
|
|
node: true,
|
|
|
|
jest: true,
|
|
|
|
},
|
2022-12-02 14:03:29 +03:00
|
|
|
parserOptions: {
|
2023-12-10 18:22:43 +03:00
|
|
|
ecmaVersion: 'latest',
|
2023-04-20 12:44:47 +03:00
|
|
|
sourceType: 'module',
|
2023-12-10 18:22:43 +03:00
|
|
|
project: ['./tsconfig.json', './tsconfig.node.json'],
|
|
|
|
tsconfigRootDir: __dirname,
|
2022-12-02 14:03:29 +03:00
|
|
|
},
|
2023-12-10 18:22:43 +03:00
|
|
|
rules: {
|
|
|
|
'@typescript-eslint/interface-name-prefix': 'off',
|
|
|
|
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
|
|
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
|
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
|
|
'@typescript-eslint/no-unused-vars': 'off',
|
|
|
|
'simple-import-sort/imports': 'error',
|
|
|
|
'simple-import-sort/exports': 'error',
|
|
|
|
'twenty/effect-components': 'error',
|
|
|
|
'twenty/no-hardcoded-colors': 'error',
|
|
|
|
'twenty/matching-state-variable': 'error',
|
|
|
|
'twenty/component-props-naming': 'error',
|
|
|
|
'twenty/sort-css-properties-alphabetically': 'error',
|
|
|
|
'twenty/styled-components-prefixed-with-styled': 'error',
|
|
|
|
'twenty/no-state-useref': 'error',
|
|
|
|
'func-style': ['error', 'declaration', { allowArrowFunctions: true }],
|
|
|
|
'no-unused-vars': 'off',
|
|
|
|
'react/jsx-props-no-spreading': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
explicitSpread: 'ignore',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
'react-hooks/exhaustive-deps': [
|
|
|
|
'warn',
|
|
|
|
{
|
|
|
|
additionalHooks: 'useRecoilCallback',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
'unused-imports/no-unused-imports': 'warn',
|
|
|
|
'unused-imports/no-unused-vars': [
|
|
|
|
'warn',
|
|
|
|
{
|
|
|
|
vars: 'all',
|
|
|
|
varsIgnorePattern: '^_',
|
|
|
|
args: 'after-used',
|
|
|
|
argsIgnorePattern: '^_',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
'no-restricted-imports': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
patterns: [
|
|
|
|
{
|
|
|
|
group: ['@tabler/icons-react'],
|
|
|
|
message: 'Icon imports are only allowed for `@/ui/icon`',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
group: ['react-hotkeys-web-hook'],
|
|
|
|
importNames: ['useHotkeys'],
|
|
|
|
message: 'Please use the custom wrapper: `useScopedHotkeys`',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
'@typescript-eslint/consistent-type-imports': [
|
|
|
|
'error',
|
|
|
|
{ prefer: 'no-type-imports' },
|
|
|
|
],
|
|
|
|
'no-console': ['warn', { allow: ['group', 'groupCollapsed', 'groupEnd'] }],
|
|
|
|
// 'react-refresh/only-export-components': [
|
|
|
|
// 'warn',
|
|
|
|
// { allowConstantExport: true },
|
|
|
|
// ],
|
|
|
|
},
|
|
|
|
settings: {
|
|
|
|
react: {
|
|
|
|
version: 'detect',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
extends: [
|
|
|
|
'plugin:@typescript-eslint/recommended',
|
|
|
|
'eslint:recommended',
|
|
|
|
'plugin:react/recommended',
|
|
|
|
'plugin:react-hooks/recommended',
|
|
|
|
'plugin:prettier/recommended',
|
|
|
|
'plugin:storybook/recommended',
|
|
|
|
],
|
2023-09-16 04:41:10 +03:00
|
|
|
plugins: [
|
|
|
|
'@typescript-eslint/eslint-plugin',
|
|
|
|
'simple-import-sort',
|
2023-12-10 18:22:43 +03:00
|
|
|
'unused-imports',
|
2023-09-16 04:41:10 +03:00
|
|
|
'prefer-arrow',
|
2023-09-19 02:38:57 +03:00
|
|
|
'twenty',
|
2023-12-10 18:22:43 +03:00
|
|
|
'react-refresh',
|
2023-09-16 04:41:10 +03:00
|
|
|
],
|
2023-12-10 18:22:43 +03:00
|
|
|
ignorePatterns: [
|
|
|
|
'mockServiceWorker.js',
|
|
|
|
'**/generated*/*',
|
|
|
|
'.eslintrc.cjs',
|
|
|
|
'*.config.cjs',
|
|
|
|
'*.config.ts',
|
|
|
|
'*config.js',
|
|
|
|
'codegen*',
|
2023-04-20 12:44:47 +03:00
|
|
|
],
|
2023-06-04 12:23:09 +03:00
|
|
|
overrides: [
|
2023-10-05 22:16:02 +03:00
|
|
|
{
|
|
|
|
files: ['*.stories.tsx', '*.test.ts'],
|
|
|
|
rules: {
|
|
|
|
'no-console': 'off',
|
2023-12-10 18:22:43 +03:00
|
|
|
},
|
2023-10-05 22:16:02 +03:00
|
|
|
},
|
2023-06-04 12:23:09 +03:00
|
|
|
{
|
|
|
|
files: ['*.js', '*.jsx', '*.ts', '*.tsx'],
|
|
|
|
rules: {
|
2023-10-14 12:32:46 +03:00
|
|
|
'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',
|
2023-08-13 06:28:33 +03:00
|
|
|
'no-control-regex': 0,
|
2023-12-10 18:22:43 +03:00
|
|
|
'no-undef': 'off',
|
2023-06-04 12:23:09 +03:00
|
|
|
'simple-import-sort/imports': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
groups: [
|
|
|
|
['^react', '^@?\\w'],
|
|
|
|
['^(@|~)(/.*|$)'],
|
|
|
|
['^\\u0000'],
|
|
|
|
['^\\.\\.(?!/?$)', '^\\.\\./?$'],
|
|
|
|
['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
|
2023-12-10 18:22:43 +03:00
|
|
|
['^.+\\.?(css)$'],
|
|
|
|
],
|
|
|
|
},
|
2023-09-16 04:41:10 +03:00
|
|
|
],
|
|
|
|
'prefer-arrow/prefer-arrow-functions': [
|
|
|
|
'error',
|
|
|
|
{
|
2023-12-10 18:22:43 +03:00
|
|
|
disallowPrototype: true,
|
|
|
|
singleReturnOnly: false,
|
|
|
|
classPropertiesAllowed: false,
|
2023-09-30 09:25:34 +03:00
|
|
|
},
|
2023-08-29 14:40:17 +03:00
|
|
|
],
|
|
|
|
},
|
2023-12-10 18:22:43 +03:00
|
|
|
},
|
|
|
|
],
|
2023-04-20 12:44:47 +03:00
|
|
|
};
|