Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
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,471 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.