Skip to content

Commit

Permalink
Correctly specify react version and fix typescript overrides. (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
joephela authored Jul 15, 2024
1 parent 469c750 commit 1913360
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .changeset/happy-moose-care.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'eslint-config-widen': patch
'eslint-playground': patch
---

Correctly specify react version and fix typescript overrides.
14 changes: 9 additions & 5 deletions packages/eslint-config-widen/src/react.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ const languageOptions = {
},
}

const reactVersion = {
settings: {
react: {
version: 'detect',
},
},
}

export default [
{
files: ['**/*.{js,jsx,mjs,cjs,ts,tsx}'],
Expand All @@ -22,6 +30,7 @@ export default [
rules: {
...react.configs.recommended.rules,
},
...reactVersion,
},
{
files: ['**/*.{js,jsx,mjs,cjs,ts,tsx}'],
Expand Down Expand Up @@ -102,10 +111,5 @@ export default [
'widen/jsx-fragments': 'error',
'widen/jsx-import': 'error',
},
settings: {
react: {
version: 'detect',
},
},
},
]
1 change: 0 additions & 1 deletion packages/eslint-config-widen/src/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { configs, parser, plugin } from 'typescript-eslint'
export default [
...configs.recommended,
{
files: ['*.ts', '*.tsx'],
languageOptions: {
parser: parser,
},
Expand Down
7 changes: 6 additions & 1 deletion packages/eslint-playground/reactTest.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@ import React from 'react'

export function test(unused, unused) {
console.log('wow')
return <button>Test</button>
return (
<div>
<div children="Children" />
<button autoFocus={true}>Test</button>
</div>
)
}

0 comments on commit 1913360

Please sign in to comment.