diff --git a/.changeset/happy-moose-care.md b/.changeset/happy-moose-care.md new file mode 100644 index 0000000..3d71dd5 --- /dev/null +++ b/.changeset/happy-moose-care.md @@ -0,0 +1,6 @@ +--- +'eslint-config-widen': patch +'eslint-playground': patch +--- + +Correctly specify react version and fix typescript overrides. diff --git a/packages/eslint-config-widen/src/react.ts b/packages/eslint-config-widen/src/react.ts index 67b1b24..eb3a267 100644 --- a/packages/eslint-config-widen/src/react.ts +++ b/packages/eslint-config-widen/src/react.ts @@ -12,6 +12,14 @@ const languageOptions = { }, } +const reactVersion = { + settings: { + react: { + version: 'detect', + }, + }, +} + export default [ { files: ['**/*.{js,jsx,mjs,cjs,ts,tsx}'], @@ -22,6 +30,7 @@ export default [ rules: { ...react.configs.recommended.rules, }, + ...reactVersion, }, { files: ['**/*.{js,jsx,mjs,cjs,ts,tsx}'], @@ -102,10 +111,5 @@ export default [ 'widen/jsx-fragments': 'error', 'widen/jsx-import': 'error', }, - settings: { - react: { - version: 'detect', - }, - }, }, ] diff --git a/packages/eslint-config-widen/src/typescript.ts b/packages/eslint-config-widen/src/typescript.ts index a9fafb3..1e54a47 100644 --- a/packages/eslint-config-widen/src/typescript.ts +++ b/packages/eslint-config-widen/src/typescript.ts @@ -3,7 +3,6 @@ import { configs, parser, plugin } from 'typescript-eslint' export default [ ...configs.recommended, { - files: ['*.ts', '*.tsx'], languageOptions: { parser: parser, }, diff --git a/packages/eslint-playground/reactTest.jsx b/packages/eslint-playground/reactTest.jsx index 78a68fe..e6689a8 100644 --- a/packages/eslint-playground/reactTest.jsx +++ b/packages/eslint-playground/reactTest.jsx @@ -2,5 +2,10 @@ import React from 'react' export function test(unused, unused) { console.log('wow') - return + return ( +