mirror of
https://github.com/twentyhq/twenty.git
synced 2024-12-18 00:52:21 +03:00
a3e5cf37b0
Split from https://github.com/twentyhq/twenty/pull/4518 - Upgrades dependencies and applies automatic config migrations with the command: `npx nx migrate nx` (see https://nx.dev/nx-api/nx/documents/migrate) - Fixes lint errors after upgrading `@typescript-eslint` Note: it was not possible (for now) to migrate Nx to the latest stable version (v18.2.1) because it upgrades Typescript to v5.4.3, which seems to cause a bug on install when Yarn tries to apply its native patches. Might be a bug on the Yarn side.
140 lines
3.4 KiB
JavaScript
140 lines
3.4 KiB
JavaScript
module.exports = {
|
|
root: true,
|
|
extends: ['plugin:prettier/recommended'],
|
|
plugins: [
|
|
'@nx',
|
|
'prefer-arrow',
|
|
'simple-import-sort',
|
|
'unused-imports',
|
|
'unicorn',
|
|
],
|
|
rules: {
|
|
'func-style': ['error', 'declaration', { allowArrowFunctions: true }],
|
|
'no-console': ['warn', { allow: ['group', 'groupCollapsed', 'groupEnd'] }],
|
|
'no-unused-vars': 'off',
|
|
'no-control-regex': 0,
|
|
'no-undef': 'off',
|
|
|
|
'@nx/enforce-module-boundaries': [
|
|
'error',
|
|
{
|
|
enforceBuildableLibDependency: true,
|
|
allow: [],
|
|
depConstraints: [
|
|
{
|
|
sourceTag: '*',
|
|
onlyDependOnLibsWithTags: ['*'],
|
|
},
|
|
],
|
|
},
|
|
],
|
|
|
|
'prefer-arrow/prefer-arrow-functions': [
|
|
'error',
|
|
{
|
|
disallowPrototype: true,
|
|
singleReturnOnly: false,
|
|
classPropertiesAllowed: false,
|
|
},
|
|
],
|
|
|
|
'simple-import-sort/imports': [
|
|
'error',
|
|
{
|
|
groups: [
|
|
['^react', '^@?\\w'],
|
|
['^(@|~)(/.*|$)'],
|
|
['^\\u0000'],
|
|
['^\\.\\.(?!/?$)', '^\\.\\./?$'],
|
|
['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
|
|
['^.+\\.?(css)$'],
|
|
],
|
|
},
|
|
],
|
|
'simple-import-sort/exports': 'error',
|
|
|
|
'unused-imports/no-unused-imports': 'warn',
|
|
'unused-imports/no-unused-vars': [
|
|
'warn',
|
|
{
|
|
vars: 'all',
|
|
varsIgnorePattern: '^_',
|
|
args: 'after-used',
|
|
argsIgnorePattern: '^_',
|
|
},
|
|
],
|
|
},
|
|
overrides: [
|
|
{
|
|
files: ['**/*.ts', '**/*.tsx'],
|
|
extends: ['plugin:@nx/typescript'],
|
|
rules: {
|
|
'@typescript-eslint/ban-ts-comment': 'error',
|
|
'@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-empty-function': 'off',
|
|
'@typescript-eslint/no-unused-vars': [
|
|
'warn',
|
|
{
|
|
vars: 'all',
|
|
varsIgnorePattern: '^_',
|
|
args: 'after-used',
|
|
argsIgnorePattern: '^_',
|
|
},
|
|
],
|
|
'@typescript-eslint/consistent-type-imports': [
|
|
'error',
|
|
{ prefer: 'no-type-imports' },
|
|
],
|
|
'@typescript-eslint/no-empty-interface': [
|
|
'error',
|
|
{ allowSingleExtends: true },
|
|
],
|
|
},
|
|
},
|
|
{
|
|
files: ['*.js', '*.jsx'],
|
|
extends: ['plugin:@nx/javascript'],
|
|
rules: {},
|
|
},
|
|
{
|
|
files: ['*.spec.@(ts|tsx|js|jsx)', '*.test.@(ts|tsx|js|jsx)'],
|
|
env: {
|
|
jest: true,
|
|
},
|
|
rules: {
|
|
'@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: {
|
|
'@typescript-eslint/naming-convention': [
|
|
'error',
|
|
{
|
|
selector: 'variable',
|
|
format: ['UPPER_CASE'],
|
|
},
|
|
],
|
|
'unicorn/filename-case': [
|
|
'warn',
|
|
{
|
|
cases: {
|
|
pascalCase: true,
|
|
},
|
|
},
|
|
],
|
|
'@nx/workspace-max-consts-per-file': ['error', { max: 1 }],
|
|
},
|
|
},
|
|
],
|
|
};
|