eslint-plugin-ava
Advanced tools
Comparing version 8.0.0 to 9.0.0
@@ -7,3 +7,3 @@ 'use strict'; | ||
const avaImportDeclarationAst = { | ||
const avaImportDeclarationAsts = [{ | ||
type: 'ImportDeclaration', | ||
@@ -23,5 +23,62 @@ specifiers: [ | ||
} | ||
}; | ||
}, { | ||
type: 'ImportDeclaration', | ||
specifiers: [ | ||
{ | ||
type: 'ImportSpecifier', | ||
imported: { | ||
type: 'Identifier', | ||
name: 'serial' | ||
}, | ||
local: { | ||
type: 'Identifier', | ||
name: 'test' | ||
} | ||
} | ||
], | ||
source: { | ||
type: 'Literal', | ||
value: 'ava' | ||
} | ||
}, { | ||
type: 'ImportDeclaration', | ||
specifiers: [ | ||
{ | ||
type: 'ImportSpecifier', | ||
imported: { | ||
type: 'Identifier', | ||
name: 'serial' | ||
}, | ||
local: { | ||
type: 'Identifier', | ||
name: 'test' | ||
} | ||
} | ||
], | ||
source: { | ||
type: 'Literal', | ||
value: 'ava' | ||
} | ||
}, { | ||
type: 'ImportDeclaration', | ||
specifiers: [ | ||
{ | ||
type: 'ImportSpecifier', | ||
imported: { | ||
type: 'Identifier', | ||
name: 'serial' | ||
}, | ||
local: { | ||
type: 'Identifier', | ||
name: 'serial' | ||
} | ||
} | ||
], | ||
source: { | ||
type: 'Literal', | ||
value: 'ava' | ||
} | ||
}]; | ||
const avaVariableDeclaratorAst = { | ||
const avaVariableDeclaratorAsts = [{ | ||
type: 'VariableDeclarator', | ||
@@ -45,3 +102,69 @@ id: { | ||
} | ||
}; | ||
}, { | ||
type: 'VariableDeclarator', | ||
id: { | ||
type: 'ObjectPattern', | ||
properties: [{ | ||
type: 'Property', | ||
key: { | ||
type: 'Identifier', | ||
name: 'serial' | ||
}, | ||
value: { | ||
type: 'Identifier', | ||
name: 'serial' | ||
}, | ||
kind: 'init', | ||
method: false, | ||
shorthand: true, | ||
computed: false | ||
}] | ||
}, | ||
init: { | ||
type: 'CallExpression', | ||
callee: { | ||
type: 'Identifier', | ||
name: 'require' | ||
}, | ||
arguments: [ | ||
{ | ||
type: 'Literal', | ||
value: 'ava' | ||
} | ||
] | ||
} | ||
}, { | ||
type: 'VariableDeclarator', | ||
id: { | ||
type: 'ObjectPattern', | ||
properties: [{ | ||
type: 'Property', | ||
key: { | ||
type: 'Identifier', | ||
name: 'serial' | ||
}, | ||
value: { | ||
type: 'Identifier', | ||
name: 'test' | ||
}, | ||
kind: 'init', | ||
method: false, | ||
shorthand: false, | ||
computed: false | ||
}] | ||
}, | ||
init: { | ||
type: 'CallExpression', | ||
callee: { | ||
type: 'Identifier', | ||
name: 'require' | ||
}, | ||
arguments: [ | ||
{ | ||
type: 'Literal', | ||
value: 'ava' | ||
} | ||
] | ||
} | ||
}]; | ||
@@ -71,3 +194,3 @@ function isTestFunctionCall(node) { | ||
ImportDeclaration: node => { | ||
if (!isTestFile && deepStrictEqual(espurify(node), avaImportDeclarationAst)) { | ||
if (!isTestFile && avaImportDeclarationAsts.some(ast => deepStrictEqual(espurify(node), ast))) { | ||
isTestFile = true; | ||
@@ -77,3 +200,3 @@ } | ||
VariableDeclarator: node => { | ||
if (!isTestFile && deepStrictEqual(espurify(node), avaVariableDeclaratorAst)) { | ||
if (!isTestFile && avaVariableDeclaratorAsts.some(ast => deepStrictEqual(espurify(node), ast))) { | ||
isTestFile = true; | ||
@@ -80,0 +203,0 @@ } |
@@ -13,3 +13,3 @@ 'use strict'; | ||
parserOptions: { | ||
ecmaVersion: 2019, | ||
ecmaVersion: 2020, | ||
sourceType: 'module' | ||
@@ -16,0 +16,0 @@ }, |
{ | ||
"name": "eslint-plugin-ava", | ||
"version": "8.0.0", | ||
"version": "9.0.0", | ||
"description": "ESLint rules for AVA", | ||
@@ -47,3 +47,3 @@ "license": "MIT", | ||
"del": "^5.0.0", | ||
"eslint": "^6.0.0", | ||
"eslint": "^6.2.0", | ||
"eslint-ava-rule-tester": "^3.0.0", | ||
@@ -61,3 +61,3 @@ "eslint-plugin-eslint-plugin": "2.1.0", | ||
"peerDependencies": { | ||
"eslint": ">=6" | ||
"eslint": ">=6.2.0" | ||
}, | ||
@@ -64,0 +64,0 @@ "ava": { |
@@ -31,3 +31,3 @@ # eslint-plugin-ava [![Build Status](https://travis-ci.org/avajs/eslint-plugin-ava.svg?branch=master)](https://travis-ci.org/avajs/eslint-plugin-ava) [![Coverage Status](https://coveralls.io/repos/github/avajs/eslint-plugin-ava/badge.svg?branch=master)](https://coveralls.io/github/avajs/eslint-plugin-ava?branch=master) | ||
"parserOptions": { | ||
"ecmaVersion": 2019, | ||
"ecmaVersion": 2020, | ||
"sourceType": "module" | ||
@@ -132,6 +132,1 @@ }, | ||
**Note**: This config will also enable the correct [parser options](http://eslint.org/docs/user-guide/configuring#specifying-parser-options) and [environment](http://eslint.org/docs/user-guide/configuring#specifying-environments). | ||
## License | ||
MIT |
@@ -10,3 +10,3 @@ 'use strict'; | ||
if (filename === '<text>') { | ||
if (filename === '<input>' || filename === '<text>') { | ||
return {}; | ||
@@ -13,0 +13,0 @@ } |
@@ -12,3 +12,3 @@ 'use strict'; | ||
if (filename === '<text>') { | ||
if (filename === '<input>' || filename === '<text>') { | ||
return {}; | ||
@@ -15,0 +15,0 @@ } |
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
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
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
66522
149791
37
2188
131
1