From 1913360ae897ea1e30077b1bbd519e3eb3d121da Mon Sep 17 00:00:00 2001 From: Joseph Phelan <47540781+joephela@users.noreply.github.com> Date: Mon, 15 Jul 2024 14:07:02 -0500 Subject: [PATCH] Correctly specify react version and fix typescript overrides. (#45) --- .changeset/happy-moose-care.md | 6 ++++++ packages/eslint-config-widen/src/react.ts | 14 +++++++++----- packages/eslint-config-widen/src/typescript.ts | 1 - packages/eslint-playground/reactTest.jsx | 7 ++++++- 4 files changed, 21 insertions(+), 7 deletions(-) create mode 100644 .changeset/happy-moose-care.md 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 ( +