Skip to content

Commit 1df309b

Browse files
Merge pull request #68 from aligent/feature/TCS-11_add-no-barrel-imports-eslint-rule
TCS-11: Add eslint-plugin-no-barrel-files rule to react config
2 parents bcca6f3 + 1f70141 commit 1df309b

4 files changed

Lines changed: 102 additions & 0 deletions

File tree

eslint.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ export default [
55
{
66
settings: { react: { version: '18' } },
77
},
8+
{
9+
files: ['prettier.config.js'],
10+
rules: { 'no-barrel-files/no-barrel-files': 'off' },
11+
},
812
{
913
ignores: ['dist/'],
1014
},

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"@eslint/js": "^10.0.1",
2828
"eslint-config-prettier": "^10.1.8",
2929
"eslint-plugin-jsx-a11y": "^6.10.2",
30+
"eslint-plugin-no-barrel-files": "^1.3.1",
3031
"eslint-plugin-prettier": "^5.5.5",
3132
"eslint-plugin-react": "^7.37.5",
3233
"eslint-plugin-react-hooks": "^7.1.1",

src/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { fixupPluginRules } from '@eslint/compat';
22
import eslint from '@eslint/js';
33
import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
4+
import noBarrelFiles from 'eslint-plugin-no-barrel-files';
45
import eslintPluginPrettier from 'eslint-plugin-prettier/recommended';
56
import reactPlugin from 'eslint-plugin-react';
67
import hooksPlugin from 'eslint-plugin-react-hooks';
@@ -9,6 +10,7 @@ import tsEslint from 'typescript-eslint';
910
const base = [
1011
eslint.configs.recommended,
1112
...tsEslint.configs.recommended,
13+
...noBarrelFiles.configs['flat/recommended'],
1214
eslintPluginPrettier,
1315
{
1416
rules: {

yarn.lock

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ __metadata:
1515
eslint: "npm:^10.1.0"
1616
eslint-config-prettier: "npm:^10.1.8"
1717
eslint-plugin-jsx-a11y: "npm:^6.10.2"
18+
eslint-plugin-no-barrel-files: "npm:^1.3.1"
1819
eslint-plugin-prettier: "npm:^5.5.5"
1920
eslint-plugin-react: "npm:^7.37.5"
2021
eslint-plugin-react-hooks: "npm:^7.1.1"
@@ -782,6 +783,19 @@ __metadata:
782783
languageName: node
783784
linkType: hard
784785

786+
"@typescript-eslint/project-service@npm:8.59.4":
787+
version: 8.59.4
788+
resolution: "@typescript-eslint/project-service@npm:8.59.4"
789+
dependencies:
790+
"@typescript-eslint/tsconfig-utils": "npm:^8.59.4"
791+
"@typescript-eslint/types": "npm:^8.59.4"
792+
debug: "npm:^4.4.3"
793+
peerDependencies:
794+
typescript: ">=4.8.4 <6.1.0"
795+
checksum: 10c0/ba466e3b4091f79bd9ae8c29591d4858760293c2bc5d355642b9bf04b9c6fcd4418ff255485aaaf005edb84f6aaefeb53a3c1627bbbb70a905a4786d20f0b06a
796+
languageName: node
797+
linkType: hard
798+
785799
"@typescript-eslint/scope-manager@npm:8.59.1":
786800
version: 8.59.1
787801
resolution: "@typescript-eslint/scope-manager@npm:8.59.1"
@@ -792,6 +806,16 @@ __metadata:
792806
languageName: node
793807
linkType: hard
794808

809+
"@typescript-eslint/scope-manager@npm:8.59.4":
810+
version: 8.59.4
811+
resolution: "@typescript-eslint/scope-manager@npm:8.59.4"
812+
dependencies:
813+
"@typescript-eslint/types": "npm:8.59.4"
814+
"@typescript-eslint/visitor-keys": "npm:8.59.4"
815+
checksum: 10c0/0e4701f8c3384c7406f372cb06762d6bf943aba3afe2c231e4e942ee2e8b4cd4e9e7667ec503502dc4a159b826892dbe1487e2a8d143e190c850744b2a329857
816+
languageName: node
817+
linkType: hard
818+
795819
"@typescript-eslint/tsconfig-utils@npm:8.59.1, @typescript-eslint/tsconfig-utils@npm:^8.59.1":
796820
version: 8.59.1
797821
resolution: "@typescript-eslint/tsconfig-utils@npm:8.59.1"
@@ -801,6 +825,15 @@ __metadata:
801825
languageName: node
802826
linkType: hard
803827

828+
"@typescript-eslint/tsconfig-utils@npm:8.59.4, @typescript-eslint/tsconfig-utils@npm:^8.59.4":
829+
version: 8.59.4
830+
resolution: "@typescript-eslint/tsconfig-utils@npm:8.59.4"
831+
peerDependencies:
832+
typescript: ">=4.8.4 <6.1.0"
833+
checksum: 10c0/ef6cf20eb93cb5e12439bc9713f5d9c619d516aefd3ecd4f111d9b23ef9f36e5c13f1bbcd55faa6a4b788b146b2a8724a418504107d4d377d0463f419fe9e1f3
834+
languageName: node
835+
linkType: hard
836+
804837
"@typescript-eslint/type-utils@npm:8.59.1":
805838
version: 8.59.1
806839
resolution: "@typescript-eslint/type-utils@npm:8.59.1"
@@ -824,6 +857,13 @@ __metadata:
824857
languageName: node
825858
linkType: hard
826859

860+
"@typescript-eslint/types@npm:8.59.4, @typescript-eslint/types@npm:^8.59.4":
861+
version: 8.59.4
862+
resolution: "@typescript-eslint/types@npm:8.59.4"
863+
checksum: 10c0/5bb831f9acf98057b3dce6ebfc1df5f1796e701cdf035e71fdee6d0bb7f7e7d9c428bac38f46db4e08381ad8903424fcfbe55bcae223a6244b9133de8e0be190
864+
languageName: node
865+
linkType: hard
866+
827867
"@typescript-eslint/typescript-estree@npm:8.59.1":
828868
version: 8.59.1
829869
resolution: "@typescript-eslint/typescript-estree@npm:8.59.1"
@@ -843,6 +883,25 @@ __metadata:
843883
languageName: node
844884
linkType: hard
845885

886+
"@typescript-eslint/typescript-estree@npm:8.59.4":
887+
version: 8.59.4
888+
resolution: "@typescript-eslint/typescript-estree@npm:8.59.4"
889+
dependencies:
890+
"@typescript-eslint/project-service": "npm:8.59.4"
891+
"@typescript-eslint/tsconfig-utils": "npm:8.59.4"
892+
"@typescript-eslint/types": "npm:8.59.4"
893+
"@typescript-eslint/visitor-keys": "npm:8.59.4"
894+
debug: "npm:^4.4.3"
895+
minimatch: "npm:^10.2.2"
896+
semver: "npm:^7.7.3"
897+
tinyglobby: "npm:^0.2.15"
898+
ts-api-utils: "npm:^2.5.0"
899+
peerDependencies:
900+
typescript: ">=4.8.4 <6.1.0"
901+
checksum: 10c0/2f427f9ba3ea1c7d1f476883f9769827c7082ff3cefcb189dcdb2dc33b16fa459e40894152d42583df90d0ed1041a1043830ecba5326c0b1de6becb9cf22fcee
902+
languageName: node
903+
linkType: hard
904+
846905
"@typescript-eslint/utils@npm:8.59.1":
847906
version: 8.59.1
848907
resolution: "@typescript-eslint/utils@npm:8.59.1"
@@ -858,6 +917,21 @@ __metadata:
858917
languageName: node
859918
linkType: hard
860919

920+
"@typescript-eslint/utils@npm:^8.58.1":
921+
version: 8.59.4
922+
resolution: "@typescript-eslint/utils@npm:8.59.4"
923+
dependencies:
924+
"@eslint-community/eslint-utils": "npm:^4.9.1"
925+
"@typescript-eslint/scope-manager": "npm:8.59.4"
926+
"@typescript-eslint/types": "npm:8.59.4"
927+
"@typescript-eslint/typescript-estree": "npm:8.59.4"
928+
peerDependencies:
929+
eslint: ^8.57.0 || ^9.0.0 || ^10.0.0
930+
typescript: ">=4.8.4 <6.1.0"
931+
checksum: 10c0/f2e7f6237defd49e578731762e8736e7316e4873e326d48ec56651dcd0204962367f3e91692939e1636f443a8ded524336b7ee0874b6267940e77f5dc8fce175
932+
languageName: node
933+
linkType: hard
934+
861935
"@typescript-eslint/visitor-keys@npm:8.59.1":
862936
version: 8.59.1
863937
resolution: "@typescript-eslint/visitor-keys@npm:8.59.1"
@@ -868,6 +942,16 @@ __metadata:
868942
languageName: node
869943
linkType: hard
870944

945+
"@typescript-eslint/visitor-keys@npm:8.59.4":
946+
version: 8.59.4
947+
resolution: "@typescript-eslint/visitor-keys@npm:8.59.4"
948+
dependencies:
949+
"@typescript-eslint/types": "npm:8.59.4"
950+
eslint-visitor-keys: "npm:^5.0.0"
951+
checksum: 10c0/fcef4078988d725f0e56104038cc903d78cb5527e10e4da2c29ae7cb65e5b46c6a8f3f20d2be3e83b4cbaf27a723d1d2b31027006b5f1d43bf1fb0baed8e7641
952+
languageName: node
953+
linkType: hard
954+
871955
"abbrev@npm:^2.0.0":
872956
version: 2.0.0
873957
resolution: "abbrev@npm:2.0.0"
@@ -1871,6 +1955,17 @@ __metadata:
18711955
languageName: node
18721956
linkType: hard
18731957

1958+
"eslint-plugin-no-barrel-files@npm:^1.3.1":
1959+
version: 1.3.1
1960+
resolution: "eslint-plugin-no-barrel-files@npm:1.3.1"
1961+
dependencies:
1962+
"@typescript-eslint/utils": "npm:^8.58.1"
1963+
peerDependencies:
1964+
eslint: ^8.0.0 || ^9.0.0 || ^10.0.0
1965+
checksum: 10c0/283538555fd23347cb016841ac77ad0ea16b5a4dde5e155c7d8dd675a228a63c170a9d661ae2c7646d7a3e0b1d262fc28d860f024f4a7415c408b5c8943e6c60
1966+
languageName: node
1967+
linkType: hard
1968+
18741969
"eslint-plugin-prettier@npm:^5.5.5":
18751970
version: 5.5.5
18761971
resolution: "eslint-plugin-prettier@npm:5.5.5"

0 commit comments

Comments
 (0)