diff --git a/eslint.config.js b/eslint.config.js index 85611ce..248b5f2 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -5,6 +5,10 @@ export default [ { settings: { react: { version: '18' } }, }, + { + files: ['prettier.config.js'], + rules: { 'no-barrel-files/no-barrel-files': 'off' }, + }, { ignores: ['dist/'], }, diff --git a/package.json b/package.json index 74df3a6..fff2876 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "@eslint/js": "^10.0.1", "eslint-config-prettier": "^10.1.8", "eslint-plugin-jsx-a11y": "^6.10.2", + "eslint-plugin-no-barrel-files": "^1.3.1", "eslint-plugin-prettier": "^5.5.5", "eslint-plugin-react": "^7.37.5", "eslint-plugin-react-hooks": "^7.1.1", diff --git a/src/index.js b/src/index.js index 2e53c80..899f49a 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,7 @@ import { fixupPluginRules } from '@eslint/compat'; import eslint from '@eslint/js'; import jsxA11yPlugin from 'eslint-plugin-jsx-a11y'; +import noBarrelFiles from 'eslint-plugin-no-barrel-files'; import eslintPluginPrettier from 'eslint-plugin-prettier/recommended'; import reactPlugin from 'eslint-plugin-react'; import hooksPlugin from 'eslint-plugin-react-hooks'; @@ -9,6 +10,7 @@ import tsEslint from 'typescript-eslint'; const base = [ eslint.configs.recommended, ...tsEslint.configs.recommended, + ...noBarrelFiles.configs['flat/recommended'], eslintPluginPrettier, { rules: { diff --git a/yarn.lock b/yarn.lock index 3f960e3..1549ca8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15,6 +15,7 @@ __metadata: eslint: "npm:^10.1.0" eslint-config-prettier: "npm:^10.1.8" eslint-plugin-jsx-a11y: "npm:^6.10.2" + eslint-plugin-no-barrel-files: "npm:^1.3.1" eslint-plugin-prettier: "npm:^5.5.5" eslint-plugin-react: "npm:^7.37.5" eslint-plugin-react-hooks: "npm:^7.1.1" @@ -782,6 +783,19 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/project-service@npm:8.59.4": + version: 8.59.4 + resolution: "@typescript-eslint/project-service@npm:8.59.4" + dependencies: + "@typescript-eslint/tsconfig-utils": "npm:^8.59.4" + "@typescript-eslint/types": "npm:^8.59.4" + debug: "npm:^4.4.3" + peerDependencies: + typescript: ">=4.8.4 <6.1.0" + checksum: 10c0/ba466e3b4091f79bd9ae8c29591d4858760293c2bc5d355642b9bf04b9c6fcd4418ff255485aaaf005edb84f6aaefeb53a3c1627bbbb70a905a4786d20f0b06a + languageName: node + linkType: hard + "@typescript-eslint/scope-manager@npm:8.59.1": version: 8.59.1 resolution: "@typescript-eslint/scope-manager@npm:8.59.1" @@ -792,6 +806,16 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/scope-manager@npm:8.59.4": + version: 8.59.4 + resolution: "@typescript-eslint/scope-manager@npm:8.59.4" + dependencies: + "@typescript-eslint/types": "npm:8.59.4" + "@typescript-eslint/visitor-keys": "npm:8.59.4" + checksum: 10c0/0e4701f8c3384c7406f372cb06762d6bf943aba3afe2c231e4e942ee2e8b4cd4e9e7667ec503502dc4a159b826892dbe1487e2a8d143e190c850744b2a329857 + languageName: node + linkType: hard + "@typescript-eslint/tsconfig-utils@npm:8.59.1, @typescript-eslint/tsconfig-utils@npm:^8.59.1": version: 8.59.1 resolution: "@typescript-eslint/tsconfig-utils@npm:8.59.1" @@ -801,6 +825,15 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/tsconfig-utils@npm:8.59.4, @typescript-eslint/tsconfig-utils@npm:^8.59.4": + version: 8.59.4 + resolution: "@typescript-eslint/tsconfig-utils@npm:8.59.4" + peerDependencies: + typescript: ">=4.8.4 <6.1.0" + checksum: 10c0/ef6cf20eb93cb5e12439bc9713f5d9c619d516aefd3ecd4f111d9b23ef9f36e5c13f1bbcd55faa6a4b788b146b2a8724a418504107d4d377d0463f419fe9e1f3 + languageName: node + linkType: hard + "@typescript-eslint/type-utils@npm:8.59.1": version: 8.59.1 resolution: "@typescript-eslint/type-utils@npm:8.59.1" @@ -824,6 +857,13 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/types@npm:8.59.4, @typescript-eslint/types@npm:^8.59.4": + version: 8.59.4 + resolution: "@typescript-eslint/types@npm:8.59.4" + checksum: 10c0/5bb831f9acf98057b3dce6ebfc1df5f1796e701cdf035e71fdee6d0bb7f7e7d9c428bac38f46db4e08381ad8903424fcfbe55bcae223a6244b9133de8e0be190 + languageName: node + linkType: hard + "@typescript-eslint/typescript-estree@npm:8.59.1": version: 8.59.1 resolution: "@typescript-eslint/typescript-estree@npm:8.59.1" @@ -843,6 +883,25 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/typescript-estree@npm:8.59.4": + version: 8.59.4 + resolution: "@typescript-eslint/typescript-estree@npm:8.59.4" + dependencies: + "@typescript-eslint/project-service": "npm:8.59.4" + "@typescript-eslint/tsconfig-utils": "npm:8.59.4" + "@typescript-eslint/types": "npm:8.59.4" + "@typescript-eslint/visitor-keys": "npm:8.59.4" + debug: "npm:^4.4.3" + minimatch: "npm:^10.2.2" + semver: "npm:^7.7.3" + tinyglobby: "npm:^0.2.15" + ts-api-utils: "npm:^2.5.0" + peerDependencies: + typescript: ">=4.8.4 <6.1.0" + checksum: 10c0/2f427f9ba3ea1c7d1f476883f9769827c7082ff3cefcb189dcdb2dc33b16fa459e40894152d42583df90d0ed1041a1043830ecba5326c0b1de6becb9cf22fcee + languageName: node + linkType: hard + "@typescript-eslint/utils@npm:8.59.1": version: 8.59.1 resolution: "@typescript-eslint/utils@npm:8.59.1" @@ -858,6 +917,21 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/utils@npm:^8.58.1": + version: 8.59.4 + resolution: "@typescript-eslint/utils@npm:8.59.4" + dependencies: + "@eslint-community/eslint-utils": "npm:^4.9.1" + "@typescript-eslint/scope-manager": "npm:8.59.4" + "@typescript-eslint/types": "npm:8.59.4" + "@typescript-eslint/typescript-estree": "npm:8.59.4" + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + typescript: ">=4.8.4 <6.1.0" + checksum: 10c0/f2e7f6237defd49e578731762e8736e7316e4873e326d48ec56651dcd0204962367f3e91692939e1636f443a8ded524336b7ee0874b6267940e77f5dc8fce175 + languageName: node + linkType: hard + "@typescript-eslint/visitor-keys@npm:8.59.1": version: 8.59.1 resolution: "@typescript-eslint/visitor-keys@npm:8.59.1" @@ -868,6 +942,16 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/visitor-keys@npm:8.59.4": + version: 8.59.4 + resolution: "@typescript-eslint/visitor-keys@npm:8.59.4" + dependencies: + "@typescript-eslint/types": "npm:8.59.4" + eslint-visitor-keys: "npm:^5.0.0" + checksum: 10c0/fcef4078988d725f0e56104038cc903d78cb5527e10e4da2c29ae7cb65e5b46c6a8f3f20d2be3e83b4cbaf27a723d1d2b31027006b5f1d43bf1fb0baed8e7641 + languageName: node + linkType: hard + "abbrev@npm:^2.0.0": version: 2.0.0 resolution: "abbrev@npm:2.0.0" @@ -1871,6 +1955,17 @@ __metadata: languageName: node linkType: hard +"eslint-plugin-no-barrel-files@npm:^1.3.1": + version: 1.3.1 + resolution: "eslint-plugin-no-barrel-files@npm:1.3.1" + dependencies: + "@typescript-eslint/utils": "npm:^8.58.1" + peerDependencies: + eslint: ^8.0.0 || ^9.0.0 || ^10.0.0 + checksum: 10c0/283538555fd23347cb016841ac77ad0ea16b5a4dde5e155c7d8dd675a228a63c170a9d661ae2c7646d7a3e0b1d262fc28d860f024f4a7415c408b5c8943e6c60 + languageName: node + linkType: hard + "eslint-plugin-prettier@npm:^5.5.5": version: 5.5.5 resolution: "eslint-plugin-prettier@npm:5.5.5"