@so1ve/eslint-plugin 0.81.2 → 0.82.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +4 -1
- package/dist/index.mjs +4 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -387,8 +387,11 @@ const padAfterLastImport = createEslintRule({
|
|
|
387
387
|
"Program:exit"() {
|
|
388
388
|
if (lastImportNode) {
|
|
389
389
|
const nextToken = sourceCode.getTokenAfter(lastImportNode);
|
|
390
|
+
const firstCommentAfterTokenStartLine = sourceCode.getCommentsAfter(lastImportNode)[0]?.loc.start.line;
|
|
391
|
+
const expectedLine = lastImportNode.loc.end.line + 1;
|
|
392
|
+
const nextTokenStartLine = nextToken?.loc.start.line;
|
|
390
393
|
if (nextToken && // Workaround: Vue
|
|
391
|
-
nextToken.value !== "<\/script>" && (
|
|
394
|
+
nextToken.value !== "<\/script>" && (expectedLine === nextTokenStartLine || expectedLine === firstCommentAfterTokenStartLine)) {
|
|
392
395
|
context.report({
|
|
393
396
|
node: lastImportNode,
|
|
394
397
|
messageId: "padAfterLastImport",
|
package/dist/index.mjs
CHANGED
|
@@ -385,8 +385,11 @@ const padAfterLastImport = createEslintRule({
|
|
|
385
385
|
"Program:exit"() {
|
|
386
386
|
if (lastImportNode) {
|
|
387
387
|
const nextToken = sourceCode.getTokenAfter(lastImportNode);
|
|
388
|
+
const firstCommentAfterTokenStartLine = sourceCode.getCommentsAfter(lastImportNode)[0]?.loc.start.line;
|
|
389
|
+
const expectedLine = lastImportNode.loc.end.line + 1;
|
|
390
|
+
const nextTokenStartLine = nextToken?.loc.start.line;
|
|
388
391
|
if (nextToken && // Workaround: Vue
|
|
389
|
-
nextToken.value !== "<\/script>" && (
|
|
392
|
+
nextToken.value !== "<\/script>" && (expectedLine === nextTokenStartLine || expectedLine === firstCommentAfterTokenStartLine)) {
|
|
390
393
|
context.report({
|
|
391
394
|
node: lastImportNode,
|
|
392
395
|
messageId: "padAfterLastImport",
|