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-plugin-eggache
Advanced tools
custom eslint rule for egg RTFM questions
npm i eslint-plugin-eggache --save
Add eggache
to the plugins section of your .eslintrc
configuration file.
// ${app_root}/.eslintrc
{
"extends": [
"plugin:eggache/recommended"
]
}
By default it enable all the recommended rules, if you want to custom, just configure the rules section.
// ${app_root}/.eslintrc
{
"extends": [
"plugin:eggache/recommended"
],
"rules": {
'eggache/no-override-exports': [ 'error' ],
'eggache/no-unexpected-plugin-keys': 'error',
}
}
A common mistake that newbie will make - override module.exports
and exports
.
/* eslint eggache/no-override-exports: [ 'error' ] */
// config/config.default.js
exports.view = {};
module.exports = appInfo => {
const config = exports = {};
config.keys = '123456';
return config;
}
Options:
The first options is a boolean, default to false, means only check:
config/config.*.js
config/plugin.*.js
set it to true
means to check all files.
/* eslint eggache/no-override-exports: [ 'error', true ] */
// due to options `true`, this will pass the lint
// ${app_root}/app.js
module.exports = exports = {};
exports.keys = '123456';
Sometimes, developer will confuse plugin.js
and config.default.js
.
plugin.js
only allow [ 'enable', 'package', 'path', 'env' ]
and it control whether to load a plugin.
The plugin's config
should write to config/config.{env}.js
.
/* eslint eggache/no-unexpected-plugin-keys: [ 'error' ] */
// config/plugin.js
module.exports = {
test: {
enable: true,
package: 'egg-test',
someConfig: 'should not place here',
},
}
A common mistake that developer will make - forget to remove .only
in tests before committing.
/* eslint eggache/no-only-tests: [ 'error' ] */
describe.only('desc something', function() {
it.only('assert somnething', function() {
// do nothing
});
})
FAQs
custom eslint rule for egg RTFM issues
We found that eslint-plugin-eggache demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.