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-vtex
Advanced tools
eslint-config-vtex
This package provides VTEX's .eslintrc
as an extensible shared config.
Give that you already have ESLint installed, run:
yarn add -D eslint-config-vtex typescript prettier
After installing the module, just add it to your extends
array inside your .eslintrc
.
// .eslintrc
{
"extends": ["vtex"]
}
As any other eslint preset, it's possible to override some rules and configurations. We encourage trying to keep the closest possible to the preset rules, but every project is different and sometimes overriding is needed, use it carefully.
The preset will automatically load Typescript rules when dealing with .ts
or .tsx
files. However, there are some rules that require type-checking. This means that a tsconfig.json
, which includes all files supposed to be linted, must be present. If your existing configuration does not include all of the files you would like to lint, you can create a separate tsconfig.eslint.json
, at the root of your project, as follows:
// tsconfig.eslint.json
{
"extends": "./tsconfig.json",
"include": ["**/*.ts", "**/*.tsx", "**/*.js"],
"exclude": []
}
And you should be good to go.
Sometimes you want to use modern, not yet officially supported, syntax in your Javascript files, such as dynamic import()
. This can be achieved by using the babel-eslint
parser. For size reasons, we don't include it in this preset but it's extremely simple to configure it:
yarn add -D babel-eslint
// .eslintrc
{
"extends": "vtex",
"parser": "babel-eslint",
"parserOptions": {
"sourceType": "module"
}
}
If a project uses both Typescript and Javascript, you can configure the parser inside an override
block:
// .eslintrc
{
"extends": "vtex",
"overrides": [
{
"files": ["*.js", "*.jsx"],
"parser": "babel-eslint",
"parserOptions": {
"sourceType": "module"
}
}
]
}
Please check the babel-eslint
documentation for further options.
FAQs
VTEX's eslint config
The npm package eslint-config-vtex receives a total of 6,894 weekly downloads. As such, eslint-config-vtex popularity was classified as popular.
We found that eslint-config-vtex demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 57 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.