Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

eslint-config-gmapitesting

ancameme2ISC1.0.4

reusable eslint config for node tests targeting apis

eslint, eslintconfig

readme

eslint-config-gmapitesting

Set of eslint and prettier settings for my own use.

How to set up:

  1. Install peer dependencies
npx install-peerdeps --dev eslint-config-gmapitesting
  1. Install the package
npm install eslint-config-gmapitesting
  1. In the root of the project create a .eslintrc.json file that contains:
 {
  "extends": [
    "eslint-config-gmapitesting"
  ]
}
  1. Add further rules or override existing behavior in .eslint.json if needed:
{
  "extends": [
    "eslint-config-gmapitesting"
  ],
  "rules": {
    "no-console": "error",
    "prettier/prettier": [
      "error",
      {
        "trailingComma": "es5",
        "singleQuote": true,
        "printWidth": 120,
        "tabWidth": 8,
      }
    ]
  }
}

How to run linting with npm:

Include in package.json:

"scripts": {
  "lint": "eslint .",
  "lint:fix": "eslint . --fix"
},

How to use with vscode:

These settings will turn on format on save and override existing configurations for eslint and prettier extensions.

Install eslint and prettier extensions if not already installed.

Apply settings to individual workspaces and leave defaults untouched.

  1. Open seettings with ctrl+,
  2. Select Workspace and open the settings JSON
  3. Paste the following settings:
// turn on format on save
"editor.formatOnSave": true,
// but turn it off for js files as this will be done by eslint
"[javascript]": {
  "editor.formatOnSave": false
}
// tell the ESLint plugin to run on save
"editor.codeActionsOnSave": {
  "source.fixAll.eslint": true
},
// Turn off prettier extension formatting as settings are already applied to filetype through eslint
"prettier.disableLanguages": ["javascript"]