Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add eslint, prettier and default vite gitignore to create-react-admin #9055

Merged
merged 10 commits into from
Jul 3, 2023

Conversation

djhi
Copy link
Collaborator

@djhi djhi commented Jun 27, 2023

Instructions to test the CLI are in its README

@smeng9
Copy link
Contributor

smeng9 commented Jun 27, 2023

Shall we consider eslint.config.js as the .eslintrc format will be deprecated.

Source: https://eslint.org/docs/latest/use/configure/configuration-files

@djhi djhi added RFR Ready For Review and removed WIP Work In Progress labels Jun 27, 2023
@djhi djhi added WIP Work In Progress and removed RFR Ready For Review labels Jun 28, 2023
@djhi
Copy link
Collaborator Author

djhi commented Jun 28, 2023

Shall we consider eslint.config.js as the .eslintrc format will be deprecated.

Source: https://eslint.org/docs/latest/use/configure/configuration-files

It's currently a pain to use. We'll wait for it to be necessary

@djhi djhi added RFR Ready For Review and removed WIP Work In Progress labels Jun 28, 2023
Copy link
Contributor

@slax57 slax57 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm seing the new config files alright, but I'm having issues when running npm run lint and npm run format in the generated project:

❯ npm run lint

> lint
> eslint --fix --ext .js,.jsx,.ts,.tsx ./src


Oops! Something went wrong! :(

ESLint: 8.43.0

ESLint couldn't find a configuration file. To set up a configuration file for this project, please run:

    npm init @eslint/config

ESLint looked for configuration files in /home/slax57/workspaces/my-admin/src and its ancestors. If it found none, it then looked in your home directory.

If you think you already have a configuration file or if you need more help, please stop by the ESLint Discord server: https://eslint.org/chat

and

❯ npm run format

> format
> prettier --write ./src

[error] Invalid configuration file `src/App.tsx`: Unexpected token 'export'

Do you have them too?

packages/create-react-admin/src/generateProject.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@slax57 slax57 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting seems to work now.

However I see visual regressions:

  • When choosing an option in the CLI, the whole section re-renders when the option changes
  • Once the script has run, the message "Your application my-admin was successfully generated. blahblahblah" appears twice

Copy link
Contributor

@slax57 slax57 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, everything looks good this time! 💪

@slax57 slax57 added this to the 4.11.5 milestone Jul 3, 2023
@slax57 slax57 merged commit 5d742a3 into master Jul 3, 2023
@slax57 slax57 deleted the create-react-admin-lint branch July 3, 2023 12:18
@slax57 slax57 modified the milestones: 4.11.5, 4.12.0 Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants