@so1ve/eslint-plugin 0.69.0 → 0.69.1

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 CHANGED
@@ -27,7 +27,7 @@ const importDedupe = createEslintRule({
27
27
  return;
28
28
  }
29
29
  const names = /* @__PURE__ */ new Set();
30
- node.specifiers.forEach((n) => {
30
+ for (const n of node.specifiers) {
31
31
  const id = n.local.name;
32
32
  if (names.has(id)) {
33
33
  context.report({
@@ -48,7 +48,7 @@ const importDedupe = createEslintRule({
48
48
  });
49
49
  }
50
50
  names.add(id);
51
- });
51
+ }
52
52
  }
53
53
  };
54
54
  }
@@ -77,7 +77,7 @@ const noInlineTypeImport = createEslintRule({
77
77
  const specifiers = node.specifiers;
78
78
  const typeSpecifiers = specifiers.filter((s) => s.type === "ImportSpecifier" && s.importKind === "type");
79
79
  const valueSpecifiers = specifiers.filter((s) => s.type === "ImportSpecifier" && s.importKind === "value");
80
- if (typeSpecifiers.length && valueSpecifiers.length) {
80
+ if (typeSpecifiers.length > 0 && valueSpecifiers.length > 0) {
81
81
  context.report({
82
82
  loc: node.loc,
83
83
  messageId: "noInlineTypeImport",
@@ -91,7 +91,7 @@ import { ${valueSpecifiersText} } from "${node.source.value}";`
91
91
  );
92
92
  }
93
93
  });
94
- } else if (typeSpecifiers.length) {
94
+ } else if (typeSpecifiers.length > 0) {
95
95
  context.report({
96
96
  loc: node.loc,
97
97
  messageId: "noInlineTypeImport",
@@ -168,7 +168,7 @@ const padAfterLastImport = createEslintRule({
168
168
  "Program:exit"() {
169
169
  if (lastImportNode) {
170
170
  const nextToken = sourceCode.getTokenAfter(lastImportNode);
171
- if (nextToken && lastImportNode.loc.end.line + 1 === nextToken.loc.start.line) {
171
+ if (nextToken && nextToken.value !== "<\/script>" && lastImportNode.loc.end.line + 1 === nextToken.loc.start.line) {
172
172
  context.report({
173
173
  node: lastImportNode,
174
174
  messageId: "padAfterLastImport",
package/dist/index.mjs CHANGED
@@ -25,7 +25,7 @@ const importDedupe = createEslintRule({
25
25
  return;
26
26
  }
27
27
  const names = /* @__PURE__ */ new Set();
28
- node.specifiers.forEach((n) => {
28
+ for (const n of node.specifiers) {
29
29
  const id = n.local.name;
30
30
  if (names.has(id)) {
31
31
  context.report({
@@ -46,7 +46,7 @@ const importDedupe = createEslintRule({
46
46
  });
47
47
  }
48
48
  names.add(id);
49
- });
49
+ }
50
50
  }
51
51
  };
52
52
  }
@@ -75,7 +75,7 @@ const noInlineTypeImport = createEslintRule({
75
75
  const specifiers = node.specifiers;
76
76
  const typeSpecifiers = specifiers.filter((s) => s.type === "ImportSpecifier" && s.importKind === "type");
77
77
  const valueSpecifiers = specifiers.filter((s) => s.type === "ImportSpecifier" && s.importKind === "value");
78
- if (typeSpecifiers.length && valueSpecifiers.length) {
78
+ if (typeSpecifiers.length > 0 && valueSpecifiers.length > 0) {
79
79
  context.report({
80
80
  loc: node.loc,
81
81
  messageId: "noInlineTypeImport",
@@ -89,7 +89,7 @@ import { ${valueSpecifiersText} } from "${node.source.value}";`
89
89
  );
90
90
  }
91
91
  });
92
- } else if (typeSpecifiers.length) {
92
+ } else if (typeSpecifiers.length > 0) {
93
93
  context.report({
94
94
  loc: node.loc,
95
95
  messageId: "noInlineTypeImport",
@@ -166,7 +166,7 @@ const padAfterLastImport = createEslintRule({
166
166
  "Program:exit"() {
167
167
  if (lastImportNode) {
168
168
  const nextToken = sourceCode.getTokenAfter(lastImportNode);
169
- if (nextToken && lastImportNode.loc.end.line + 1 === nextToken.loc.start.line) {
169
+ if (nextToken && nextToken.value !== "<\/script>" && lastImportNode.loc.end.line + 1 === nextToken.loc.start.line) {
170
170
  context.report({
171
171
  node: lastImportNode,
172
172
  messageId: "padAfterLastImport",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@so1ve/eslint-plugin",
3
- "version": "0.69.0",
3
+ "version": "0.69.1",
4
4
  "author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
5
5
  "contributors": [
6
6
  {