diff --git a/eslint.js b/eslint.js index 313d469..f0794aa 100644 --- a/eslint.js +++ b/eslint.js @@ -1,8 +1,4 @@ import globals from 'globals' -import { - parser as typescriptParser, - plugin as typescriptPlugin, -} from 'typescript-eslint' const ERROR = 'error' const WARN = 'warn' @@ -81,6 +77,7 @@ export const config = [ react: (await import('eslint-plugin-react')).default, }, languageOptions: { + parser: (await import('typescript-eslint')).parser, parserOptions: { jsx: true, }, @@ -131,13 +128,13 @@ export const config = [ ? { files: ['**/*.ts?(x)'], languageOptions: { - parser: typescriptParser, + parser: (await import('typescript-eslint')).parser, parserOptions: { projectService: true, }, }, plugins: { - '@typescript-eslint': typescriptPlugin, + '@typescript-eslint': (await import('typescript-eslint')).plugin, }, rules: { '@typescript-eslint/no-unused-vars': [ diff --git a/fixture/app/components/swizzle.jsx b/fixture/app/components/swizzle.jsx new file mode 100644 index 0000000..48a3d16 --- /dev/null +++ b/fixture/app/components/swizzle.jsx @@ -0,0 +1,7 @@ +import { useState } from 'react' + +export function Counter() { + const [count, setCount] = useState(0) + const increment = () => setCount((c) => c + 1) + return +}