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

Enforce file formatting across monorepo #1030

Closed
Tracked by #1035
mmarchetti opened this issue Feb 26, 2024 · 6 comments
Closed
Tracked by #1035

Enforce file formatting across monorepo #1030

mmarchetti opened this issue Feb 26, 2024 · 6 comments
Assignees
Labels

Comments

@mmarchetti
Copy link
Contributor

mmarchetti commented Feb 26, 2024

Had a spaces / tab mixing issue.

Formatting
@mmarchetti mmarchetti added this to the Alpha (v1.0.alpha3) milestone Feb 26, 2024
@dotNomad
Copy link
Collaborator

Noting that ESLint v9.0.0 (which is currently in beta.1) will make the eslint.config.js configuration format the default. If we are setting up ESLint we should use this to avoid migration work.

Sources

@dotNomad dotNomad mentioned this issue Feb 26, 2024
4 tasks
@dotNomad dotNomad self-assigned this Feb 26, 2024
@dotNomad
Copy link
Collaborator

dotNomad commented Feb 26, 2024

Note that we cannot use ESLint v9 directly because the TypeScript @typescript-eslint/eslint-plug will not work with v9 just yet, but can use the configuration format.

@dotNomad
Copy link
Collaborator

Formatting using ESLint is not recommended according to their blog: https://eslint.org/blog/2023/10/deprecating-formatting-rules/#what-you-should-do-instead

We recommend using a source code formatter instead of ESLint for formatting your code. Source code formatters are built to understand the entire file and apply consistent formatting throughout. While you might not have as much control over exceptions as with ESLint, the tradeoff is the simplicity and speed you’ll get vs. configuring ESLint with dozens of individual rules. There are two formatters that we recommend:

  • Prettier - a JavaScript-based formatter with support for formatting a large number of languages
  • dprint - a Rust-based formatter with support for a smaller set of languages

@dotNomad
Copy link
Collaborator

Looking into this further ESLint and and typescript-eslint support the new flat config format, but the two other plugins we are using: eslint-plugin-cypress and eslint-plugin-vue do not yet.

It looks like the Cypress plugin may not get support, it is unclear. That does inform us that we have to use the current format, and migrate when our dependencies allow us to or reconsider when the RC file format is deprecated by ESLint.

References

@dotNomad
Copy link
Collaborator

Ran into a weird CI run that cached files that caused formatting checking to fail on some OSes and not others. As part of this work we should re-visit our CI to ensure that linting and formatting checks run once, before the heavy jobs, and not per OS.

@dotNomad
Copy link
Collaborator

dotNomad commented Apr 3, 2024

Updating this issue to represent the formatting work that was accomplished in Alpha 5.

@dotNomad dotNomad closed this as completed Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants