@sasjs/lint 5.5.0 → 5.5.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/README.md +1 -1
- package/package.json +1 -1
- package/utils/getLintConfig.d.ts +8 -0
- package/utils/getLintConfig.js +10 -2
- package/utils/getLintConfig.js.map +1 -1
package/README.md
CHANGED
|
@@ -60,7 +60,7 @@ Configuration is via a `.sasjslint` file with the following structure (these are
|
|
|
60
60
|
|
|
61
61
|
Two keys do not have a section of their own. `requiredMacroOptions` is documented with [`hasRequiredMacroOptions`](#hasrequiredmacrooptions), the rule it configures. The deprecated alias `noTabIndentation` is accepted in place of `noTabs`, and is therefore not listed above - it is an alternative spelling rather than a setting of its own.
|
|
62
62
|
|
|
63
|
-
The file is read as strict JSON, so it cannot carry comments: a file that does not parse is reported as an error, naming the file, rather than being treated as though no configuration were present. Add `"$schema": "https://
|
|
63
|
+
The file is read as strict JSON, so it cannot carry comments: a file that does not parse is reported as an error, naming the file, rather than being treated as though no configuration were present. Add `"$schema": "https://raw.githubusercontent.com/sasjs/lint/main/sasjslint-schema.json"` to get completion, hover text and validation for every setting in an editor that understands JSON schemas - `sasjs lint init` and a SASjs Server's seeded drive-root file both write it.
|
|
64
64
|
|
|
65
65
|
## SAS Lint Settings
|
|
66
66
|
|
package/package.json
CHANGED
package/utils/getLintConfig.d.ts
CHANGED
|
@@ -59,6 +59,14 @@ export declare const DefaultLintConfiguration: {
|
|
|
59
59
|
* @returns {Promise<LintConfig>} resolves with an object representing the current lint configuration.
|
|
60
60
|
*/
|
|
61
61
|
export declare function getLintConfig(): Promise<LintConfig>;
|
|
62
|
+
/**
|
|
63
|
+
* Where the settings of a `.sasjslint` are documented.
|
|
64
|
+
*
|
|
65
|
+
* This is the schema itself, not the `cli.sasjs.io` address that redirects to
|
|
66
|
+
* it: an editor that will not follow a `$ref` to another host (VS Code does
|
|
67
|
+
* not) reports that one as untrusted and offers no completions.
|
|
68
|
+
*/
|
|
69
|
+
export declare const lintSchemaUrl = "https://raw.githubusercontent.com/sasjs/lint/main/sasjslint-schema.json";
|
|
62
70
|
/**
|
|
63
71
|
* Reads the configuration file, turning a parse failure into a message that
|
|
64
72
|
* names the file and says what to do about it. A raw `JSON.parse` error reads
|
package/utils/getLintConfig.js
CHANGED
|
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.parseLintConfig = exports.DefaultLintConfiguration = exports.getDefaultHeader = void 0;
|
|
15
|
+
exports.parseLintConfig = exports.lintSchemaUrl = exports.DefaultLintConfiguration = exports.getDefaultHeader = void 0;
|
|
16
16
|
exports.getLintConfig = getLintConfig;
|
|
17
17
|
const path_1 = __importDefault(require("path"));
|
|
18
18
|
const os_1 = __importDefault(require("os"));
|
|
@@ -93,6 +93,14 @@ function getLintConfig() {
|
|
|
93
93
|
return new LintConfig_1.LintConfig((0, exports.parseLintConfig)(configuration, lintFilePath));
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* Where the settings of a `.sasjslint` are documented.
|
|
98
|
+
*
|
|
99
|
+
* This is the schema itself, not the `cli.sasjs.io` address that redirects to
|
|
100
|
+
* it: an editor that will not follow a `$ref` to another host (VS Code does
|
|
101
|
+
* not) reports that one as untrusted and offers no completions.
|
|
102
|
+
*/
|
|
103
|
+
exports.lintSchemaUrl = 'https://raw.githubusercontent.com/sasjs/lint/main/sasjslint-schema.json';
|
|
96
104
|
/**
|
|
97
105
|
* Reads the configuration file, turning a parse failure into a message that
|
|
98
106
|
* names the file and says what to do about it. A raw `JSON.parse` error reads
|
|
@@ -108,7 +116,7 @@ const parseLintConfig = (configuration, filePath) => {
|
|
|
108
116
|
throw new Error(`${filePath} is not valid JSON (${reason}).\n` +
|
|
109
117
|
'The file is read as strict JSON, so it cannot carry comments. ' +
|
|
110
118
|
'Every setting, its type and its default are documented in the schema: ' +
|
|
111
|
-
|
|
119
|
+
exports.lintSchemaUrl);
|
|
112
120
|
}
|
|
113
121
|
};
|
|
114
122
|
exports.parseLintConfig = parseLintConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLintConfig.js","sourceRoot":"","sources":["../../src/utils/getLintConfig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAsEA,sCAWC;AAjFD,gDAAuB;AACvB,4CAAmB;AACnB,oDAAgD;AAChD,4CAA4C;AAC5C,qDAAiD;AACjD,sDAAkD;AAClD,iEAA6D;AAC7D,iEAA6D;AAEtD,MAAM,gBAAgB,GAAG,GAAG,EAAE,CACnC,wIAAwI,CAAA;AAD7H,QAAA,gBAAgB,oBAC6G;AAE1I;;;;;;;GAOG;AACU,QAAA,wBAAwB,GAAG;IACtC,eAAe,EAAE,EAAE;IACnB,aAAa,EAAE,CAAC,GAAG,2CAAoB,CAAC;IACxC,aAAa,EAAE,IAAA,wBAAgB,GAAE;IACjC,gBAAgB,EAAE,IAAI;IACtB,kBAAkB,EAAE,IAAI;IACxB,mBAAmB,EAAE,IAAI;IACzB,uBAAuB,EAAE,KAAK;IAC9B,UAAU,EAAE,EAAE;IACd,eAAe,EAAE,EAAE;IACnB,aAAa,EAAE,CAAC,GAAG,2CAAoB,CAAC;IACxC,mBAAmB,EAAE,CAAC;IACtB,WAAW,EAAE,UAAU;IACvB,WAAW,EAAE,yBAAW,CAAC,GAAG;IAC5B,kBAAkB,EAAE,IAAI;IACxB,mBAAmB,EAAE,IAAI;IACzB,iBAAiB,EAAE,EAAE;IACrB,mBAAmB,EAAE,EAAE;IACvB,aAAa,EAAE,EAAE;IACjB,kBAAkB,EAAE,CAAC;IACrB,eAAe,EAAE,IAAI;IACrB,kBAAkB,EAAE,IAAI;IACxB,UAAU,EAAE,IAAI;IAChB,mBAAmB,EAAE,KAAK;IAC1B,qBAAqB,EAAE,KA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