isml-linter 5.43.3 → 5.43.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## [5.43.5] - 2023-02-21
4
+
5
+ ### Fixed
6
+ - "indent" Rule - keep indentation of closing tag that is in same line as corresponding opening tag;
7
+ - Tree build for an empty template;
8
+
9
+ ## [5.43.4] - 2023-02-20
10
+
11
+ ### Fixed
12
+ - [Issue #39][issue#39] - Allow closing tag to be in the same line as corresponding opening tag last character;
13
+
3
14
  ## [5.43.3] - 2023-02-20
4
15
 
5
16
  ### Fixed
@@ -1103,6 +1114,8 @@
1103
1114
  ### Added
1104
1115
  - Linter is published;
1105
1116
 
1117
+ [5.43.5]: https://github.com/FabiowQuixada/isml-linter/compare/v5.43.4...v5.43.5
1118
+ [5.43.4]: https://github.com/FabiowQuixada/isml-linter/compare/v5.43.3...v5.43.4
1106
1119
  [5.43.3]: https://github.com/FabiowQuixada/isml-linter/compare/v5.43.2...v5.43.3
1107
1120
  [5.43.2]: https://github.com/FabiowQuixada/isml-linter/compare/v5.43.1...v5.43.2
1108
1121
  [5.43.1]: https://github.com/FabiowQuixada/isml-linter/compare/v5.43.0...v5.43.1
@@ -1270,6 +1283,7 @@
1270
1283
  [issue#30]: https://github.com/FabiowQuixada/isml-linter/issues/30
1271
1284
  [issue#31]: https://github.com/FabiowQuixada/isml-linter/issues/31
1272
1285
  [issue#35]: https://github.com/FabiowQuixada/isml-linter/issues/35
1286
+ [issue#39]: https://github.com/FabiowQuixada/isml-linter/issues/39
1273
1287
 
1274
1288
  [cli-docs]: <docs/cli.md>
1275
1289
  [api-docs]: <docs/api.md>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isml-linter",
3
- "version": "5.43.3",
3
+ "version": "5.43.5",
4
4
  "author": "Fabiow Quixadá <ftquixada@gmail.com>",
5
5
  "license": "MIT",
6
6
  "main": "src/publicApi.js",
@@ -491,6 +491,10 @@ const getElementList = (templateContent, templatePath, isCrlfLineBreak) => {
491
491
  const elementList = state.elementList;
492
492
  let previousStateContent = state.remainingShadowContent;
493
493
 
494
+ if (templateContent === '') {
495
+ return [];
496
+ }
497
+
494
498
  do {
495
499
  initLoopState(state);
496
500
  parseNextElement(state);
@@ -63,7 +63,7 @@ Rule.isTailBroken = function(node) {
63
63
  const configIndentSize = this.getConfigs().indent;
64
64
  const expectedIndentation = getExpectedIndentation(node, configIndentSize);
65
65
  const actualIndentation = getActualTailIndentation(node);
66
- const isInSameLineAsOpeningTag = node.lineNumber === node.tailLineNumber;
66
+ const isInSameLineAsOpeningTag = node.endLineNumber === node.tailLineNumber;
67
67
  const isInSameLineAsLastChild = node.hasChildren() && node.getLastChild().getLastLineNumber() === node.tailLineNumber;
68
68
 
69
69
  return !node.isRoot() &&
@@ -763,6 +763,7 @@ const checkIfShouldAddIndentationToTail = node => {
763
763
  const isInSameLineAsChild = !node.hasChildren() || node.getLastChild().isInSameLineAsParent();
764
764
  const isTailInSameLineAsChild = !node.hasChildren() || node.tailLineNumber === node.getLastChild().getLastLineNumber();
765
765
  const isBrokenIntoMultipleLines = !node.hasChildren() && node.tailLineNumber && node.lineNumber !== node.tailLineNumber;
766
+ const isInSameLineAsOpeningTag = !node.hasChildren() && node.tailLineNumber && node.endLineNumber === node.tailLineNumber;
766
767
 
767
768
  const shouldAdd = hasTail &&
768
769
  !isTailInSameLineAsChild &&
@@ -774,6 +775,11 @@ const checkIfShouldAddIndentationToTail = node => {
774
775
  ||
775
776
  isBrokenIntoMultipleLines;
776
777
 
778
+ // TODO Merge this condition into the above ones;
779
+ if (isInSameLineAsOpeningTag) {
780
+ return false;
781
+ }
782
+
777
783
  return shouldAdd;
778
784
  };
779
785