Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/causalhq/eslint-plugin-no-argument-spread
https://github.com/causalhq/eslint-plugin-no-argument-spread
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/causalhq/eslint-plugin-no-argument-spread
- Owner: causalhq
- Created: 2021-09-07T11:46:10.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-06-16T16:18:03.000Z (over 2 years ago)
- Last Synced: 2024-04-28T17:34:06.755Z (6 months ago)
- Language: JavaScript
- Size: 27.3 KB
- Stars: 3
- Watchers: 9
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-eslint - no-argument-spread - Lints against expressions like `Math.max(...args)` that can lead to a stack overflow for large arrays. (Plugins / Practices and Specific ES Features)
README
# eslint-plugin-no-argument-spread
Show warning when someone uses the spread operator for function arguments. Using expressions like `Math.max(...array)` can lead to a stack overflow for large arrays.
## Installation
You'll first need to install [ESLint](https://eslint.org/):
```sh
npm i eslint --save-dev
```Next, install `eslint-plugin-no-argument-spread`:
```sh
npm install eslint-plugin-no-argument-spread --save-dev
```## Usage
Add `no-argument-spread` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:
```json
{
"plugins": [
"no-argument-spread"
]
}
```Then configure the rules you want to use under the rules section.
```json
{
"rules": {
"no-argument-spread/no-argument-spread": "warn"
}
}
```## Development
https://astexplorer.net/ is helpful for creating rules. Run `yo eslint:rule` to create a new rule. Run `npm test` to run tests.