Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jaredmcateer/eslint-plugin-shouldjs
Eslint rules for the should-js test library
https://github.com/jaredmcateer/eslint-plugin-shouldjs
eslint eslint-plugin javascript shouldjs
Last synced: 11 days ago
JSON representation
Eslint rules for the should-js test library
- Host: GitHub
- URL: https://github.com/jaredmcateer/eslint-plugin-shouldjs
- Owner: jaredmcateer
- License: isc
- Created: 2022-04-04T15:42:46.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-04-12T03:06:01.000Z (almost 3 years ago)
- Last Synced: 2025-01-20T22:59:03.242Z (16 days ago)
- Topics: eslint, eslint-plugin, javascript, shouldjs
- Language: TypeScript
- Homepage:
- Size: 531 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# eslint-plugin-shouldjs
Rules that apply to testing with the [should.js](https://shouldjs.github.io/) library.
## Installation
You'll first need to install [ESLint](https://eslint.org/):
```sh
npm i eslint --save-dev
```Next, install `@jaredmcateer/eslint-plugin-shouldjs`:
```sh
npm install @jaredmcateer/eslint-plugin-shouldjs --save-dev
```## Usage
Add `@jaredmcateer/shouldjs` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:
```json
{
"plugins": ["@jaredmcateer/shouldjs"]
}
```## Configuration
### Settings
By default the only allowed variable name for Should.js is `should`, this can be changed by providing an array to `shouldVarNames` in the eslint settings.
```json
{
"settings": {
"shouldVarNames": ["should", "expect"]
}
}
```### Rules
Add the rules you want to use under the rules section.
```json
{
"rules": {
"@jaredmcateer/shouldjs/should-var-name": "error",
"@jaredmcateer/shouldjs/no-property-assertions": "error"
}
}
```Alternative you can use the recommended settings
```json
{
"extends": ["@jaredmcateer/shouldjs:recommended"]
}
```## Supported Rules
- [should-var-names](lib/rules/should-var-name/should-var-name.md)
- [no-property-assertion](lib/rules/no-property-assertions/no-property-assertion.md)
- [expect-should-assertion](lib/rules/expect-should-assertion/expect-should-assertions.md)## Acknowledgements
Much of the configuration and learnings of building ESLint Plugins was lifted directly from Darragh ORiordan's article on [How to Write an ESLint Plugin in TypeScript](https://www.darraghoriordan.com/2021/11/06/how-to-write-an-eslint-plugin-typescript/) and [repository](https://github.com/darraghoriordan/eslint-plugin-nestjs-typed). Huge thanks.