2022-12-02 14:03:29 +03:00
|
|
|
module.exports = {
|
|
|
|
parser: '@typescript-eslint/parser',
|
|
|
|
parserOptions: {
|
|
|
|
project: 'tsconfig.json',
|
2022-12-05 00:59:30 +03:00
|
|
|
tsconfigRootDir: __dirname,
|
2023-04-20 12:44:47 +03:00
|
|
|
sourceType: 'module',
|
2022-12-02 14:03:29 +03:00
|
|
|
},
|
2023-09-16 04:41:10 +03:00
|
|
|
plugins: [
|
|
|
|
'@typescript-eslint/eslint-plugin',
|
|
|
|
'unused-imports',
|
|
|
|
'simple-import-sort',
|
|
|
|
'prefer-arrow',
|
|
|
|
'twenty-ts',
|
|
|
|
],
|
2023-04-20 12:44:47 +03:00
|
|
|
extends: [
|
|
|
|
'plugin:@typescript-eslint/recommended',
|
|
|
|
'plugin:prettier/recommended',
|
|
|
|
'plugin:storybook/recommended',
|
|
|
|
'react-app',
|
|
|
|
],
|
2022-12-02 14:03:29 +03:00
|
|
|
root: true,
|
|
|
|
env: {
|
|
|
|
node: true,
|
2023-04-20 12:44:47 +03:00
|
|
|
jest: true,
|
2022-12-02 14:03:29 +03:00
|
|
|
},
|
2023-06-04 12:23:09 +03:00
|
|
|
overrides: [
|
|
|
|
{
|
|
|
|
files: ['*.js', '*.jsx', '*.ts', '*.tsx'],
|
|
|
|
rules: {
|
2023-08-13 06:28:33 +03:00
|
|
|
'no-control-regex': 0,
|
2023-06-04 12:23:09 +03:00
|
|
|
'simple-import-sort/imports': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
groups: [
|
|
|
|
['^react', '^@?\\w'],
|
|
|
|
['^(@|~)(/.*|$)'],
|
|
|
|
['^\\u0000'],
|
|
|
|
['^\\.\\.(?!/?$)', '^\\.\\./?$'],
|
|
|
|
['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
|
|
|
|
['^.+\\.?(css)$']
|
|
|
|
]
|
|
|
|
}
|
2023-09-16 04:41:10 +03:00
|
|
|
],
|
|
|
|
'prefer-arrow/prefer-arrow-functions': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
"disallowPrototype": true,
|
|
|
|
"singleReturnOnly": false,
|
|
|
|
"classPropertiesAllowed": false
|
|
|
|
}
|
2023-06-04 12:23:09 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
],
|
|
|
|
ignorePatterns: ['.eslintrc.js', 'codegen.js', '**/generated/*', '*.config.js'],
|
2022-12-02 14:03:29 +03:00
|
|
|
rules: {
|
|
|
|
'@typescript-eslint/interface-name-prefix': 'off',
|
|
|
|
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
|
|
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
2023-04-20 12:44:47 +03:00
|
|
|
'@typescript-eslint/no-explicit-any': 'off',
|
2023-06-04 12:23:09 +03:00
|
|
|
'simple-import-sort/imports': 'error',
|
2023-06-14 08:59:16 +03:00
|
|
|
'simple-import-sort/exports': 'error',
|
2023-09-15 03:04:45 +03:00
|
|
|
'twenty-ts/effect-components': 'error',
|
2023-09-17 18:13:05 +03:00
|
|
|
'twenty-ts/no-hardcoded-colors': 'error',
|
|
|
|
'twenty-ts/matching-state-variable': 'error',
|
|
|
|
'twenty-ts/sort-css-properties-alphabetically': 'error',
|
|
|
|
'twenty-ts/styled-components-prefixed-with-styled': 'error',
|
2023-06-29 21:19:03 +03:00
|
|
|
'func-style':['error', 'declaration', { 'allowArrowFunctions': true }],
|
2023-07-26 03:18:25 +03:00
|
|
|
"@typescript-eslint/no-unused-vars": "off",
|
2023-07-26 07:58:57 +03:00
|
|
|
"no-unused-vars": "off",
|
2023-08-25 13:43:21 +03:00
|
|
|
"react-hooks/exhaustive-deps": [
|
|
|
|
"warn", {
|
|
|
|
"additionalHooks": "useRecoilCallback"
|
|
|
|
}
|
|
|
|
],
|
2023-07-26 07:58:57 +03:00
|
|
|
"unused-imports/no-unused-imports": "warn",
|
|
|
|
"unused-imports/no-unused-vars": [
|
|
|
|
"warn",
|
|
|
|
{ "vars": "all", "varsIgnorePattern": "^_", "args": "after-used", "argsIgnorePattern": "^_" }
|
2023-08-29 14:40:17 +03:00
|
|
|
],
|
|
|
|
'no-restricted-imports': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
'patterns': [
|
|
|
|
{
|
|
|
|
'group': ['@tabler/icons-react'],
|
|
|
|
'message': 'Icon imports are only allowed for `@/ui/icon`',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
2023-06-14 17:56:29 +03:00
|
|
|
}
|
2023-04-20 12:44:47 +03:00
|
|
|
};
|