Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
@metamask/eslint-config
Advanced tools
@metamask/eslint-config
This package provides MetaMask's ESLint configuration as an extensible shared config.
We export four ESLint configurations.
Our default export contains a base set of ESLint rules for ES6+:
yarn add --dev eslint @metamask/eslint-config eslint-plugin-import
List @metamask/eslint-config
to your ESLint config via extends
:
module.exports = {
extends: [
'@metamask/eslint-config',
],
}
An additional config that supports Node.js-specific environments:
module.exports = {
extends: [
'@metamask/eslint-config',
'@metamask/eslint-config/config/nodejs',
],
}
To lint the .eslintrc.js
file itself, you will need to add this config in addition to the base config.
An additional config that adds support for Jest:
yarn add --dev eslint @metamask/eslint-config eslint-plugin-{import,jest}
module.exports = {
root: true,
extends: [
'@metamask/eslint-config',
'@metamask/eslint-config/config/jest',
],
}
An additional config that adds support for Mocha:
yarn add --dev eslint @metamask/eslint-config eslint-plugin-{import,mocha}
module.exports = {
root: true,
extends: [
'@metamask/eslint-config',
'@metamask/eslint-config/config/mocha',
],
}
If your project has prefer-arrow-callback
you will need to disable that and replace it with mocha/prefer-arrow-callback
.
An additional config that adds support for TypeScript:
yarn add --dev \
eslint \
@metamask/eslint-config \
eslint-plugin-import \
@typescript-eslint/eslint-plugin \
@typescript-eslint/parser
module.exports = {
root: true,
extends: [
'@metamask/eslint-config',
'@metamask/eslint-config/config/typescript',
],
// If you have JS files for config, etc. you'll need to set their sourceType
// explicitly as the default sourceType for TS projects is 'module'
overrides: [{
files: [
'.eslintrc.js',
],
parserOptions: {
sourceType: 'script',
},
}],
};
The project follows the same release process as the other libraries in the MetaMask organization:
master
1.x
)yarn version --minor --no-git-tag-version
)FAQs
Shareable MetaMask ESLint config.
The npm package @metamask/eslint-config receives a total of 3,185 weekly downloads. As such, @metamask/eslint-config popularity was classified as popular.
We found that @metamask/eslint-config demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 11 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
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.