eslint-plugin-no-reduce-spread-anti-pattern
v1.0.3
Published
ESLint v9 plugin to disallow bad usage patterns of the spread operator.
Maintainers
Readme
ESLint Plugin: no-reduce-spread-anti-pattern
This is an ESLint v9 plugin that provides a rule to disallow bad patterns while combining reduce + spread. To add it to your project, run
yarn add --dev eslint-plugin-no-reduce-spread-anti-patternGetting Started
- Install dependencies:
yarn install - Build the project:
yarn build - Run tests:
yarn test
Development
This project uses GitHub Actions for continuous integration. The CI workflow:
- Tests the project on Node.js versions 18.x, 20.x, and 22.x
- Runs linting, building, and tests
- Validates package contents before publishing
The workflow runs automatically on:
- Push to the
mainbranch - Pull requests to the
mainbranch
Usage (ESLint 9+ Flat Config)
Add this plugin to your ESLint configuration:
// eslint.config.js
import noReduceSpreadAntiPattern from "eslint-plugin-no-reduce-spread-anti-pattern";
import { defineConfig } from "eslint/config";
export default defineConfig([
{
plugins: {
"no-reduce-spread-anti-pattern": noReduceSpreadAntiPattern,
},
rules: {
"no-reduce-spread-anti-pattern/no-reduce-spread-anti-pattern": "error",
},
},
]);If you want to use a shareable config (if provided by this plugin):
import noSpreadAntiPattern from "eslint-plugin-no-reduce-spread-anti-pattern";
import { defineConfig } from "eslint/config";
export default defineConfig([
noSpreadAntiPattern.configs?.recommended,
]);For more details, see the ESLint flat config documentation.
