Skip to content

Eslint and Vite errors after scaffolding new react project #5015

Description

@s4ff0x

Description:

After creating new project using ionic-cli some error messages were discovered

  1. Error [ERR_REQUIRE_ESM]: Cannot read config file: //.eslintrc.js
  2. TS2345: Argument of type '{ plugins: PluginOption[][]; test: { globals: boolean; environment: string; setupFiles: string; }; }' is not assignable to parameter of type 'UserConfigExport'.
  3. ESLint: Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

Steps to Reproduce:
ionic start -> choose react with side menu -> check tsx files and vite.config

Possible solutions

  1. rename .eslintrc.js to .eslintrc.cjs
  2. take eslint config and eslint plugins from default vite react app (yarn create vite)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions