@scandipwa/eslint-plugin-scandipwa-guidelines
Advanced tools
Comparing version 2.0.6 to 2.0.7
@@ -0,1 +1,3 @@ | ||
const getLeadingCommentsForNode = require('../util/get-leading-comments'); | ||
/** | ||
@@ -12,3 +14,3 @@ * @fileoverview All components should be extensible. | ||
const leadingComments = context.getSourceCode().getCommentsBefore(nodeToProcess); | ||
const leadingComments = getLeadingCommentsForNode(nodeToProcess, context.getSourceCode()); | ||
@@ -15,0 +17,0 @@ const namespaceComment = leadingComments.find( |
@@ -9,2 +9,3 @@ /** | ||
const fixNamespaceLack = require('../util/fix-namespace-lack.js'); | ||
const getLeadingCommentsForNode = require('../util/get-leading-comments'); | ||
@@ -86,5 +87,5 @@ const types = { | ||
); | ||
return getNamespaceFromComments( | ||
sourceCode.getCommentsBefore(getProperParentNode(node)) | ||
getLeadingCommentsForNode(getProperParentNode(node), sourceCode) | ||
); | ||
@@ -91,0 +92,0 @@ }; |
@@ -0,1 +1,3 @@ | ||
const getLeadingCommentsForNode = require('./get-leading-comments'); | ||
/** | ||
@@ -9,4 +11,4 @@ * Insert namespace decorator comment before the appropriate node | ||
module.exports = (fixer, node, context, namespace) => { | ||
const sourceCode = context.getSourceCode(); | ||
const leadingComments = sourceCode.getLeadingComments(node); | ||
const sourceCode = context.getSourceCode(); | ||
const leadingComments = getLeadingCommentsForNode(node, sourceCode); | ||
@@ -18,7 +20,5 @@ if (leadingComments.find(comment => comment.value.includes('@namespace'))) { | ||
const blockComment = leadingComments.reverse().find( | ||
comment => comment.type === 'Block' && !['eslint-disable-next-line', '@license'].some(cond => comment.value.includes(cond)) | ||
comment => comment.type === 'Block' && !['eslint-disable-next-line', '@license'].some(cond => comment.value.includes(cond)) | ||
); | ||
const lineComment = leadingComments.reverse().find( | ||
({ type }) => type === 'Line' | ||
); | ||
const eslintComment = leadingComments.find( | ||
@@ -34,2 +34,3 @@ comment => comment.value.includes('eslint-disable-next-line') | ||
} | ||
if (eslintComment) { | ||
@@ -36,0 +37,0 @@ return fixer.insertTextBefore(eslintComment, `/** @namespace ${namespace} */\n`); |
{ | ||
"name": "@scandipwa/eslint-plugin-scandipwa-guidelines", | ||
"description": "ESLint plugin used by CSA.", | ||
"version": "2.0.6", | ||
"version": "2.0.7", | ||
"keywords": [ | ||
@@ -29,3 +29,3 @@ "eslint", | ||
}, | ||
"gitHead": "a77d8ed2ecaf0b0938bce863177e37a596546a2e" | ||
"gitHead": "8405342bb1f56fc23bbd63d06a02f635c57884c4" | ||
} |
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
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
59719
36
1279