@sasjs/lint 2.1.3 → 2.2.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.
@@ -13,7 +13,7 @@ jobs:
13
13
  runs-on: ubuntu-latest
14
14
  steps:
15
15
  - name: Checkout
16
- uses: actions/checkout@v2
16
+ uses: actions/checkout@v3
17
17
  - name: Install Dependencies
18
18
  run: npm ci
19
19
  - name: Check Code Style
@@ -21,7 +21,7 @@ jobs:
21
21
  - name: Build Project
22
22
  run: npm run build
23
23
  - name: Semantic Release
24
- uses: cycjimmy/semantic-release-action@v2
24
+ uses: cycjimmy/semantic-release-action@v3
25
25
  env:
26
26
  GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
27
27
  NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
package/README.md CHANGED
@@ -25,7 +25,10 @@ Configuration is via a `.sasjslint` file with the following structure (these are
25
25
  "hasMacroParentheses": true,
26
26
  "ignoreList": ["sajsbuild/", "sasjsresults/"],
27
27
  "indentationMultiple": 2,
28
+ "lineEndings": "off",
28
29
  "lowerCaseFileNames": true,
30
+ "maxDataLineLength": 80,
31
+ "maxHeaderLineLength": 80,
29
32
  "maxLineLength": 80,
30
33
  "noNestedMacros": true,
31
34
  "noGremlins": true,
@@ -46,9 +49,22 @@ Each setting can have three states:
46
49
 
47
50
  For more details, and the default state, see the description of each rule below. It is also possible to change whether a rule returns ERROR or WARN using the `severityLevels` object.
48
51
 
52
+ ### allowedGremlins
53
+
54
+ An array of hex codes that represents allowed gremlins (invisible / undesirable characters). To allow all gremlins, you can also set the `noGremlins` rule to `false`.
55
+
56
+ Example:
57
+
58
+ ```json
59
+ {
60
+ "noGremlins": true,
61
+ "allowedGremlins": ["0x0080", "0x3000"]
62
+ }
63
+ ```
64
+
49
65
  ### defaultHeader
50
66
 
51
- This isn't actually a rule - but rather a formatting setting, which applies to SAS program that do NOT begin with `/**`. It can be triggered by running `sasjs lint fix` in the SASjs CLI, or by hitting "save" when using the SASjs VS Code extension (with "formatOnSave" in place)
67
+ This isn't a rule, but a formatting setting, which applies to SAS program that do NOT begin with `/**`. It can be triggered by running `sasjs lint fix` in the SASjs CLI, or by hitting "save" when using the SASjs VS Code extension (with "formatOnSave" in place)
52
68
 
53
69
  The default header is as follows:
54
70
 
@@ -107,6 +123,21 @@ This will check each line to ensure that the count of leading spaces can be divi
107
123
  - Default: 2
108
124
  - Severity: WARNING
109
125
 
126
+ ### lineEndings
127
+
128
+ This setting ensures the line endings in a file to conform the configured type. Possible values are `lf`, `crlf` and `off` (off means rule is set to be off). If the value is missing, null or undefined then the check would also be switched off (no default applied).
129
+
130
+ - Default: "off"
131
+ - Severity: WARNING
132
+
133
+ Example (to enforce unix line endings):
134
+
135
+ ```json
136
+ {
137
+ "lineEndings": "lf"
138
+ }
139
+ ```
140
+
110
141
  ### lowerCaseFileNames
111
142
 
112
143
  On *nix systems, it is imperative that autocall macros are in lowercase. When sharing code between windows and *nix systems, the difference in case sensitivity can also be a cause of lost developer time. For this reason, we recommend that sas filenames are always lowercase.
@@ -114,6 +145,45 @@ On *nix systems, it is imperative that autocall macros are in lowercase. When sh
114
145
  - Default: true
115
146
  - Severity: WARNING
116
147
 
148
+ ### maxDataLineLength
149
+
150
+ Datalines can be very wide, so to avoid the need to increase `maxLineLength` for the entire project, it is possible to raise the line length limit for the data records only. On a related note, as a developer, you should also be aware that code submitted in batch may have a default line length limit which is lower than you expect. See this [usage note](https://support.sas.com/kb/15/883.html) (and thanks to [sasutils for reminding us](https://github.com/sasjs/lint/issues/47#issuecomment-1064340104)).
151
+
152
+ This feature will work for the following statements:
153
+
154
+ - cards
155
+ - cards4
156
+ - datalines
157
+ - datalines4
158
+ - parmcards
159
+ - parmcards4
160
+
161
+ The `maxDataLineLength` setting is always the _higher_ of `maxDataLineLength` and `maxLineLength` (if you set a lower number, it is ignored).
162
+
163
+ - Default: 80
164
+ - Severity: WARNING
165
+
166
+ See also:
167
+
168
+ - [hasDoxygenHeader](#hasdoxygenheader)
169
+ - [maxHeaderLineLength](#maxheaderlinelength)
170
+ - [maxLineLength](#maxlinelength)
171
+
172
+ ### maxHeaderLineLength
173
+
174
+ In a program header it can be necessary to insert items such as URLs or markdown tables, that cannot be split over multiple lines. To avoid the need to increase `maxLineLength` for the entire project, it is possible to raise the line length limit for the header section only.
175
+
176
+ The `maxHeaderLineLength` setting is always the _higher_ of `maxHeaderLineLength` and `maxLineLength` (if you set a lower number, it is ignored).
177
+
178
+ - Default: 80
179
+ - Severity: WARNING
180
+
181
+ See also:
182
+
183
+ - [hasDoxygenHeader](#hasdoxygenheader)
184
+ - [maxDataLineLength](#maxdatalinelength)
185
+ - [maxLineLength](#maxlinelength)
186
+
117
187
  ### maxLineLength
118
188
 
119
189
  Code becomes far more readable when line lengths are short. The most compelling reason for short line lengths is to avoid the need to scroll when performing a side-by-side 'compare' between two files (eg as part of a GIT feature branch review). A longer discussion on optimal code line length can be found [here](https://stackoverflow.com/questions/578059/studies-on-optimal-code-width)
@@ -125,9 +195,14 @@ We strongly recommend a line length limit, and set the bar at 80. To turn this f
125
195
  - Default: 80
126
196
  - Severity: WARNING
127
197
 
198
+ See also:
199
+
200
+ - [maxDataLineLength](#maxdatalinelength)
201
+ - [maxHeaderLineLength](#maxheaderlinelength)
202
+
128
203
  ### noGremlins
129
204
 
130
- Capture zero-width whitespace and other non-standard characters. The logic is borrowed from the [VSCode Gremlins Extension](https://github.com/nhoizey/vscode-gremlins) - if you are looking for more advanced gremlin zapping capabilities, we highly recommend to use their extension instead.
205
+ Capture zero-width whitespace and other non-standard characters. The logic is borrowed from the [VSCode Gremlins Extension](https://github.com/nhoizey/vscode-gremlins) - if you are looking for more advanced gremlin zapping capabilities, we highly recommend to use their extension instead.
131
206
 
132
207
  The list of characters can be found in this file: [https://github.com/sasjs/lint/blob/main/src/utils/gremlinCharacters.ts](https://github.com/sasjs/lint/blob/main/src/utils/gremlinCharacters.ts)
133
208
 
@@ -188,11 +263,6 @@ This setting allows the default severity to be adjusted. This is helpful when ru
188
263
  - "warn" - show warning in the log (doesn’t affect exit code)
189
264
  - "error" - show error in the log (exit code is 1 when triggered)
190
265
 
191
- ## Upcoming Linting Rules:
192
-
193
- - `noGremlins` -> identifies all invisible characters, other than spaces / tabs / line endings. If you really need that bell character, use a hex literal!
194
- - `lineEndings` -> set a standard line ending, such as LF or CRLF
195
-
196
266
  # SAS Formatter
197
267
 
198
268
  A formatter will automatically apply rules when you hit SAVE, which can save a LOT of time.
package/lint/shared.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { LintConfig, Diagnostic } from '../types';
1
+ import { LintConfig, Diagnostic, LineLintRuleOptions } from '../types';
2
2
  export declare const processText: (text: string, config: LintConfig) => Diagnostic[];
3
3
  export declare const processFile: (filePath: string, config: LintConfig) => Diagnostic[];
4
- export declare const processLine: (config: LintConfig, line: string, lineNumber: number) => Diagnostic[];
4
+ export declare const processLine: (config: LintConfig, line: string, lineNumber: number, options: LineLintRuleOptions) => Diagnostic[];
package/lint/shared.js CHANGED
@@ -23,12 +23,17 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
23
23
  Object.defineProperty(exports, "__esModule", { value: true });
24
24
  exports.processLine = exports.processFile = exports.processText = void 0;
25
25
  var utils_1 = require("../utils");
26
+ var utils_2 = require("../utils");
26
27
  var processText = function (text, config) {
27
28
  var lines = utils_1.splitText(text, config);
29
+ var headerLinesCount = utils_1.getHeaderLinesCount(text, config);
30
+ var dataSections = utils_2.getDataSectionsDetail(text, config);
28
31
  var diagnostics = [];
29
32
  diagnostics.push.apply(diagnostics, __spreadArray([], __read(processContent(config, text))));
30
33
  lines.forEach(function (line, index) {
31
- diagnostics.push.apply(diagnostics, __spreadArray([], __read(exports.processLine(config, line, index + 1))));
34
+ var isHeaderLine = index + 1 <= headerLinesCount;
35
+ var isDataLine = utils_2.checkIsDataLine(dataSections, index);
36
+ diagnostics.push.apply(diagnostics, __spreadArray([], __read(exports.processLine(config, line, index + 1, { isHeaderLine: isHeaderLine, isDataLine: isDataLine }))));
32
37
  });
33
38
  return diagnostics;
34
39
  };
@@ -48,10 +53,10 @@ var processContent = function (config, content) {
48
53
  });
49
54
  return diagnostics;
50
55
  };
51
- var processLine = function (config, line, lineNumber) {
56
+ var processLine = function (config, line, lineNumber, options) {
52
57
  var diagnostics = [];
53
58
  config.lineLintRules.forEach(function (rule) {
54
- diagnostics.push.apply(diagnostics, __spreadArray([], __read(rule.test(line, lineNumber, config))));
59
+ diagnostics.push.apply(diagnostics, __spreadArray([], __read(rule.test(line, lineNumber, config, options))));
55
60
  });
56
61
  return diagnostics;
57
62
  };
@@ -1 +1 @@
1
- {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/lint/shared.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AACA,kCAAoC;AAE7B,IAAM,WAAW,GAAG,UAAC,IAAY,EAAE,MAAkB;IAC1D,IAAM,KAAK,GAAG,iBAAS,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;IACrC,IAAM,WAAW,GAAiB,EAAE,CAAA;IACpC,WAAW,CAAC,IAAI,OAAhB,WAAW,2BAAS,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,IAAC;IACjD,KAAK,CAAC,OAAO,CAAC,UAAC,IAAI,EAAE,KAAK;QACxB,WAAW,CAAC,IAAI,OAAhB,WAAW,2BAAS,mBAAW,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,GAAG,CAAC,CAAC,IAAC;IAC3D,CAAC,CAAC,CAAA;IAEF,OAAO,WAAW,CAAA;AACpB,CAAC,CAAA;AATY,QAAA,WAAW,eASvB;AAEM,IAAM,WAAW,GAAG,UACzB,QAAgB,EAChB,MAAkB;IAElB,IAAM,WAAW,GAAiB,EAAE,CAAA;IACpC,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,UAAC,IAAI;QAChC,WAAW,CAAC,IAAI,OAAhB,WAAW,2BAAS,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM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C,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,UAAC,IAAI;QAChC,WAAW,CAAC,IAAI,OAAhB,WAAW,2BAAS,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,IAAC;IACnE,CAAC,CAAC,CAAA;IAEF,OAAO,WAAW,CAAA;AACpB,CAAC,CAAA;AAZY,QAAA,WAAW,eAYvB"}
package/package.json CHANGED
@@ -39,17 +39,17 @@
39
39
  },
40
40
  "homepage": "https://github.com/sasjs/lint#readme",
41
41
  "devDependencies": {
42
- "@types/jest": "^26.0.23",
43
- "@types/node": "^15.12.2",
44
- "all-contributors-cli": "^6.20.0",
45
- "jest": "^26.6.3",
42
+ "@types/jest": "29.2.5",
43
+ "@types/node": "18.11.18",
44
+ "all-contributors-cli": "6.24.0",
45
+ "jest": "29.3.1",
46
46
  "rimraf": "^3.0.2",
47
- "ts-jest": "^26.5.6",
47
+ "ts-jest": "29.0.3",
48
48
  "typescript": "^4.3.2"
49
49
  },
50
50
  "dependencies": {
51
- "@sasjs/utils": "^2.19.0",
52
- "ignore": "^5.2.0"
51
+ "@sasjs/utils": "2.52.0",
52
+ "ignore": "5.2.4"
53
53
  },
54
- "version": "2.1.3"
54
+ "version": "2.2.1"
55
55
  }
@@ -3,12 +3,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.maxLineLength = void 0;
4
4
  var LintRuleType_1 = require("../../types/LintRuleType");
5
5
  var Severity_1 = require("../../types/Severity");
6
+ var utils_1 = require("../../utils");
6
7
  var name = 'maxLineLength';
7
8
  var description = 'Restrict lines to the specified length.';
8
9
  var message = 'Line exceeds maximum length';
9
- var test = function (value, lineNumber, config) {
10
+ var test = function (value, lineNumber, config, options) {
10
11
  var severity = (config === null || config === void 0 ? void 0 : config.severityLevel[name]) || Severity_1.Severity.Warning;
11
- var maxLineLength = (config === null || config === void 0 ? void 0 : config.maxLineLength) || 80;
12
+ var maxLineLength = utils_1.DefaultLintConfiguration.maxLineLength;
13
+ if (config) {
14
+ if (options === null || options === void 0 ? void 0 : options.isHeaderLine) {
15
+ maxLineLength = Math.max(config.maxLineLength, config.maxHeaderLineLength);
16
+ }
17
+ else if (options === null || options === void 0 ? void 0 : options.isDataLine) {
18
+ maxLineLength = Math.max(config.maxLineLength, config.maxDataLineLength);
19
+ }
20
+ else {
21
+ maxLineLength = config.maxLineLength;
22
+ }
23
+ }
12
24
  if (value.length <= maxLineLength)
13
25
  return [];
14
26
  return [
@@ -1 +1 @@
1
- {"version":3,"file":"maxLineLength.js","sourceRoot":"","sources":["../../../src/rules/line/maxLineLength.ts"],"names":[],"mappings":";;;AAEA,yDAAuD;AACvD,iDAA+C;AAE/C,IAAM,IAAI,GAAG,eAAe,CAAA;AAC5B,IAAM,WAAW,GAAG,yCAAyC,CAAA;AAC7D,IAAM,OAAO,GAAG,6BAA6B,CAAA;AAE7C,IAAM,IAAI,GAAG,UAAC,KAAa,EAAE,UAAkB,EAAE,MAAmB;IAClE,IAAM,QAAQ,GAAG,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,aAAa,CAAC,IAAI,CAAC,KAAI,mBAAQ,CAAC,OAAO,CAAA;IAChE,IAAM,aAAa,GAAG,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,aAAa,KAAI,EAAE,CAAA;IACjD,IAAI,KAAK,CAAC,MAAM,IAAI,aAAa;QAAE,OAAO,EAAE,CAAA;IAC5C,OAAO;QACL;YACE,OAAO,EAAK,OAAO,aAAO,KAAK,CAAC,MAAM,GAAG,aAAa,iBAAa;YACnE,UAAU,YAAA;YACV,iBAAiB,EAAE,CAAC;YACpB,eAAe,EAAE,CAAC;YAClB,QAAQ,UAAA;SACT;KACF,CAAA;AACH,CAAC,CAAA;AAED;;GAEG;AACU,QAAA,aAAa,GAAiB;IACzC,IAAI,EAAE,2BAAY,CAAC,IAAI;IACvB,IAAI,MAAA;IACJ,WAAW,aAAA;IACX,OAAO,SAAA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AA,aAAa,GAAiB;IACzC,IAAI,EAAE,2BAAY,CAAC,IAAI;IACvB,IAAI,MAAA;IACJ,WAAW,aAAA;IACX,OAAO,SAAA;IACP,IAAI,MAAA;CACL,CAAA"}
@@ -3,3 +3,4 @@ import { LineLintRule } from '../../types/LintRule';
3
3
  * Lint rule that checks if a given line of text contains any gremlins.
4
4
  */
5
5
  export declare const noGremlins: LineLintRule;
6
+ export declare const charFromHex: (hexCode: string) => string;
@@ -27,7 +27,7 @@ var __read = (this && this.__read) || function (o, n) {
27
27
  return ar;
28
28
  };
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
- exports.noGremlins = void 0;
30
+ exports.charFromHex = exports.noGremlins = void 0;
31
31
  var LintRuleType_1 = require("../../types/LintRuleType");
32
32
  var Severity_1 = require("../../types/Severity");
33
33
  var utils_1 = require("../../utils");
@@ -37,14 +37,17 @@ var message = 'Line contains a gremlin';
37
37
  var test = function (value, lineNumber, config) {
38
38
  var e_1, _a;
39
39
  var severity = (config === null || config === void 0 ? void 0 : config.severityLevel[name]) || Severity_1.Severity.Warning;
40
+ var allowedGremlins = (config === null || config === void 0 ? void 0 : config.allowedGremlins) || [];
40
41
  var diagnostics = [];
41
42
  var gremlins = {};
42
43
  try {
43
44
  for (var _b = __values(Object.entries(utils_1.gremlinCharacters)), _c = _b.next(); !_c.done; _c = _b.next()) {
44
- var _d = __read(_c.value, 2), hexCode = _d[0], config_1 = _d[1];
45
- gremlins[charFromHex(hexCode)] = Object.assign({}, config_1, {
46
- hexCode: hexCode
47
- });
45
+ var _d = __read(_c.value, 2), hexCode = _d[0], gremlinConfig = _d[1];
46
+ if (!allowedGremlins.includes(hexCode)) {
47
+ gremlins[exports.charFromHex(hexCode)] = Object.assign({}, gremlinConfig, {
48
+ hexCode: hexCode
49
+ });
50
+ }
48
51
  }
49
52
  }
50
53
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
@@ -81,5 +84,8 @@ exports.noGremlins = {
81
84
  message: message,
82
85
  test: test
83
86
  };
84
- var charFromHex = function (hexCode) { return String.fromCodePoint(parseInt(hexCode)); };
87
+ var charFromHex = function (hexCode) {
88
+ return String.fromCodePoint(parseInt(hexCode));
89
+ };
90
+ exports.charFromHex = charFromHex;
85
91
  //# sourceMappingURL=noGremlins.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"noGremlins.js","sourceRoot":"","sources":["../../../src/rules/line/noGremlins.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,yDAAuD;AACvD,iDAA+C;AAC/C,qCAA+C;AAE/C,IAAM,IAAI,GAAG,YAAY,CAAA;AACzB,IAAM,WAAW,GAAG,iDAAiD,CAAA;AACrE,IAAM,OAAO,GAAG,yBAAyB,CAAA;AAEzC,IAAM,IAAI,GAAG,UAAC,KAAa,EAAE,UAAkB,EAAE,MAAmB;;IAClE,IAAM,QAAQ,GAAG,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,aAAa,CAAC,IAAI,CAAC,KAAI,mBAAQ,CAAC,OAAO,CAAA;IAEhE,IAAM,WAAW,GAAiB,EAAE,CAAA;IAEpC,IAAM,QAAQ,GAAQ,EAAE,CAAA;;QAExB,KAAgC,IAAA,KAAA,SAAA,MAAM,CAAC,OAAO,CAAC,yBAAiB,CAAC,CAAA,gBAAA,4BAAE;YAAxD,IAAA,KAAA,mBAAiB,EAAhB,OAAO,QAAA,EAAE,QAAM,QAAA;YACzB,QAAQ,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,QAAM,EAAE;gBACzD,OAAO,SAAA;aACR,CAAC,CAAA;SACH;;;;;;;;;IAED,IAAM,kBAAkB,GAAG,IAAI,MAAM,CACnC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;SAClB,GAAG,CAAC,UAAC,IAAI,IAAK,OAAG,IAAI,MAAG,EAAV,CAAU,CAAC;SACzB,IAAI,CAAC,GAAG,CAAC,EACZ,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A;YACV,iBAAiB,EAAE,KAAK,CAAC,KAAK,GAAG,CAAC;YAClC,eAAe,EAAE,KAAK,CAAC,KAAK,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM;YAClD,QAAQ,UAAA;SACT,CAAC,CAAA;KACH;IAED,OAAO,WAAW,CAAA;AACpB,CAAC,CAAA;AAED;;GAEG;AACU,QAAA,UAAU,GAAiB;IACtC,IAAI,EAAE,2BAAY,CAAC,IAAI;IACvB,IAAI,MAAA;IACJ,WAAW,aAAA;IACX,OAAO,SAAA;IACP,IAAI,MAAA;CACL,CAAA;AAEM,IAAM,WAAW,GAAG,UAAC,OAAe;IACzC,OAAA,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAAvC,CAAuC,CAAA;AAD5B,QAAA,WAAW,eACiB"}
@@ -13,6 +13,8 @@
13
13
  "indentationMultiple": 2,
14
14
  "lowerCaseFileNames": true,
15
15
  "maxLineLength": 80,
16
+ "maxHeaderLineLength": 80,
17
+ "maxDataLineLength": 80,
16
18
  "noGremlins": true,
17
19
  "noNestedMacros": true,
18
20
  "noSpacesInFileNames": true,
@@ -30,7 +32,10 @@
30
32
  "noSpacesInFileNames": true,
31
33
  "lowerCaseFileNames": true,
32
34
  "maxLineLength": 80,
35
+ "maxHeaderLineLength": 80,
36
+ "maxDataLineLength": 80,
33
37
  "noGremlins": true,
38
+ "allowedGremlins": ["0x0080", "0x3000"],
34
39
  "noTabs": true,
35
40
  "indentationMultiple": 4,
36
41
  "hasMacroNameInMend": true,
@@ -74,6 +79,18 @@
74
79
  "default": [true],
75
80
  "examples": [true, false]
76
81
  },
82
+ "allowedGremlins": {
83
+ "$id": "#/properties/allowedGremlins",
84
+ "type": "array",
85
+ "items": {
86
+ "type": "string",
87
+ "pattern": "^0x[0-9A-Fa-f]{4}$"
88
+ },
89
+ "title": "allowedGremlins",
90
+ "description": "An array of hex codes that represents allowed gremlins.",
91
+ "default": [],
92
+ "examples": ["0x0080", "0x3000"]
93
+ },
77
94
  "hasMacroNameInMend": {
78
95
  "$id": "#/properties/hasMacroNameInMend",
79
96
  "type": "boolean",
@@ -114,6 +131,22 @@
114
131
  "default": 80,
115
132
  "examples": [60, 80, 120]
116
133
  },
134
+ "maxHeaderLineLength": {
135
+ "$id": "#/properties/maxHeaderLineLength",
136
+ "type": "number",
137
+ "title": "maxHeaderLineLength",
138
+ "description": "Enforces a configurable maximum line length for header section. Shows a warning for lines exceeding this length.",
139
+ "default": 80,
140
+ "examples": [60, 80, 120]
141
+ },
142
+ "maxDataLineLength": {
143
+ "$id": "#/properties/maxDataLineLength",
144
+ "type": "number",
145
+ "title": "maxDataLineLength",
146
+ "description": "Enforces a configurable maximum line length for data section. Shows a warning for lines exceeding this length.",
147
+ "default": 80,
148
+ "examples": [60, 80, 120]
149
+ },
117
150
  "noNestedMacros": {
118
151
  "$id": "#/properties/noNestedMacros",
119
152
  "type": "boolean",
@@ -149,6 +182,7 @@
149
182
  "lineEndings": {
150
183
  "$id": "#/properties/lineEndings",
151
184
  "type": "string",
185
+ "enum": ["lf", "crlf", "off"],
152
186
  "title": "lineEndings",
153
187
  "description": "Enforces the configured terminating character for each line. Shows a warning when incorrect line endings are present.",
154
188
  "default": "lf",
@@ -1,4 +1,5 @@
1
1
  export declare enum LineEndings {
2
2
  LF = "lf",
3
- CRLF = "crlf"
3
+ CRLF = "crlf",
4
+ OFF = "off"
4
5
  }
@@ -5,5 +5,6 @@ var LineEndings;
5
5
  (function (LineEndings) {
6
6
  LineEndings["LF"] = "lf";
7
7
  LineEndings["CRLF"] = "crlf";
8
+ LineEndings["OFF"] = "off";
8
9
  })(LineEndings = exports.LineEndings || (exports.LineEndings = {}));
9
10
  //# sourceMappingURL=LineEndings.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LineEndings.js","sourceRoot":"","sources":["../../src/types/LineEndings.ts"],"names":[],"mappings":";;;AAAA,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,wBAAS,CAAA;IACT,4BAAa,CAAA;AACf,CAAC,EAHW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAGtB"}
1
+ {"version":3,"file":"LineEndings.js","sourceRoot":"","sources":["../../src/types/LineEndings.ts"],"names":[],"mappings":";;;AAAA,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,wBAAS,CAAA;IACT,4BAAa,CAAA;IACb,0BAAW,CAAA;AACb,CAAC,EAJW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAItB"}
@@ -10,10 +10,13 @@ import { Severity } from './Severity';
10
10
  */
11
11
  export declare class LintConfig {
12
12
  readonly ignoreList: string[];
13
+ readonly allowedGremlins: string[];
13
14
  readonly lineLintRules: LineLintRule[];
14
15
  readonly fileLintRules: FileLintRule[];
15
16
  readonly pathLintRules: PathLintRule[];
16
17
  readonly maxLineLength: number;
18
+ readonly maxHeaderLineLength: number;
19
+ readonly maxDataLineLength: number;
17
20
  readonly indentationMultiple: number;
18
21
  readonly lineEndings: LineEndings;
19
22
  readonly defaultHeader: string;
@@ -46,10 +46,13 @@ var LintConfig = /** @class */ (function () {
46
46
  var e_1, _a;
47
47
  var _this = this;
48
48
  this.ignoreList = [];
49
+ this.allowedGremlins = [];
49
50
  this.lineLintRules = [];
50
51
  this.fileLintRules = [];
51
52
  this.pathLintRules = [];
52
53
  this.maxLineLength = 80;
54
+ this.maxHeaderLineLength = 80;
55
+ this.maxDataLineLength = 80;
53
56
  this.indentationMultiple = 2;
54
57
  this.lineEndings = LineEndings_1.LineEndings.LF;
55
58
  this.defaultHeader = utils_1.getDefaultHeader();
@@ -77,16 +80,22 @@ var LintConfig = /** @class */ (function () {
77
80
  if ((json === null || json === void 0 ? void 0 : json.noTabs) === false || (json === null || json === void 0 ? void 0 : json.noTabIndentation) === false) {
78
81
  this.lineLintRules.pop();
79
82
  }
80
- this.lineLintRules.push(line_1.maxLineLength);
81
- if (!isNaN(json === null || json === void 0 ? void 0 : json.maxLineLength)) {
83
+ if ((json === null || json === void 0 ? void 0 : json.maxLineLength) > 0) {
84
+ this.lineLintRules.push(line_1.maxLineLength);
82
85
  this.maxLineLength = json.maxLineLength;
86
+ if (!isNaN(json === null || json === void 0 ? void 0 : json.maxHeaderLineLength)) {
87
+ this.maxHeaderLineLength = json.maxHeaderLineLength;
88
+ }
89
+ if (!isNaN(json === null || json === void 0 ? void 0 : json.maxDataLineLength)) {
90
+ this.maxDataLineLength = json.maxDataLineLength;
91
+ }
83
92
  }
84
- this.fileLintRules.push(file_1.lineEndings);
85
- if (json === null || json === void 0 ? void 0 : json.lineEndings) {
93
+ if ((json === null || json === void 0 ? void 0 : json.lineEndings) && json.lineEndings !== LineEndings_1.LineEndings.OFF) {
86
94
  if (json.lineEndings !== LineEndings_1.LineEndings.LF &&
87
95
  json.lineEndings !== LineEndings_1.LineEndings.CRLF) {
88
96
  throw new Error("Invalid value for lineEndings: can be " + LineEndings_1.LineEndings.LF + " or " + LineEndings_1.LineEndings.CRLF);
89
97
  }
98
+ this.fileLintRules.push(file_1.lineEndings);
90
99
  this.lineEndings = json.lineEndings;
91
100
  }
92
101
  this.lineLintRules.push(line_1.indentationMultiple);
@@ -119,6 +128,19 @@ var LintConfig = /** @class */ (function () {
119
128
  }
120
129
  if ((json === null || json === void 0 ? void 0 : json.noGremlins) !== false) {
121
130
  this.lineLintRules.push(line_1.noGremlins);
131
+ if (json === null || json === void 0 ? void 0 : json.allowedGremlins) {
132
+ if (Array.isArray(json.allowedGremlins)) {
133
+ json.allowedGremlins.forEach(function (item) {
134
+ if (typeof item === 'string' && /^0x[0-9a-f]{4}$/i.test(item))
135
+ _this.allowedGremlins.push(item);
136
+ else
137
+ throw new Error("Property \"allowedGremlins\" has invalid type of values. It can contain only strings of form hexcode like '[\"0x0080\", \"0x3000\"]'");
138
+ });
139
+ }
140
+ else {
141
+ throw new Error("Property \"allowedGremlins\" can only be an array of strings of form hexcode like '[\"0x0080\", \"0x3000\"]'");
142
+ }
143
+ }
122
144
  }
123
145
  if (json === null || json === void 0 ? void 0 : json.severityLevel) {
124
146
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"LintConfig.js","sourceRoot":"","sources":["../../src/types/LintConfig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sCAOsB;AACtB,sCAOsB;AACtB,sCAAuE;AACvE,6CAA2C;AAE3C,kCAA2C;AAC3C,uCAAqC;AAErC;;;;;;GAMG;AACH;IAWE,oBAAY,IAAU;;QAAtB,iBA6FC;QAvGQ,eAAU,GAAa,EAAE,CAAA;QACzB,kBAAa,GAAmB,EAAE,CAAA;QAClC,kBAAa,GAAmB,EAAE,CAAA;QAClC,kBAAa,GAAmB,EAAE,CAAA;QAClC,kBAAa,GAAW,EAAE,CAAA;QAC1B,wBAAmB,GAAW,CAAC,CAAA;QAC/B,gBAAW,GAAgB,yBAAW,CAAC,EAAE,CAAA;QACzC,kBAAa,GAAW,wBAAgB,EAAE,CAAA;QAC1C,kBAAa,GAAgC,EAAE,CAAA;QAGtD,IAAI,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,UAAU,EAAE;YACpB,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE;gBAClC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,UAAC,IAAS;oBAChC,IAAI,OAAO,IAAI,KAAK,QAAQ;wBAAE,KAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;;wBAEtD,MAAM,IAAI,KAAK,CACb,kFAAgF,CACjF,CAAA;gBACL,CAAC,CAAC,CAAA;aACH;iBAAM;gBACL,MAAM,IAAI,KAAK,CAAC,yDAAuD,CAAC,CAAA;aACzE;SACF;QAED,IAAI,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,gBAAgB,MAAK,KAAK,EAAE;YACpC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,uBAAgB,CAAC,CAAA;SAC1C;QAED,IAAI,CAAA,IA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BACvC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,UAAC,IAAS;wBACrC,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC;4BAC3D,KAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;;4BAE/B,MAAM,IAAI,KAAK,CACb,sIAAgI,CACjI,CAAA;oBACL,CAAC,CAAC,CAAA;iBACH;qBAAM;oBACL,MAAM,IAAI,KAAK,CACb,8GAAwG,CACzG,CAAA;iBACF;aACF;SACF;QAED,IAAI,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,aAAa,EAAE;;gBACvB,KAA+B,IAAA,KAAA,SAAA,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA,gBAAA,4BAAE;oBAAxD,IAAA,KAAA,mBAAgB,EAAf,IAAI,QAAA,EAAE,QAAQ,QAAA;oBACxB,IAAI,QAAQ,KAAK,MAAM;wBAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,mBAAQ,CAAC,OAAO,CAAA;oBACpE,IAAI,QAAQ,KAAK,OAAO;wBAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,mBAAQ,CAAC,KAAK,CAAA;iBACpE;;;;;;;;;SACF;IACH,CAAC;IACH,iBAAC;AAAD,CAAC,AArID,IAqIC;AArIY,gCAAU"}
@@ -11,12 +11,16 @@ export interface LintRule {
11
11
  description: string;
12
12
  message: string;
13
13
  }
14
+ export interface LineLintRuleOptions {
15
+ isHeaderLine?: boolean;
16
+ isDataLine?: boolean;
17
+ }
14
18
  /**
15
19
  * A LineLintRule is run once per line of text.
16
20
  */
17
21
  export interface LineLintRule extends LintRule {
18
22
  type: LintRuleType.Line;
19
- test: (value: string, lineNumber: number, config?: LintConfig) => Diagnostic[];
23
+ test: (value: string, lineNumber: number, config?: LintConfig, options?: LineLintRuleOptions) => Diagnostic[];
20
24
  fix?: (value: string, config?: LintConfig) => string;
21
25
  }
22
26
  /**
@@ -0,0 +1,8 @@
1
+ import { LintConfig } from '../types';
2
+ interface DataSectionsDetail {
3
+ start: number;
4
+ end: number;
5
+ }
6
+ export declare const getDataSectionsDetail: (text: string, config: LintConfig) => DataSectionsDetail[];
7
+ export declare const checkIsDataLine: (dataSections: DataSectionsDetail[], lineIndex: number) => boolean;
8
+ export {};
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ var __values = (this && this.__values) || function(o) {
3
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
4
+ if (m) return m.call(o);
5
+ if (o && typeof o.length === "number") return {
6
+ next: function () {
7
+ if (o && i >= o.length) o = void 0;
8
+ return { value: o && o[i++], done: !o };
9
+ }
10
+ };
11
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.checkIsDataLine = exports.getDataSectionsDetail = void 0;
15
+ var splitText_1 = require("./splitText");
16
+ var getDataSectionsDetail = function (text, config) {
17
+ var dataSections = [];
18
+ var lines = splitText_1.splitText(text, config);
19
+ var dataSectionStartRegex1 = new RegExp('^(datalines;)|(cards;)|(parmcards;)');
20
+ var dataSectionEndRegex1 = new RegExp(';');
21
+ var dataSectionStartRegex2 = new RegExp('^(datalines4;)|(cards4;)|(parmcards4;)');
22
+ var dataSectionEndRegex2 = new RegExp(';;;;');
23
+ var dataSectionStarted = false;
24
+ var dataSectionStartIndex = -1;
25
+ var dataSectionEndRegex = dataSectionEndRegex1;
26
+ lines.forEach(function (line, index) {
27
+ if (dataSectionStarted) {
28
+ if (dataSectionEndRegex.test(line)) {
29
+ dataSections.push({ start: dataSectionStartIndex, end: index });
30
+ dataSectionStarted = false;
31
+ }
32
+ }
33
+ else {
34
+ if (dataSectionStartRegex1.test(line)) {
35
+ dataSectionStarted = true;
36
+ dataSectionStartIndex = index;
37
+ dataSectionEndRegex = dataSectionEndRegex1;
38
+ }
39
+ else if (dataSectionStartRegex2.test(line)) {
40
+ dataSectionStarted = true;
41
+ dataSectionStartIndex = index;
42
+ dataSectionEndRegex = dataSectionEndRegex2;
43
+ }
44
+ }
45
+ });
46
+ return dataSections;
47
+ };
48
+ exports.getDataSectionsDetail = getDataSectionsDetail;
49
+ var checkIsDataLine = function (dataSections, lineIndex) {
50
+ var e_1, _a;
51
+ try {
52
+ for (var dataSections_1 = __values(dataSections), dataSections_1_1 = dataSections_1.next(); !dataSections_1_1.done; dataSections_1_1 = dataSections_1.next()) {
53
+ var dataSection = dataSections_1_1.value;
54
+ if (lineIndex >= dataSection.start && lineIndex <= dataSection.end)
55
+ return true;
56
+ }
57
+ }
58
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
59
+ finally {
60
+ try {
61
+ if (dataSections_1_1 && !dataSections_1_1.done && (_a = dataSections_1.return)) _a.call(dataSections_1);
62
+ }
63
+ finally { if (e_1) throw e_1.error; }
64
+ }
65
+ return false;
66
+ };
67
+ exports.checkIsDataLine = checkIsDataLine;
68
+ //# sourceMappingURL=getDataSectionsDetail.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getDataSectionsDetail.js","sourceRoot":"","sources":["../../src/utils/getDataSectionsDetail.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,yCAAuC;AAOhC,IAAM,qBAAqB,GAAG,UAAC,IAAY,EAAE,MAAkB;IACpE,IAAM,YAAY,GAAyB,EAAE,CAAA;IAC7C,IAAM,KAAK,GAAG,qBAAS,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;IAErC,IAAM,sBAAsB,GAAG,IAAI,MAAM,CACvC,qCAAqC,CACtC,CAAA;IACD,IAAM,oBAAoB,GAAG,IAAI,MAAM,CAAC,GAAG,CAAC,CAAA;IAC5C,IAAM,sBAAsB,GAAG,IAAI,MAAM,CACvC,wCAAwC,CACzC,CAAA;IACD,IAAM,oBAAoB,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,CAAA;IA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
+ * This function returns the number of lines the header spans upon.
4
+ * The file must start with "/*" and the header will finish with ⇙
5
+ */
6
+ export declare const getHeaderLinesCount: (text: string, config: LintConfig) => number;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ var __values = (this && this.__values) || function(o) {
3
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
4
+ if (m) return m.call(o);
5
+ if (o && typeof o.length === "number") return {
6
+ next: function () {
7
+ if (o && i >= o.length) o = void 0;
8
+ return { value: o && o[i++], done: !o };
9
+ }
10
+ };
11
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.getHeaderLinesCount = void 0;
15
+ var splitText_1 = require("./splitText");
16
+ /**
17
+ * This function returns the number of lines the header spans upon.
18
+ * The file must start with "/*" and the header will finish with ⇙
19
+ */
20
+ var getHeaderLinesCount = function (text, config) {
21
+ var e_1, _a;
22
+ var count = 0;
23
+ if (text.trimStart().startsWith('/*')) {
24
+ var lines = splitText_1.splitText(text, config);
25
+ try {
26
+ for (var lines_1 = __values(lines), lines_1_1 = lines_1.next(); !lines_1_1.done; lines_1_1 = lines_1.next()) {
27
+ var line = lines_1_1.value;
28
+ count++;
29
+ if (line.match(/\*\//)) {
30
+ break;
31
+ }
32
+ }
33
+ }
34
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
35
+ finally {
36
+ try {
37
+ if (lines_1_1 && !lines_1_1.done && (_a = lines_1.return)) _a.call(lines_1);
38
+ }
39
+ finally { if (e_1) throw e_1.error; }
40
+ }
41
+ }
42
+ return count;
43
+ };
44
+ exports.getHeaderLinesCount = getHeaderLinesCount;
45
+ //# sourceMappingURL=getHeaderLinesCount.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getHeaderLinesCount.js","sourceRoot":"","sources":["../../src/utils/getHeaderLinesCount.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,yCAAuC;AAEvC;;;GAGG;AACI,IAAM,mBAAmB,GAAG,UAAC,IAAY,EAAE,MAAkB;;IAClE,IAAI,KAAK,GAAG,CAAC,CAAA;IAEb,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;QACrC,IAAM,KAAK,GAAG,qBAAS,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;;YAErC,KAAmB,IAAA,UAAA,SAAA,KAAK,CAAA,4BAAA,+CAAE;gBAArB,IAAM,IAAI,kBAAA;gBACb,KAAK,EAAE,CAAA;gBACP,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;oBACtB,MAAK;iBACN;aACF;;;;;;;;;KACF;IAED,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAfY,QAAA,mBAAmB,uBAe/B"}
@@ -10,6 +10,8 @@ export declare const DefaultLintConfiguration: {
10
10
  noSpacesInFileNames: boolean;
11
11
  lowerCaseFileNames: boolean;
12
12
  maxLineLength: number;
13
+ maxHeaderLineLength: number;
14
+ maxDataLineLength: number;
13
15
  noTabIndentation: boolean;
14
16
  indentationMultiple: number;
15
17
  hasMacroNameInMend: boolean;
@@ -58,6 +58,8 @@ exports.DefaultLintConfiguration = {
58
58
  noSpacesInFileNames: true,
59
59
  lowerCaseFileNames: true,
60
60
  maxLineLength: 80,
61
+ maxHeaderLineLength: 80,
62
+ maxDataLineLength: 80,
61
63
  noTabIndentation: true,
62
64
  indentationMultiple: 2,
63
65
  hasMacroNameInMend: true,
@@ -1 +1 @@
1
- {"version":3,"file":"getLintConfig.js","sourceRoot":"","sources":["../../src/utils/getLintConfig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAuB;AACvB,kDAAgD;AAChD,0CAA4C;AAC5C,mDAAiD;AAE1C,IAAM,gBAAgB,GAAG;IAC9B,OAAA,gHAAgH;AAAhH,CAAgH,CAAA;AADrG,QAAA,gBAAgB,oBACqF;AA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EAAE,IAAI;IACtB,mBAAmB,EAAE,IAAI;IACzB,kBAAkB,EAAE,IAAI;IACxB,aAAa,EAAE,EAAE;IACjB,mBAAmB,EAAE,EAAE;IACvB,iBAAiB,EAAE,EAAE;IACrB,gBAAgB,EAAE,IAAI;IACtB,mBAAmB,EAAE,CAAC;IACtB,kBAAkB,EAAE,IAAI;IACxB,cAAc,EAAE,IAAI;IACpB,mBAAmB,EAAE,IAAI;IACzB,qBAAqB,EAAE,IAAI;IAC3B,UAAU,EAAE,IAAI;IAChB,aAAa,EAAE,wBAAgB,EAAE;CAClC,CAAA;AAED;;;;GAIG;AACH,SAAsB,aAAa;;;;;wBACb,qBAAM,+BAAc,EAAE,EAAA;;oBAApC,WAAW,GAAG,SAAsB;oBACpB,qBAAM,eAAQ,CAClC,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,YAAY,CAAC,CACrC,CAAC,KAAK,CAAC,UAAC,CAAC;4BACR,OAAO,IAAI,CAAC,SAAS,CAAC,gCAAwB,CAAC,CAAA;wBACjD,CAAC,CAAC,EAAA;;oBAJI,aAAa,GAAG,SAIpB;oBACF,sBAAO,IAAI,uBAAU,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,EAAA;;;;CACjD;AARD,sCAQC"}
package/utils/index.d.ts CHANGED
@@ -6,3 +6,5 @@ export * from './isIgnored';
6
6
  export * from './listSasFiles';
7
7
  export * from './splitText';
8
8
  export * from './getIndicesOf';
9
+ export * from './getHeaderLinesCount';
10
+ export * from './getDataSectionsDetail';
package/utils/index.js CHANGED
@@ -18,4 +18,6 @@ __exportStar(require("./isIgnored"), exports);
18
18
  __exportStar(require("./listSasFiles"), exports);
19
19
  __exportStar(require("./splitText"), exports);
20
20
  __exportStar(require("./getIndicesOf"), exports);
21
+ __exportStar(require("./getHeaderLinesCount"), exports);
22
+ __exportStar(require("./getDataSectionsDetail"), exports);
21
23
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAA8B;AAC9B,kDAA+B;AAC/B,mDAAgC;AAChC,sDAAmC;AACnC,8CAA2B;AAC3B,iDAA8B;AAC9B,8CAA2B;AAC3B,iDAA8B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAA8B;AAC9B,kDAA+B;AAC/B,mDAAgC;AAChC,sDAAmC;AACnC,8CAA2B;AAC3B,iDAA8B;AAC9B,8CAA2B;AAC3B,iDAA8B;AAC9B,wDAAqC;AACrC,0DAAuC"}