Skip to content

Commit

Permalink
fix(eslint-config): fix plugin resolving
Browse files Browse the repository at this point in the history
  • Loading branch information
andrepolischuk committed Jan 18, 2024
1 parent 6421d9d commit 9a6087e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
24 changes: 11 additions & 13 deletions packages/eslint-config/js.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
/* eslint-disable no-magic-numbers */
/**
* @rushstack/eslint-patch is used to include plugins as dev
* dependencies instead of imposing them as peer dependencies
*
* https://www.npmjs.com/package/@rushstack/eslint-patch
*/
require('@rushstack/eslint-patch/modern-module-resolution')

module.exports = {
parser: '@babel/eslint-parser',
Expand Down Expand Up @@ -87,22 +94,19 @@ module.exports = {
next: 'expression'
}
],
'no-duplicate-imports': 2,
'no-duplicate-imports': 'error',
'no-constant-condition': [
'error',
{
checkLoops: false
}
],
'import/no-unresolved': ['error', {caseSensitiveStrict: true}],
'import/no-cycle': 'error',
'import/no-useless-path-segments': 'error',
'import/no-relative-parent-imports': 'error',
'import/no-default-export': 'error',
'import/no-unused-modules': [
'error',
{missingExports: false, unusedExports: true}
],
'import/no-unused-modules': 'off',
'import/no-unresolved': 'off',
'import/no-anonymous-default-export': [
'error',
{allowCallExpression: false}
Expand All @@ -128,13 +132,7 @@ module.exports = {
'sonar/concise-regex': 'error',
'sonar/disabled-auto-escaping': 'error',
'sonar/disabled-resource-integrity': 'error',
/**
* правило невозможно отключить для отдельных случаев,
* при использовании webpack EnvironmentPlugin необходимо
* использовать process.env.SOME_VAR без деструктуризации
* https://github.com/webpack/webpack/issues/14800
*/
'sonar/destructuring-assignment-syntax': 'off',
'sonar/destructuring-assignment-syntax': 'error',
'sonar/empty-string-repetition': 'error',
'sonar/function-name': [
'error',
Expand Down
5 changes: 4 additions & 1 deletion packages/eslint-config/ts.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
require('@rushstack/eslint-patch/modern-module-resolution')

module.exports = {
parser: '@typescript-eslint/parser',
rules: {
'@typescript-eslint/no-unused-vars': [
'error',
Expand All @@ -17,6 +16,10 @@ module.exports = {
overrides: [
{
files: ['*.ts', '*.mts', '*.cts', '*.tsx'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: true
},
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:import/typescript'
Expand Down

0 comments on commit 9a6087e

Please sign in to comment.