superplate-core-plugins icon indicating copy to clipboard operation
superplate-core-plugins copied to clipboard

[BUG] Superplate places some imports in body in App.tsx

Open alexhafner opened this issue 4 years ago • 1 comments

Describe the bug When invoking Superplate with refine-react, auth0 and custom layout app.tsx runs into errors of type "Import in body of module; reorder to top import/first". It's easily enough fixed by reordering the imports to the top, but can be a tad irritating for people trialling the product.

To Reproduce Steps to reproduce the behavior:

npx superplate-cli refine-tutorial ✔ Cloned remote source successfully. ✔ Select your project type › refine-react ✔ What will be the name of your app · refine-tutorial ✔ Package manager: · yarn ✔ Do you want to customize theme?: · css ✔ Data Provider: · graphql-data-provider ✔ Auth Provider: · auth0-auth-provider ✔ Do you want to customize layout? · custom-layout ✔ i18n - Internationalization: · i18n

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: macOS
  • Browser Edge
  • Version 95.0.1020.44
  • Used dataProvider graphql

Smartphone (please complete the following information): N/A

Additional context Add any other context about the problem here.

Detail Errors:

src/App.tsx
  Line 11:1:  Import in body of module; reorder to top  import/first
  Line 12:1:  Import in body of module; reorder to top  import/first
  Line 13:1:  Import in body of module; reorder to top  import/first
  Line 14:1:  Import in body of module; reorder to top  import/first
  Line 22:1:  Import in body of module; reorder to top  import/first

Auto-generated code in App.tsx:

import { Refine, AuthProvider } from "@pankod/refine";
import routerProvider from "@pankod/refine-react-router";

import "@pankod/refine/dist/styles.min.css";
import dataProvider from "@pankod/refine-graphql";
import { GraphQLClient } from "graphql-request";

const API_URL = "https://your-graphql-url/graphql";
const client = new GraphQLClient(API_URL);
const gqlDataProvider = dataProvider(client);
import axios from "axios";
import { useAuth0 } from "@auth0/auth0-react";
import { Login } from "pages/login";

alexhafner avatar Nov 10 '21 11:11 alexhafner

Hey @alexhafner , I moved this issue here because it is related to superplate. We will fix the problem and let you know! Have a great day!

omeraplak avatar Nov 10 '21 12:11 omeraplak