https://github.com/googlemaps/eslint-plugin-googlemaps
ESLint rules for Google Maps Platform.
https://github.com/googlemaps/eslint-plugin-googlemaps
Last synced: 10 months ago
JSON representation
ESLint rules for Google Maps Platform.
- Host: GitHub
- URL: https://github.com/googlemaps/eslint-plugin-googlemaps
- Owner: googlemaps
- License: apache-2.0
- Created: 2021-12-14T18:14:40.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-04-08T14:03:59.000Z (almost 2 years ago)
- Last Synced: 2024-04-08T17:15:48.752Z (almost 2 years ago)
- Language: TypeScript
- Size: 732 KB
- Stars: 4
- Watchers: 6
- Forks: 5
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
# eslint-plugin-googlemaps
[](https://www.npmjs.com/package/eslint-plugin-googlemaps)



[](https://github.com/semantic-release/semantic-release)
[](https://discord.gg/jRteCzP)
## Description
[ESLint](https://eslint.org) plugin with rules specific to Google Maps Platform JavaScript API.
## Install
Available via npm as the package [eslint-plugin-googlemaps](https://www.npmjs.com/package/eslint-plugin-googlemaps).
```sh
npm i -D eslint-plugin-googlemaps
```
## Usage
To use rules provided by the plugin, use the following:
`eslintrc.json`:
```json
{
"extends": ["plugin:googlemaps:recommended"]
"plugins": ["googlemaps"],
}
```
Some rules are fixable with `eslint --fix`. For example the [place-fields](docs/rules/place-fields.md) rule.
```js
service.getDetails({place_id: 'foo'})
```
becomes
```js
service.getDetails({fields: /** TODO: Add necessary fields to the request */ [], place_id: 'foo'})
```
## Rules
| Rule | Description | Configurations | Type |
| ------------------------------------------------------------ | ---------------------------------- | ---------------- | ------------ |
| [no-api-keys](docs/rules/no-api-keys.md) | Keep API keys out of code. | ![recommended][] | ![suggest][] |
| [place-fields](docs/rules/place-fields.md) | Always use place fields. | ![recommended][] | ![fixable][] |
| [require-js-api-loader](docs/rules/require-js-api-loader.md) | Require @googlemaps/js-api-loader. | ![recommended][] | ![suggest][] |
[recommended]: https://img.shields.io/badge/-recommended-lightgrey.svg
[suggest]: https://img.shields.io/badge/-suggest-yellow.svg
[fixable]: https://img.shields.io/badge/-fixable-green.svg
[style]: https://img.shields.io/badge/-style-blue.svg