CI / Сборка (push) Failing after 4s
CI / Деплой на стейджинг (push) Skipped
CI / Проверка кода (push) Skipped
CI / Сборка (pull_request) Successful in 1m46s
CI / Деплой на стейджинг (pull_request) Failing after 2s
CI / Проверка кода (pull_request) Successful in 1m17s
117 lines
3.8 KiB
JavaScript
117 lines
3.8 KiB
JavaScript
import nx from '@nx/eslint-plugin';
|
|
import importPlugin from 'eslint-plugin-import-x';
|
|
import unusedImports from 'eslint-plugin-unused-imports';
|
|
import { defineConfig, globalIgnores } from 'eslint/config';
|
|
|
|
export default defineConfig([
|
|
...nx.configs['flat/base'],
|
|
...nx.configs['flat/typescript'],
|
|
...nx.configs['flat/javascript'],
|
|
globalIgnores([
|
|
'**/dist',
|
|
'**/out-tsc',
|
|
'**/vite.config.*.timestamp*',
|
|
'**/vitest.config.*.timestamp*',
|
|
]),
|
|
{
|
|
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
|
|
plugins: {
|
|
'import-x': importPlugin,
|
|
'unused-imports': unusedImports,
|
|
},
|
|
rules: {
|
|
'@nx/enforce-module-boundaries': [
|
|
'error',
|
|
{
|
|
enforceBuildableLibDependency: true,
|
|
allow: ['^.*/eslint(\\.base)?\\.config\\.[cm]?[jt]s$'],
|
|
allowCircularSelfDependency: true,
|
|
depConstraints: [
|
|
{
|
|
sourceTag: '*',
|
|
onlyDependOnLibsWithTags: ['*'],
|
|
},
|
|
],
|
|
},
|
|
],
|
|
'@typescript-eslint/no-empty-function': 'warn',
|
|
'@typescript-eslint/no-inferrable-types': 'warn',
|
|
'no-restricted-globals': 'warn',
|
|
|
|
'import-x/order': [
|
|
'error',
|
|
{
|
|
pathGroups: [
|
|
{
|
|
pattern: 'react',
|
|
group: 'builtin',
|
|
position: 'before',
|
|
},
|
|
{
|
|
pattern: '@it-smi/**',
|
|
group: 'internal',
|
|
},
|
|
],
|
|
|
|
pathGroupsExcludedImportTypes: ['react'],
|
|
'newlines-between': 'always',
|
|
groups: ['builtin', 'external', 'internal', 'parent', ['sibling', 'index']],
|
|
|
|
alphabetize: {
|
|
order: 'asc',
|
|
caseInsensitive: true,
|
|
},
|
|
},
|
|
],
|
|
'sort-imports': [
|
|
'error',
|
|
{
|
|
ignoreCase: true,
|
|
ignoreDeclarationSort: true,
|
|
ignoreMemberSort: false,
|
|
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
|
|
allowSeparatedGroups: false,
|
|
},
|
|
],
|
|
'unused-imports/no-unused-imports': 'error',
|
|
'no-unused-vars': 'off',
|
|
'@typescript-eslint/no-unused-vars': 'off',
|
|
'unused-imports/no-unused-vars': [
|
|
'error',
|
|
{
|
|
vars: 'all',
|
|
varsIgnorePattern: '^_',
|
|
args: 'after-used',
|
|
argsIgnorePattern: '^_',
|
|
caughtErrors: 'all',
|
|
caughtErrorsIgnorePattern: '^_',
|
|
},
|
|
],
|
|
'import-x/no-duplicates': 'error',
|
|
'@typescript-eslint/ban-ts-comment': [
|
|
'error',
|
|
{
|
|
'ts-ignore': 'allow-with-description',
|
|
'ts-nocheck': 'allow-with-description',
|
|
'ts-check': false,
|
|
'ts-expect-error': false,
|
|
},
|
|
],
|
|
},
|
|
},
|
|
{
|
|
files: [
|
|
'**/*.ts',
|
|
'**/*.tsx',
|
|
'**/*.cts',
|
|
'**/*.mts',
|
|
'**/*.js',
|
|
'**/*.jsx',
|
|
'**/*.cjs',
|
|
'**/*.mjs',
|
|
],
|
|
// Override or add rules here
|
|
rules: {},
|
|
},
|
|
]);
|