2024-01-04 01:07:25 +03:00
|
|
|
module.exports = {
|
|
|
|
root: true,
|
|
|
|
extends: ['plugin:prettier/recommended'],
|
2024-02-25 15:52:48 +03:00
|
|
|
plugins: [
|
|
|
|
'@nx',
|
|
|
|
'prefer-arrow',
|
2024-04-04 13:05:26 +03:00
|
|
|
'import',
|
2024-02-25 15:52:48 +03:00
|
|
|
'simple-import-sort',
|
|
|
|
'unused-imports',
|
|
|
|
'unicorn',
|
|
|
|
],
|
2024-01-04 01:07:25 +03:00
|
|
|
rules: {
|
|
|
|
'func-style': ['error', 'declaration', { allowArrowFunctions: true }],
|
|
|
|
'no-console': ['warn', { allow: ['group', 'groupCollapsed', 'groupEnd'] }],
|
|
|
|
'no-control-regex': 0,
|
2024-04-04 13:05:26 +03:00
|
|
|
'no-duplicate-imports': 'error',
|
2024-01-04 01:07:25 +03:00
|
|
|
'no-undef': 'off',
|
2024-04-04 13:05:26 +03:00
|
|
|
'no-unused-vars': 'off',
|
2024-01-04 01:07:25 +03:00
|
|
|
|
|
|
|
'@nx/enforce-module-boundaries': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
enforceBuildableLibDependency: true,
|
|
|
|
allow: [],
|
|
|
|
depConstraints: [
|
|
|
|
{
|
|
|
|
sourceTag: '*',
|
|
|
|
onlyDependOnLibsWithTags: ['*'],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
|
2024-04-04 13:05:26 +03:00
|
|
|
'import/no-relative-packages': 'error',
|
|
|
|
'import/no-useless-path-segments': 'error',
|
|
|
|
'import/no-duplicates': ['error', { considerQueryString: true }],
|
|
|
|
|
2024-01-04 01:07:25 +03:00
|
|
|
'prefer-arrow/prefer-arrow-functions': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
disallowPrototype: true,
|
|
|
|
singleReturnOnly: false,
|
|
|
|
classPropertiesAllowed: false,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
|
|
|
|
'simple-import-sort/imports': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
groups: [
|
2024-04-04 16:38:01 +03:00
|
|
|
// Packages
|
2024-01-04 01:07:25 +03:00
|
|
|
['^react', '^@?\\w'],
|
2024-04-04 16:38:01 +03:00
|
|
|
// Internal modules
|
|
|
|
['^(@|~|src|@ui)(/.*|$)'],
|
|
|
|
// Side effect imports
|
2024-01-04 01:07:25 +03:00
|
|
|
['^\\u0000'],
|
2024-04-04 16:38:01 +03:00
|
|
|
// Relative imports
|
2024-01-04 01:07:25 +03:00
|
|
|
['^\\.\\.(?!/?$)', '^\\.\\./?$'],
|
|
|
|
['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
|
2024-04-04 16:38:01 +03:00
|
|
|
// CSS imports
|
2024-01-04 01:07:25 +03:00
|
|
|
['^.+\\.?(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',
|
2024-04-04 13:05:26 +03:00
|
|
|
'@typescript-eslint/consistent-type-imports': [
|
|
|
|
'error',
|
|
|
|
{ prefer: 'no-type-imports' },
|
|
|
|
],
|
2024-01-04 01:07:25 +03:00
|
|
|
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
|
|
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
2024-04-04 13:05:26 +03:00
|
|
|
'@typescript-eslint/interface-name-prefix': 'off',
|
|
|
|
'@typescript-eslint/no-empty-function': 'off',
|
|
|
|
'@typescript-eslint/no-empty-interface': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
allowSingleExtends: true,
|
|
|
|
},
|
|
|
|
],
|
2024-01-04 01:07:25 +03:00
|
|
|
'@typescript-eslint/no-explicit-any': 'off',
|
2024-04-01 14:16:50 +03:00
|
|
|
'@typescript-eslint/no-empty-function': 'off',
|
2024-01-04 01:07:25 +03:00
|
|
|
'@typescript-eslint/no-unused-vars': [
|
|
|
|
'warn',
|
|
|
|
{
|
|
|
|
vars: 'all',
|
|
|
|
varsIgnorePattern: '^_',
|
|
|
|
args: 'after-used',
|
|
|
|
argsIgnorePattern: '^_',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
files: ['*.js', '*.jsx'],
|
|
|
|
extends: ['plugin:@nx/javascript'],
|
|
|
|
rules: {},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
files: ['*.spec.@(ts|tsx|js|jsx)', '*.test.@(ts|tsx|js|jsx)'],
|
|
|
|
env: {
|
|
|
|
jest: true,
|
|
|
|
},
|
2024-04-01 14:16:50 +03:00
|
|
|
rules: {
|
|
|
|
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
|
|
},
|
|
|
|
},
|
2024-02-25 15:52:48 +03:00
|
|
|
{
|
|
|
|
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 }],
|
|
|
|
},
|
|
|
|
},
|
2024-04-04 13:05:26 +03:00
|
|
|
{
|
|
|
|
files: ['*.json'],
|
|
|
|
parser: 'jsonc-eslint-parser',
|
|
|
|
},
|
2024-01-04 01:07:25 +03:00
|
|
|
],
|
|
|
|
};
|