diff --git a/package.json b/package.json index f2f6ae5..b2c29ae 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@sebastianbrenner/eslint-config", - "version": "1.1.1", + "version": "1.1.2", "type": "module", "main": "./index.js", "scripts": { diff --git a/src/index.js b/src/index.js index cef2291..6363595 100644 --- a/src/index.js +++ b/src/index.js @@ -7,14 +7,14 @@ import importPlugin from "eslint-plugin-import"; import unusedImports from "eslint-plugin-unused-imports"; export default [ - /* JS (all files, no type info) */ + /* Base JS rules (all files) */ js.configs.recommended, - /* TypeScript with type checking (ONLY TS files) */ - { + /* TypeScript – typed, scoped, flat-config correct */ + ...tseslint.configs.recommendedTypeChecked.map(config => ({ + ...config, files: ["**/*.ts", "**/*.tsx"], - ...tseslint.configs.recommendedTypeChecked, - }, + })), /* React */ react.configs.flat.recommended, @@ -27,10 +27,10 @@ export default [ rules: reactHooks.configs.recommended.rules, }, - /* JSX a11y */ + /* JSX Accessibility */ a11y.flatConfigs.recommended, - /* Imports */ + /* Import rules */ importPlugin.flatConfigs.recommended, /* Unused imports */ @@ -46,4 +46,13 @@ export default [ ], }, }, + + /* React version detection */ + { + settings: { + react: { + version: "detect", + }, + }, + }, ];