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-oxlint
Advanced tools
Turn off all rules already supported by oxlint
. The rules are extracted from here.
See https://oxc.rs/blog/2023-12-12-announcing-oxlint.html
pnpm add eslint-plugin-oxlint --D
This plugin is optimized for flat config usage (eslint >= 9.0). See here for more details.
Example:
// eslint.config.js
import oxlint from 'eslint-plugin-oxlint';
export default [
...// other plugins
oxlint.configs['flat/recommended'], // oxlint should be the last one
];
If you are using legacy configuration (eslint < 9.0), you can use the following config:
// .eslintrc.js
module.exports = {
... // other config
extends: [
... // other presets
"plugin:oxlint/recommended",
],
}
oxlint.json
If you are using flat configuration (eslint >= 9.0), you can use the following config:
// eslint.config.js
import oxlint from 'eslint-plugin-oxlint';
export default [
..., // other plugins
...oxlint.buildFromOxlintConfigFile('./oxlint.json'),
];
Or build it by an oxlint.json
-like object:
// eslint.config.js
import oxlint from 'eslint-plugin-oxlint';
export default [
..., // other plugins
...oxlint.buildFromOxlintConfig({
categories: {
correctness: 'warn'
},
rules: {
eqeqeq: 'warn'
}
}),
];
buildFromOxlintConfigFile
is not supported for legacy configuration (eslint < 9.0).
And then you can add the following script to your package.json
:
{
"scripts": {
"lint": "npx oxlint && npx eslint"
}
}
configs: {
// recmmended only contains the `correctness` category
recommended: { plugins: [Array], rules: [Object] },
'flat/recommended': { rules: [Object] },
// all rules available
all: { plugins: [Array], rules: [Object] },
'flat/all': { rules: [Object] },
// turn eslint rules off by plugin
'flat/eslint': { rules: [Object] },
'flat/import': { rules: [Object] },
'flat/jest': { rules: [Object] },
'flat/jsdoc': { rules: [Object] },
'flat/jsx-a11y': { rules: [Object] },
'flat/nextjs': { rules: [Object] },
'flat/react': { rules: [Object] },
'flat/react-perf': { rules: [Object] },
'flat/tree-shaking': { rules: [Object] },
'flat/typescript': { rules: [Object] },
'flat/unicorn': { rules: [Object] },
// turn eslint rules off by oxlint category
'flat/pedantic': { rules: [Object] },
'flat/style': { rules: [Object] },
'flat/correctness': { rules: [Object] },
'flat/restriction': { rules: [Object] },
'flat/suspicious': { rules: [Object] }
}
You need to install both the oxc and eslint extensions
sparse clone the oxlint repository to have a local copy
pnpm clone
generates the rules from the sparse cloned Rust library, only for the latest version, new rules that haven't been released will not be included.
pnpm generate
FAQs
Turn off all rules already supported by oxlint
The npm package eslint-plugin-oxlint receives a total of 21,577 weekly downloads. As such, eslint-plugin-oxlint popularity was classified as popular.
We found that eslint-plugin-oxlint demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.