Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
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 407,571 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.