Skip to content

Commit

Permalink
fix(eslint-plugin-experience): conflicts with typescript-eslint parse…
Browse files Browse the repository at this point in the history
…r v6 and import plugin
  • Loading branch information
splincode committed Sep 3, 2023
1 parent 16983c4 commit 24237b7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 66 deletions.
42 changes: 13 additions & 29 deletions projects/eslint-plugin-experience/configs/angular/imports/index.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,23 @@
module.exports = {
parser: '@typescript-eslint/parser',
plugins: [
'import',
'@typescript-eslint',
'simple-import-sort',
'eslint-plugin-import',
],
settings: {
'import/parsers': {'@typescript-eslint/parser': ['.ts']},
'import/resolver': {
'eslint-import-resolver-typescript': true,
typescript: {
// always try to resolve types under `<root>@types` directory
// even it doesn't contain any source code, like `@types/etc`
alwaysTryTypes: true,
},
},
},
plugins: ['import', 'simple-import-sort'],
rules: {
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'import/first': 'error',
'import/exports-last': 'off',
'import/no-default-export': 'off',
'import/newline-after-import': ['error', {count: 1}],
'import/no-webpack-loader-syntax': 'off',
/**
* @note: note you must disable the base rule
* as it can report incorrect errors in @typescript-eslint
*/
'import/no-duplicates': 'off',
'import/extensions': 'off',
'import/prefer-default-export': 'off',
'import/no-extraneous-dependencies': 'off',
'import/no-unresolved': 'off',
'no-duplicate-imports': 'off',
'@typescript-eslint/no-duplicate-imports': 'error',

// overwrite rule from `@tinkoff/eslint-config`
'@typescript-eslint/consistent-type-imports': 'off',
/**
* @note: you must disable some base rule
* as it can report incorrect errors with @typescript-eslint
*/
'import/first': 'error',
'import/newline-after-import': ['error', {count: 1}],
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
},
};
4 changes: 0 additions & 4 deletions projects/eslint-plugin-experience/configs/base/base.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
module.exports = {
extends: ['eslint-config-airbnb-base', 'plugin:eslint-comments/recommended'],
parser: '@babel/eslint-parser',
settings: {
'import/parser': '@babel/eslint-parser',
},
plugins: ['@babel'],
parserOptions: {
ecmaFeatures: {
Expand Down
32 changes: 0 additions & 32 deletions projects/eslint-plugin-experience/configs/base/import.js

This file was deleted.

1 change: 0 additions & 1 deletion projects/eslint-plugin-experience/configs/base/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ module.exports = {
extends: [
'./configs/base/base',
'./configs/base/sort-class-members',
'./configs/base/import',
'./configs/base/promise',
'./configs/base/test-files',
'./configs/base/typescript',
Expand Down

0 comments on commit 24237b7

Please sign in to comment.