Skip to content

Commit

Permalink
Merge a233e1a into 5e143b2
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyOGo authored Sep 18, 2019
2 parents 5e143b2 + a233e1a commit b529746
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/rules/no-cycle.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,18 @@ module.exports = {
docs: { url: docsUrl('no-cycle') },
schema: [makeOptionsSchema({
maxDepth:{
description: 'maximum dependency depth to traverse',
type: 'integer',
minimum: 1,
oneOf: [
{
description: 'maximum dependency depth to traverse',
type: 'integer',
minimum: 1,
},
{
description: 'Infinity can\'t be used within JSON',
type: 'string',
enum: ['Infinity'],
}
]
},
})],
},
Expand All @@ -26,7 +35,7 @@ module.exports = {
if (myPath === '<text>') return {} // can't cycle-check a non-file

const options = context.options[0] || {}
const maxDepth = options.maxDepth || Infinity
const maxDepth = +options.maxDepth || Infinity

function checkSourceValue(sourceNode, importer) {
const imported = Exports.get(sourceNode.value, context)
Expand Down

0 comments on commit b529746

Please sign in to comment.