isml-linter 5.40.3 → 5.40.4

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,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [5.40.4] - 2023-01-15
4
+
5
+ ### Fixed
6
+ - Invalid ">" character detection;
7
+ - Invalid element issue length;
8
+ - "no-inline-style" rule;
9
+
3
10
  ## [5.40.3] - 2022-09-12
4
11
 
5
12
  ### Fixed
@@ -1027,6 +1034,7 @@
1027
1034
  ### Added
1028
1035
  - Linter is published;
1029
1036
 
1037
+ [5.40.4]: https://github.com/FabiowQuixada/isml-linter/compare/v5.40.3...v5.40.4
1030
1038
  [5.40.3]: https://github.com/FabiowQuixada/isml-linter/compare/v5.40.2...v5.40.3
1031
1039
  [5.40.2]: https://github.com/FabiowQuixada/isml-linter/compare/v5.40.1...v5.40.2
1032
1040
  [5.40.1]: https://github.com/FabiowQuixada/isml-linter/compare/v5.40.0...v5.40.1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isml-linter",
3
- "version": "5.40.3",
3
+ "version": "5.40.4",
4
4
  "author": "Fabiow Quixadá <ftquixada@gmail.com>",
5
5
  "license": "MIT",
6
6
  "main": "src/publicApi.js",
@@ -140,6 +140,14 @@ const parseNextElement = state => {
140
140
  newElement.globalPos,
141
141
  state.templatePath
142
142
  );
143
+ } else if (newElement.value.trim() === '>') {
144
+ throw ExceptionUtils.invalidCharacterError(
145
+ '>',
146
+ newElement.lineNumber,
147
+ newElement.globalPos,
148
+ 1,
149
+ state.templatePath
150
+ );
143
151
  }
144
152
 
145
153
  return newElement;
@@ -2,7 +2,7 @@ const SingleLineRulePrototype = require('../prototypes/SingleLineRulePrototype')
2
2
 
3
3
  const ruleId = require('path').basename(__filename).slice(0, -3);
4
4
  const description = 'Avoid using inline style';
5
- const occurrenceText = 'style="';
5
+ const occurrenceText = ' style="';
6
6
 
7
7
  const Rule = Object.create(SingleLineRulePrototype);
8
8
 
@@ -11,7 +11,7 @@ Rule.init(ruleId, description);
11
11
  Rule.isBroken = function(line) { return line.indexOf('<isprint') === -1 && line.indexOf(occurrenceText) >= 0; };
12
12
 
13
13
  Rule.getColumnNumber = function(line) {
14
- return Math.max(line.indexOf(occurrenceText), 0) + 1;
14
+ return Math.max(line.indexOf(occurrenceText), 0) + 2;
15
15
  };
16
16
 
17
17
  Rule.getFirstOccurrence = function(line) {
@@ -23,8 +23,8 @@ Rule.getFirstOccurrence = function(line) {
23
23
  const matchPos = line.indexOf(occurrenceText);
24
24
 
25
25
  result = {
26
- globalPos : matchPos,
27
- length : occurrenceText.length - 2
26
+ globalPos : matchPos + 1,
27
+ length : occurrenceText.length - 3
28
28
  };
29
29
  }
30
30
 
@@ -105,7 +105,7 @@ const invalidNestedIsifError = (tagType, lineNumber, globalPos, templatePath) =>
105
105
  message : `An error occurred while parsing element "<${tagType}>" in line ${lineNumber}. Try moving the closing character ">" of the "<${tagType}>" element to outside of the "<isif>" condition.`,
106
106
  templatePath : templatePath,
107
107
  globalPos,
108
- length : tagType.length,
108
+ length : tagType.length + 1,
109
109
  lineNumber : lineNumber,
110
110
  isCustom : true,
111
111
  type : types.INVALID_NESTED_ISIF