73 lines
2.3 KiB
JavaScript
73 lines
2.3 KiB
JavaScript
//.eslintrc.lenient.cjs
|
|
/** @type {import('eslint').Linter.Config} */
|
|
module.exports = {
|
|
root: true,
|
|
env: { browser: true, node: true, es2022: true },
|
|
|
|
parser: '@typescript-eslint/parser',
|
|
parserOptions: {
|
|
sourceType: 'module',
|
|
ecmaVersion: 'latest',
|
|
project: ['./tsconfig.json'],
|
|
tsconfigRootDir: __dirname
|
|
},
|
|
|
|
plugins: ['@typescript-eslint', 'simple-import-sort', 'import'],
|
|
extends: [
|
|
'eslint:recommended',
|
|
// без requiring-type-checking
|
|
'plugin:@typescript-eslint/recommended',
|
|
'prettier'
|
|
],
|
|
|
|
rules: {
|
|
// стиль
|
|
semi: ['error', 'never'],
|
|
'@typescript-eslint/semi': ['error', 'never'],
|
|
'max-len': ['error', {
|
|
code: 120, comments: 120, tabWidth: 2,
|
|
ignoreUrls: true, ignoreStrings: true, ignoreTemplateLiterals: true,
|
|
ignoreComments: true, ignoreTrailingComments: true,
|
|
ignorePattern: '^\\s*import\\s.*$'
|
|
}],
|
|
|
|
// сортировка импортов
|
|
'simple-import-sort/imports': ['error', {
|
|
groups: [
|
|
['^react$', '^@?\\w'],
|
|
['^@/'],
|
|
['^\\.\\.(?!/?$)', '^\\.\\./?$'],
|
|
['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
|
|
['^.+\\.s?css$']
|
|
]
|
|
}],
|
|
'simple-import-sort/exports': 'error',
|
|
'import/order': 'off',
|
|
|
|
// «шумные» правила — ослабляем
|
|
'@typescript-eslint/no-unsafe-assignment': 'off',
|
|
'@typescript-eslint/no-unsafe-member-access': 'off',
|
|
'@typescript-eslint/no-unsafe-call': 'off',
|
|
'@typescript-eslint/no-unsafe-return': 'off',
|
|
'@typescript-eslint/no-unsafe-argument': 'off',
|
|
'@typescript-eslint/no-floating-promises': 'off',
|
|
'@typescript-eslint/unbound-method': 'off',
|
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
'@typescript-eslint/ban-types': 'off',
|
|
'@typescript-eslint/no-redundant-type-constituents': 'off',
|
|
'@typescript-eslint/no-namespace': 'off',
|
|
'no-empty': 'off',
|
|
|
|
// unused vars — мягче, разрешаем _*
|
|
'no-unused-vars': 'off',
|
|
'@typescript-eslint/no-unused-vars': ['warn', {
|
|
argsIgnorePattern: '^_', varsIgnorePattern: '^_', caughtErrorsIgnorePattern: '^_'
|
|
}]
|
|
},
|
|
|
|
ignorePatterns: [
|
|
'node_modules/', 'dist/', 'build/', 'coverage/', 'demo/', 'vendors/', '**/*.d.ts',
|
|
'tsup.config.bundled_*.mjs'
|
|
]
|
|
}
|