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

ESLint formatting rules are deprecated #3385

Open
Gazook89 opened this issue Apr 1, 2024 · 6 comments
Open

ESLint formatting rules are deprecated #3385

Gazook89 opened this issue Apr 1, 2024 · 6 comments

Comments

@Gazook89
Copy link
Collaborator

Gazook89 commented Apr 1, 2024

Your idea:

I was looking at ESLint for something else and noticed that as of Nov 2023, the rules around formatting in ESLint are deprecated. They will continue to work until v10 (we are at ~v8.5 now), but they recommend using Prettier or some other option to handle the code formatting.

Read about it here. https://eslint.org/blog/2023/10/deprecating-formatting-rules/

It looks like it is also possible to add another library that will maintain the existing rules as well.

@Gazook89
Copy link
Collaborator Author

Gazook89 commented Apr 1, 2024

I'm not 100% sure about using Prettier (meaning I'm not sure I like everything about the output) but I could probably get used to it. I used their playground a bit, and here is the config I think I like most:

{
  "arrowParens": "always",
  "bracketSameLine": true,
  "bracketSpacing": true,
  "semi": true,
  "experimentalTernaries": false,
  "singleQuote": true,
  "jsxSingleQuote": true,
  "quoteProps": "as-needed",
  "trailingComma": "none",
  "singleAttributePerLine": false,
  "htmlWhitespaceSensitivity": "css",
  "vueIndentScriptAndStyle": false,
  "proseWrap": "preserve",
  "insertPragma": false,
  "printWidth": 80,
  "requirePragma": false,
  "tabWidth": 4,
  "useTabs": true,
  "embeddedLanguageFormatting": "auto"
}

@5e-Cleric
Copy link
Member

Been using Prettier for a while now, i like it, but how does this affect #3384?

@Gazook89
Copy link
Collaborator Author

Gazook89 commented Apr 2, 2024

Likely it just means running one more script: stylelint, eslint, and prettier. Might have to look at the order of them.

@5e-Cleric
Copy link
Member

What is the point of running multiple lints which will achieve the same result? why not move to use exclusively prettier?

@calculuschild
Copy link
Member

calculuschild commented Apr 2, 2024

ESLint used to do both error checking and code formatting. They are making a move away from formatting to just check for errors (unused variables, missing return statements, avoiding certain kinds of loops, unreachable code, etc).

Prettier is a code formatter (spaces, aligning colone, etc). If ESLint drops the code formatting we will need to use something like Prettier as well if we want consistent style in the code.

@Gazook89
Copy link
Collaborator Author

Gazook89 commented Apr 3, 2024

okay, from gitter:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants