Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
eslint-config-google
Advanced tools
The eslint-config-google package provides a shareable ESLint configuration that follows the Google JavaScript style guide. It helps developers enforce consistent coding styles and best practices as defined by Google.
Enforcing Google JavaScript Style Guide
By extending the 'google' configuration, ESLint will enforce the coding standards and best practices defined in the Google JavaScript style guide. This includes rules for indentation, quotes, semicolons, and more.
{
"extends": "google"
}
Customizable Rules
You can customize the rules provided by the Google configuration to better fit your project's needs. For example, you can change the quote style to single quotes and set the indentation to 2 spaces.
{
"extends": "google",
"rules": {
"quotes": ["error", "single"],
"indent": ["error", 2]
}
}
The eslint-config-airbnb package provides a shareable ESLint configuration based on the Airbnb JavaScript style guide. It is one of the most popular ESLint configurations and includes rules for React as well. Compared to eslint-config-google, it has a broader set of rules and is widely adopted in the JavaScript community.
The eslint-config-standard package provides a shareable ESLint configuration based on JavaScript Standard Style. It focuses on simplicity and minimalism, enforcing a set of rules that aim to reduce cognitive overhead. Unlike eslint-config-google, it does not follow a specific company's style guide but rather a community-driven standard.
The eslint-config-prettier package turns off all ESLint rules that are unnecessary or might conflict with Prettier. It is often used in conjunction with other ESLint configurations to ensure that code formatting is handled by Prettier while ESLint focuses on code quality. This package complements eslint-config-google by allowing developers to use Prettier for formatting while still adhering to Google's style guide.
ESLint shareable config for the Google JavaScript style guide (ES2015+ version)
$ npm install --save-dev eslint eslint-config-google
Once the eslint-config-google
package is installed, you can use it by specifying google
in the extends
section of your ESLint configuration.
{
"extends": "google",
"rules": {
// Additional, per-project rules...
}
}
google
config with eslint:recommended
There are several rules in the eslint:recommended
ruleset that Google style is not opinionated about that you might want to enforce in your project.
To use Google style in conjunction with ESLint's recommended rule set, extend them both, making sure to list google
last:
{
"extends": ["eslint:recommended", "google"],
"rules": {
// Additional, per-project rules...
}
}
To see how the google
config compares with eslint:recommended
, refer to the source code of index.js
, which lists every ESLint rule along with whether (and how) it is enforced by the google
config.
Apache-2 © Google
FAQs
ESLint shareable config for the Google style
The npm package eslint-config-google receives a total of 192,926 weekly downloads. As such, eslint-config-google popularity was classified as popular.
We found that eslint-config-google demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.