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

Update linting/formatting tooling #5159

Open
jsumners opened this issue Nov 13, 2023 · 1 comment
Open

Update linting/formatting tooling #5159

jsumners opened this issue Nov 13, 2023 · 1 comment
Labels
dependencies Pull requests that update a dependency file

Comments

@jsumners
Copy link
Member

There's a great disturbance in the force. See https://twitter.com/jsumners79/status/1724164412599050587.

We should update our eslint config to use https://eslint.style/guide/migration. Basically, we need to update:

fastify/package.json

Lines 160 to 165 in b4a4138

"eslint": "^8.51.0",
"eslint-config-standard": "^17.1.0",
"eslint-import-resolver-node": "^0.3.9",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-n": "^16.2.0",
"eslint-plugin-promise": "^6.1.1",

And possibly:

fastify/.eslintrc

Lines 1 to 4 in b4a4138

{
"root": true,
"extends": "standard"
}

And maybe all of:

Now that VSCode is installed, and we can work with it via the command line, we
need to install an extension that will aid in keeping any JavaScript you write
for the project formatted according to the project's style:
```sh
code-fastify --install-extension dbaeumer.vscode-eslint
```
Upon successful execution of the previous command, the following command should
result in "found" being output:
```sh
[ -d /Applications/VSCodeFastify/code-portable-data/extensions/dbaeumer.vscode-eslint-* ] && echo "found"
```
Now, from within the directory of your local clone of the Fastify project, we
can open VSCode:
```sh
code-fastify .
```
A new VSCode window should open and you should see the Fastify project files in
the left sidebar. But wait! We are not quite done yet. There are a few more
baseline settings that should be set before VSCode is ready.
Press `cmd+shift+p` to bring up the VSCode command input prompt. Type `open
settings (json)`. Three [VSCode Setting](https://code.visualstudio.com/docs/getstarted/settings)
options will appear in the dropdown: Workspace, Default,
and User settings. We recommend selecting Default. This will open a document
that is the settings for the editor. Paste the following JSON into this
document, overwriting any text already present, and save it:
```json
{
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.codeActionsOnSave": {
"source.fixAll": true
}
},
"workbench.colorCustomizations": {
"statusBar.background": "#178bb9"
}
}
```

@mcollina
Copy link
Member

I've opened standard/standard#1948 to discuss with the standard team. Overall, I think we should try to minimize the migration work for us.

Maybe @Fdawgs and others could help.

@Uzlopak Uzlopak added the dependencies Pull requests that update a dependency file label Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

No branches or pull requests

3 participants