@gocomo/eslint-config-gocomo
v2.0.0-rc.0
Published
Gocomo ESLint and Prettier Config
Downloads
107
Readme
Gocomo Eslint and Prettier Setup
Common Gocomo eslint settings. Inspired by eslint-config-wesbos
What it does
- Lints JavaScript based on the latest standards incl. Sonar-Rules
- Fixes issues and formatting errors with Prettier
- You can see all the rules here.
Installing
If you don't already have a
package.json
file, create one withnpm init
.Then we need to install everything needed by the config:
npx install-peerdeps --dev @gocomo/eslint-config-gocomo
You can see in your package.json there are now a big list of devDependencies.
Create a
.eslintrc
file in the root of your project's directory (it should live where package.json does). Your.eslintrc
file should look like this:
{
"extends": ["gocomo"]
}
With VS Code
Once you have done the above install, you probably want your editor to lint and fix for you. Here are the instructions for VS Code:
- Install the ESLint package
- Install the Prettier package
- Now we need to setup some VS Code settings via
Code/File
→Preferences
→Settings
. It's easier to enter these settings while editing thesettings.json
file, so click the{}
icon in the top right corner:
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"eslint.validate": [ "javascript", "javascriptreact", "typescript" ]