eslint-plugin-promise
Advanced tools
Comparing version 6.3.0 to 6.4.0
45
index.js
'use strict' | ||
module.exports = { | ||
const recommendedRules = { | ||
'promise/always-return': 'error', | ||
'promise/no-return-wrap': 'error', | ||
'promise/param-names': 'error', | ||
'promise/catch-or-return': 'error', | ||
'promise/no-native': 'off', | ||
'promise/no-nesting': 'warn', | ||
'promise/no-promise-in-callback': 'warn', | ||
'promise/no-callback-in-promise': 'warn', | ||
'promise/avoid-new': 'off', | ||
'promise/no-new-statics': 'error', | ||
'promise/no-return-in-finally': 'warn', | ||
'promise/valid-params': 'warn', | ||
} | ||
const pluginPromise = { | ||
rules: { | ||
@@ -28,21 +43,13 @@ 'param-names': require('./rules/param-names'), | ||
}, | ||
configs: { | ||
recommended: { | ||
plugins: ['promise'], | ||
rules: { | ||
'promise/always-return': 'error', | ||
'promise/no-return-wrap': 'error', | ||
'promise/param-names': 'error', | ||
'promise/catch-or-return': 'error', | ||
'promise/no-native': 'off', | ||
'promise/no-nesting': 'warn', | ||
'promise/no-promise-in-callback': 'warn', | ||
'promise/no-callback-in-promise': 'warn', | ||
'promise/avoid-new': 'off', | ||
'promise/no-new-statics': 'error', | ||
'promise/no-return-in-finally': 'warn', | ||
'promise/valid-params': 'warn', | ||
}, | ||
}, | ||
} | ||
pluginPromise.configs = { | ||
recommended: { | ||
plugins: ['promise'], | ||
rules: recommendedRules, | ||
}, | ||
'flat/recommended': { | ||
plugins: { promise: pluginPromise }, | ||
rules: recommendedRules, | ||
}, | ||
} | ||
module.exports = pluginPromise |
{ | ||
"name": "eslint-plugin-promise", | ||
"version": "6.3.0", | ||
"version": "6.4.0", | ||
"description": "Enforce best practices for JavaScript promises", | ||
@@ -73,3 +73,3 @@ "keywords": [ | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-doc-generator": "^0.25.0", | ||
"eslint-doc-generator": "^1.7.1", | ||
"eslint-plugin-eslint-plugin": "^4.4.1", | ||
@@ -76,0 +76,0 @@ "eslint-plugin-jest": "^26.9.0", |
@@ -71,8 +71,20 @@ # eslint-plugin-promise | ||
```json | ||
{ | ||
"extends": ["plugin:promise/recommended"] | ||
} | ||
``` | ||
- `eslint.config.js`: | ||
```js | ||
import pluginPromise from 'eslint-plugin-promise' | ||
export default [ | ||
// ... | ||
pluginPromise.configs['flat/recommended'], | ||
] | ||
``` | ||
- `.eslintrc.*`: | ||
```json | ||
{ | ||
"extends": ["plugin:promise/recommended"] | ||
} | ||
``` | ||
## Rules | ||
@@ -85,5 +97,5 @@ | ||
🚫 Configurations disabled in.\ | ||
✅ Set in the `flat/recommended` configuration.\ | ||
✅ Set in the `recommended` configuration.\ | ||
🔧 Automatically fixable by the | ||
[`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix). | ||
🔧 Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix). | ||
@@ -90,0 +102,0 @@ | Name | Description | 💼 | ⚠️ | 🚫 | 🔧 | |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
71093
31
1854
136