eslint-plugin-chai-friendly
Advanced tools
Comparing version 0.7.2 to 0.7.3
@@ -1,4 +0,10 @@ | ||
'use strict'; | ||
module.exports = { | ||
parser: "@babel/eslint-parser", | ||
parserOptions: { | ||
requireConfigFile: false, | ||
babelOptions: { | ||
babelrc: false, | ||
configFile: false, | ||
}, | ||
}, | ||
extends: ['eslint:recommended'], | ||
@@ -8,5 +14,2 @@ env: { | ||
}, | ||
parserOptions: { | ||
ecmaVersion: 2020 | ||
}, | ||
rules: { | ||
@@ -13,0 +16,0 @@ strict: ['error'], |
@@ -1,1 +0,1 @@ | ||
{"processes":{"a9bacb87-6c71-4985-a8ed-1837b4c2d3e4":{"parent":null,"children":[]}},"files":{"/Users/user/repos/eslint-plugin-chai-friendly/lib/rules/no-unused-expressions.js":["a9bacb87-6c71-4985-a8ed-1837b4c2d3e4"]},"externalIds":{}} | ||
{"processes":{"676c2c95-b21a-4c9b-8561-ccdf602fa0c1":{"parent":null,"children":[]}},"files":{"/Users/user/repos/eslint-plugin-chai-friendly/lib/rules/no-unused-expressions.js":["676c2c95-b21a-4c9b-8561-ccdf602fa0c1"]},"externalIds":{}} |
@@ -5,3 +5,2 @@ /** | ||
*/ | ||
"use strict"; | ||
@@ -8,0 +7,0 @@ module.exports = { |
@@ -6,3 +6,2 @@ /** | ||
*/ | ||
"use strict"; | ||
@@ -113,2 +112,8 @@ //------------------------------------------------------------------------------ | ||
/** | ||
* https://tc39.es/ecma262/#directive-prologue | ||
* | ||
* Only `FunctionBody`, `ScriptBody` and `ModuleBody` can have directive prologue. | ||
* Class static blocks do not have directive prologue. | ||
*/ | ||
return (parent.type === "Program" || parent.type === "BlockStatement" && | ||
@@ -115,0 +120,0 @@ (/Function/.test(grandparent.type))) && |
{ | ||
"name": "eslint-plugin-chai-friendly", | ||
"version": "0.7.2", | ||
"version": "0.7.3", | ||
"description": "This plugin makes 'no-unused-expressions' rule friendly towards chai expect statements.", | ||
@@ -29,3 +29,2 @@ "keywords": [ | ||
}, | ||
"dependencies": {}, | ||
"peerDependencies": { | ||
@@ -35,11 +34,12 @@ "eslint": ">=3.0.0" | ||
"devDependencies": { | ||
"babel-eslint": "^10.1.0", | ||
"eslint": "^7.26.0", | ||
"mocha": "^7.1.2", | ||
"nyc": "^15.0.1" | ||
"@babel/core": "^7.23.7", | ||
"@babel/eslint-parser": "^7.23.3", | ||
"eslint": "^8.56.0", | ||
"mocha": "^10.0.0", | ||
"nyc": "^15.1.0" | ||
}, | ||
"engines": { | ||
"node": ">=0.10.0" | ||
"node": ">=18.18.0" | ||
}, | ||
"license": "MIT" | ||
} |
@@ -6,3 +6,2 @@ /** | ||
"use strict"; | ||
@@ -212,2 +211,24 @@ //------------------------------------------------------------------------------ | ||
}, | ||
// class static blocks do not have directive prologues | ||
{ | ||
code: "class C { static { 'use strict'; } }", | ||
parserOptions: { ecmaVersion: 2022 }, | ||
errors: [{ messageId: "unusedExpression", type: "ExpressionStatement" }] | ||
}, | ||
{ | ||
code: "class C { static { \n'foo'\n'bar'\n } }", | ||
parserOptions: { ecmaVersion: 2022 }, | ||
errors: [ | ||
{ | ||
messageId: "unusedExpression", | ||
type: "ExpressionStatement", | ||
line: 2 | ||
}, | ||
{ | ||
messageId: "unusedExpression", | ||
type: "ExpressionStatement", | ||
line: 3 | ||
} | ||
] | ||
}, | ||
@@ -214,0 +235,0 @@ // Chai statements |
44816
518
5