Skip to content

Commit

Permalink
Updated dev dependencies & added new tests from the upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
ihordiachenko committed Jan 8, 2024
1 parent a44d03c commit bba4702
Show file tree
Hide file tree
Showing 6 changed files with 2,321 additions and 1,681 deletions.
13 changes: 8 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
'use strict';

module.exports = {
parser: "@babel/eslint-parser",
parserOptions: {
requireConfigFile: false,
babelOptions: {
babelrc: false,
configFile: false,
},
},
extends: ['eslint:recommended'],
env: {
node: true
},
parserOptions: {
ecmaVersion: 2020
},
rules: {
strict: ['error'],
indent: ['error', 4]
Expand Down
1 change: 0 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* @fileoverview This plugin makes `no-unused-expressions` rule friendly towards chai expect statements.
* @author Ihor Diachenko
*/
"use strict";

module.exports = {
configs: {
Expand Down
7 changes: 6 additions & 1 deletion lib/rules/no-unused-expressions.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* @author Michael Ficarra
* @author Ihor Diachenko
*/
"use strict";

//------------------------------------------------------------------------------
// Rule Definition
Expand Down Expand Up @@ -109,6 +108,12 @@ module.exports = {
var parent = ancestors[ancestors.length - 1],
grandparent = ancestors[ancestors.length - 2];

/**
* 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" &&
(/Function/.test(grandparent.type))) &&
directives(parent).indexOf(node) >= 0;
Expand Down
Loading

0 comments on commit bba4702

Please sign in to comment.