Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
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
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.