eslint-plugin-chai-friendly 1.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -0
- package/lib/index.js +3 -1
- package/package.json +11 -6
package/README.md
CHANGED
|
@@ -101,3 +101,39 @@ More info in the original rule's [docs](http://eslint.org/docs/rules/no-unused-e
|
|
|
101
101
|
## Supported Rules
|
|
102
102
|
|
|
103
103
|
- `chai-friendly/no-unused-expressions`
|
|
104
|
+
|
|
105
|
+
## TypeScript Compatibility
|
|
106
|
+
|
|
107
|
+
If you're using TypeScript with `@typescript-eslint`, you need to disable both the original ESLint rule and the TypeScript ESLint version:
|
|
108
|
+
|
|
109
|
+
ESLint 9 flat config format:
|
|
110
|
+
|
|
111
|
+
```js
|
|
112
|
+
import pluginChaiFriendly from 'eslint-plugin-chai-friendly';
|
|
113
|
+
|
|
114
|
+
export default {
|
|
115
|
+
plugins: {'chai-friendly': pluginChaiFriendly},
|
|
116
|
+
rules: {
|
|
117
|
+
"no-unused-expressions": "off", // disable original rule
|
|
118
|
+
"@typescript-eslint/no-unused-expressions": "off", // disable TypeScript ESLint version
|
|
119
|
+
"chai-friendly/no-unused-expressions": "error"
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Legacy `.eslintrc` format:
|
|
125
|
+
|
|
126
|
+
```json
|
|
127
|
+
{
|
|
128
|
+
"plugins": [
|
|
129
|
+
"chai-friendly"
|
|
130
|
+
],
|
|
131
|
+
"rules": {
|
|
132
|
+
"no-unused-expressions": 0, // disable original rule
|
|
133
|
+
"@typescript-eslint/no-unused-expressions": 0, // disable TypeScript ESLint version
|
|
134
|
+
"chai-friendly/no-unused-expressions": 2
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Note that if you use the recommended configuration, both rules will be disabled automatically.
|
package/lib/index.js
CHANGED
|
@@ -27,7 +27,8 @@ Object.assign(plugin.configs, {
|
|
|
27
27
|
},
|
|
28
28
|
rules: {
|
|
29
29
|
'chai-friendly/no-unused-expressions': 'error',
|
|
30
|
-
'no-unused-expressions': 'off'
|
|
30
|
+
'no-unused-expressions': 'off',
|
|
31
|
+
'@typescript-eslint/no-unused-expressions': 'off' // disable TypeScript ESLint version
|
|
31
32
|
}
|
|
32
33
|
},
|
|
33
34
|
|
|
@@ -38,6 +39,7 @@ Object.assign(plugin.configs, {
|
|
|
38
39
|
],
|
|
39
40
|
rules: {
|
|
40
41
|
'no-unused-expressions': 0, // disable original rule
|
|
42
|
+
'@typescript-eslint/no-unused-expressions': 0, // disable TypeScript ESLint version
|
|
41
43
|
'chai-friendly/no-unused-expressions': 2
|
|
42
44
|
}
|
|
43
45
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-chai-friendly",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "This plugin makes 'no-unused-expressions' rule friendly towards chai expect statements.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -27,19 +27,24 @@
|
|
|
27
27
|
],
|
|
28
28
|
"scripts": {
|
|
29
29
|
"lint": "eslint .",
|
|
30
|
-
"test": "nyc mocha tests --recursive",
|
|
31
|
-
"integration-test": "npx eslint examples/test.js --no-ignore"
|
|
30
|
+
"test": "nyc mocha tests --recursive && npm run integration-test:all",
|
|
31
|
+
"integration-test": "npx eslint examples/test.js --no-ignore",
|
|
32
|
+
"integration-test:ts": "npx eslint --config examples/eslint.config.js examples/test-ts-specific.ts --no-ignore",
|
|
33
|
+
"integration-test:all": "npx eslint --config examples/eslint.config.js examples/test.js examples/test-ts-specific.ts --no-ignore"
|
|
32
34
|
},
|
|
33
35
|
"peerDependencies": {
|
|
34
36
|
"eslint": ">=3.0.0"
|
|
35
37
|
},
|
|
36
38
|
"devDependencies": {
|
|
37
|
-
"@babel/core": "^7.
|
|
38
|
-
"@babel/eslint-parser": "^7.
|
|
39
|
+
"@babel/core": "^7.25.2",
|
|
40
|
+
"@babel/eslint-parser": "^7.25.1",
|
|
41
|
+
"@typescript-eslint/eslint-plugin": "^8.34.0",
|
|
42
|
+
"@typescript-eslint/parser": "^8.34.0",
|
|
39
43
|
"chai": "^5.1.1",
|
|
40
44
|
"eslint": "^9.3.0",
|
|
41
45
|
"mocha": "^10.0.0",
|
|
42
|
-
"nyc": "^15.1.0"
|
|
46
|
+
"nyc": "^15.1.0",
|
|
47
|
+
"typescript": "^5.8.3"
|
|
43
48
|
},
|
|
44
49
|
"engines": {
|
|
45
50
|
"node": ">=0.10.0"
|