Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6291

How to fix error in eslint while type import?

$
0
0

Hi I have probleb with ESLINT setup, for my TS, expo, react-native project.

I have added TS, import type, and have 'parsing error' from standard.

enter image description here

my configs:

babel.js:

module.exports = function (api) {  api.cache(true)  return {    presets: ['babel-preset-expo', ]  }}

tsconfig.json

{"extends": "expo/tsconfig.base","compilerOptions": {"strict": true  }}

and .eslintrc.js

module.exports = {  env: {    browser: false,    es2021: true  },  extends: ['plugin:react/recommended','standard-with-typescript'  ],  parser: '@typescript-eslint/parser',  overrides: [    {      files: ['*.ts', '*.tsx'], // Your TypeScript files extension      // As mentioned in the comments, you should extend TypeScript plugins here,      // instead of extending them outside the `overrides`.      // If you don't want to extend any rules, you don't need an `extends` attribute.      extends: ['plugin:@typescript-eslint/recommended','plugin:@typescript-eslint/recommended-requiring-type-checking'      ],      parserOptions: {        project: ['./tsconfig.json'] // Specify it only for TypeScript files      }    }  ],  parserOptions: {    ecmaVersion: 'latest',    sourceType: 'module'  },  plugins: ['react','@typescript-eslint'  ],  rules: {  }}

What happened here and how can I remove that error in my VS Code?


Viewing all articles
Browse latest Browse all 6291

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>