@powerlines/plugin-eslint 0.8.256 → 0.8.258
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/helpers/format-message.cjs +27 -3
- package/dist/helpers/format-message.d.cts +18 -2
- package/dist/helpers/format-message.d.cts.map +1 -0
- package/dist/helpers/format-message.d.mts +18 -2
- package/dist/helpers/format-message.d.mts.map +1 -0
- package/dist/helpers/format-message.mjs +27 -2
- package/dist/helpers/format-message.mjs.map +1 -0
- package/dist/helpers/index.cjs +3 -4
- package/dist/helpers/index.d.cts +1 -2
- package/dist/helpers/index.d.mts +1 -2
- package/dist/helpers/index.mjs +1 -2
- package/dist/index.cjs +7 -173
- package/dist/index.d.cts +4 -4
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +3 -169
- package/dist/index.mjs.map +1 -1
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/get-object-tag.cjs +15 -0
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/get-object-tag.mjs +15 -0
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/get-object-tag.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-empty.cjs +20 -0
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-empty.mjs +21 -0
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-empty.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-non-null-object.cjs +16 -0
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-non-null-object.mjs +17 -0
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-non-null-object.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-null.cjs +12 -0
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-null.mjs +12 -0
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-null.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-object.cjs +19 -0
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-object.mjs +20 -0
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-object.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-plain-object.cjs +63 -0
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-plain-object.mjs +64 -0
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-plain-object.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-set-object.cjs +19 -0
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-set-object.mjs +20 -0
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-set-object.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-set.cjs +19 -0
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-set.mjs +20 -0
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-set.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-undefined.cjs +8 -0
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-undefined.mjs +8 -0
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-undefined.mjs.map +1 -0
- package/dist/types/index.cjs +0 -2
- package/dist/types/index.d.cts +1 -2
- package/dist/types/index.d.mts +1 -2
- package/dist/types/index.mjs +0 -3
- package/dist/types/plugin.cjs +0 -1
- package/dist/types/plugin.d.cts +71 -2
- package/dist/types/plugin.d.cts.map +1 -0
- package/dist/types/plugin.d.mts +71 -2
- package/dist/types/plugin.d.mts.map +1 -0
- package/dist/types/plugin.mjs +0 -2
- package/package.json +5 -5
- package/dist/format-message-B0zrT_tN.d.cts +0 -18
- package/dist/format-message-B0zrT_tN.d.cts.map +0 -1
- package/dist/format-message-Bt4W9wqe.cjs +0 -38
- package/dist/format-message-CKuUKX7C.mjs +0 -28
- package/dist/format-message-CKuUKX7C.mjs.map +0 -1
- package/dist/format-message-Ck01aLfz.d.mts +0 -18
- package/dist/format-message-Ck01aLfz.d.mts.map +0 -1
- package/dist/helpers-B15z10jN.mjs +0 -1
- package/dist/helpers-LF26RHol.cjs +0 -0
- package/dist/index-9iG2qHLe.d.mts +0 -1
- package/dist/index-D-CYNcT9.d.mts +0 -1
- package/dist/index-D4ELpJXS.d.cts +0 -1
- package/dist/index-DLoAMD9J.d.cts +0 -1
- package/dist/plugin-0NJpq6om.d.cts +0 -71
- package/dist/plugin-0NJpq6om.d.cts.map +0 -1
- package/dist/plugin-CaqHREhr.d.mts +0 -71
- package/dist/plugin-CaqHREhr.d.mts.map +0 -1
- package/dist/plugin-ifZVa20V.mjs +0 -1
- package/dist/plugin-pBKbb5K9.cjs +0 -0
- package/dist/types-U3zd8PTP.mjs +0 -1
- package/dist/types-o3zWarRp.cjs +0 -0
|
@@ -1,4 +1,28 @@
|
|
|
1
|
-
|
|
1
|
+
let __stryke_path_find = require("@stryke/path/find");
|
|
2
|
+
let __stryke_path_normalize = require("@stryke/path/normalize");
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
//#region src/helpers/format-message.ts
|
|
5
|
+
let MessageSeverity = /* @__PURE__ */ function(MessageSeverity$1) {
|
|
6
|
+
MessageSeverity$1[MessageSeverity$1["Warning"] = 1] = "Warning";
|
|
7
|
+
MessageSeverity$1[MessageSeverity$1["Error"] = 2] = "Error";
|
|
8
|
+
return MessageSeverity$1;
|
|
9
|
+
}({});
|
|
10
|
+
function formatMessage(dir, messages, filePath) {
|
|
11
|
+
let fileName = (0, __stryke_path_normalize.correctPath)((0, __stryke_path_find.relative)(dir, filePath));
|
|
12
|
+
if (!fileName.startsWith(".")) fileName = `./${fileName}`;
|
|
13
|
+
let output = `\n${fileName}`;
|
|
14
|
+
for (let i = 0; i < messages.length; i++) {
|
|
15
|
+
const { message, severity, line, column, ruleId } = messages[i];
|
|
16
|
+
output += "\n";
|
|
17
|
+
if (line && column) output = `${output + line.toString()}:${column.toString()} `;
|
|
18
|
+
if (severity === MessageSeverity.Warning) output += `Warning: `;
|
|
19
|
+
else output += `Error: `;
|
|
20
|
+
output += message;
|
|
21
|
+
if (ruleId) output += ` ${ruleId}`;
|
|
22
|
+
}
|
|
23
|
+
return output;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
exports.MessageSeverity = MessageSeverity;
|
|
28
|
+
exports.formatMessage = formatMessage;
|
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/helpers/format-message.d.ts
|
|
2
|
+
declare enum MessageSeverity {
|
|
3
|
+
Warning = 1,
|
|
4
|
+
Error = 2,
|
|
5
|
+
}
|
|
6
|
+
interface LintMessage {
|
|
7
|
+
ruleId: string | null;
|
|
8
|
+
severity: MessageSeverity;
|
|
9
|
+
message: string;
|
|
10
|
+
line: number;
|
|
11
|
+
column: number;
|
|
12
|
+
}
|
|
13
|
+
declare function formatMessage(dir: string, messages: LintMessage[], filePath: string): string;
|
|
14
|
+
declare type __ΩMessageSeverity = any[];
|
|
15
|
+
declare type __ΩLintMessage = any[];
|
|
16
|
+
//#endregion
|
|
17
|
+
export { LintMessage, MessageSeverity, __ΩLintMessage, __ΩMessageSeverity, formatMessage };
|
|
18
|
+
//# sourceMappingURL=format-message.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-message.d.cts","names":[],"sources":["../../src/helpers/format-message.ts"],"sourcesContent":[],"mappings":";aAqBY,eAAA;EAAA,OAAA,GAAA,CAAA;EAKK,KAAA,GAAA,CAAA;AAQjB;UARiB,WAAA;;YAEL;;;;;iBAMI,aAAA,wBAEJ"}
|
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/helpers/format-message.d.ts
|
|
2
|
+
declare enum MessageSeverity {
|
|
3
|
+
Warning = 1,
|
|
4
|
+
Error = 2,
|
|
5
|
+
}
|
|
6
|
+
interface LintMessage {
|
|
7
|
+
ruleId: string | null;
|
|
8
|
+
severity: MessageSeverity;
|
|
9
|
+
message: string;
|
|
10
|
+
line: number;
|
|
11
|
+
column: number;
|
|
12
|
+
}
|
|
13
|
+
declare function formatMessage(dir: string, messages: LintMessage[], filePath: string): string;
|
|
14
|
+
declare type __ΩMessageSeverity = any[];
|
|
15
|
+
declare type __ΩLintMessage = any[];
|
|
16
|
+
//#endregion
|
|
17
|
+
export { LintMessage, MessageSeverity, __ΩLintMessage, __ΩMessageSeverity, formatMessage };
|
|
18
|
+
//# sourceMappingURL=format-message.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-message.d.mts","names":[],"sources":["../../src/helpers/format-message.ts"],"sourcesContent":[],"mappings":";aAqBY,eAAA;EAAA,OAAA,GAAA,CAAA;EAKK,KAAA,GAAA,CAAA;AAQjB;UARiB,WAAA;;YAEL;;;;;iBAMI,aAAA,wBAEJ"}
|
|
@@ -1,3 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { relative } from "@stryke/path/find";
|
|
2
|
+
import { correctPath } from "@stryke/path/normalize";
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
//#region src/helpers/format-message.ts
|
|
5
|
+
let MessageSeverity = /* @__PURE__ */ function(MessageSeverity$1) {
|
|
6
|
+
MessageSeverity$1[MessageSeverity$1["Warning"] = 1] = "Warning";
|
|
7
|
+
MessageSeverity$1[MessageSeverity$1["Error"] = 2] = "Error";
|
|
8
|
+
return MessageSeverity$1;
|
|
9
|
+
}({});
|
|
10
|
+
function formatMessage(dir, messages, filePath) {
|
|
11
|
+
let fileName = correctPath(relative(dir, filePath));
|
|
12
|
+
if (!fileName.startsWith(".")) fileName = `./${fileName}`;
|
|
13
|
+
let output = `\n${fileName}`;
|
|
14
|
+
for (let i = 0; i < messages.length; i++) {
|
|
15
|
+
const { message, severity, line, column, ruleId } = messages[i];
|
|
16
|
+
output += "\n";
|
|
17
|
+
if (line && column) output = `${output + line.toString()}:${column.toString()} `;
|
|
18
|
+
if (severity === MessageSeverity.Warning) output += `Warning: `;
|
|
19
|
+
else output += `Error: `;
|
|
20
|
+
output += message;
|
|
21
|
+
if (ruleId) output += ` ${ruleId}`;
|
|
22
|
+
}
|
|
23
|
+
return output;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
export { MessageSeverity, formatMessage };
|
|
28
|
+
//# sourceMappingURL=format-message.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-message.mjs","names":[],"sources":["../../src/helpers/format-message.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { relative } from \"@stryke/path/find\";\nimport { correctPath } from \"@stryke/path/normalize\";\n\nexport enum MessageSeverity {\n Warning = 1,\n Error = 2\n}\n\nexport interface LintMessage {\n ruleId: string | null;\n severity: MessageSeverity;\n message: string;\n line: number;\n column: number;\n}\n\nexport function formatMessage(\n dir: string,\n messages: LintMessage[],\n filePath: string\n): string {\n let fileName = correctPath(relative(dir, filePath));\n if (!fileName.startsWith(\".\")) {\n fileName = `./${fileName}`;\n }\n\n let output = `\\n${fileName}`;\n\n for (let i = 0; i < messages.length; i++) {\n const { message, severity, line, column, ruleId } = messages[i]!;\n\n output += \"\\n\";\n\n if (line && column) {\n output = `${output + line.toString()}:${column.toString()} `;\n }\n\n if (severity === MessageSeverity.Warning) {\n output += `Warning: `;\n } else {\n output += `Error: `;\n }\n\n output += message;\n\n if (ruleId) {\n output += ` ${ruleId}`;\n }\n }\n\n return output;\n}\n"],"mappings":";;;;AAqBA,IAAY,8DAAL;AACL;AACA;;;AAWF,SAAgB,cACd,KACA,UACA,UACQ;CACR,IAAI,WAAW,YAAY,SAAS,KAAK,SAAS,CAAC;AACnD,KAAI,CAAC,SAAS,WAAW,IAAI,CAC3B,YAAW,KAAK;CAGlB,IAAI,SAAS,KAAK;AAElB,MAAK,IAAI,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;EACxC,MAAM,EAAE,SAAS,UAAU,MAAM,QAAQ,WAAW,SAAS;AAE7D,YAAU;AAEV,MAAI,QAAQ,OACV,UAAS,GAAG,SAAS,KAAK,UAAU,CAAC,GAAG,OAAO,UAAU,CAAC;AAG5D,MAAI,aAAa,gBAAgB,QAC/B,WAAU;MAEV,WAAU;AAGZ,YAAU;AAEV,MAAI,OACF,WAAU,KAAK;;AAInB,QAAO"}
|
package/dist/helpers/index.cjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
const
|
|
2
|
-
require('../helpers-LF26RHol.cjs');
|
|
1
|
+
const require_helpers_format_message = require('./format-message.cjs');
|
|
3
2
|
|
|
4
|
-
exports.MessageSeverity =
|
|
5
|
-
exports.formatMessage =
|
|
3
|
+
exports.MessageSeverity = require_helpers_format_message.MessageSeverity;
|
|
4
|
+
exports.formatMessage = require_helpers_format_message.formatMessage;
|
package/dist/helpers/index.d.cts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../index-DLoAMD9J.cjs";
|
|
1
|
+
import { LintMessage, MessageSeverity, __ΩLintMessage, __ΩMessageSeverity, formatMessage } from "./format-message.cjs";
|
|
3
2
|
export { LintMessage, MessageSeverity, __ΩLintMessage, __ΩMessageSeverity, formatMessage };
|
package/dist/helpers/index.d.mts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../index-D-CYNcT9.mjs";
|
|
1
|
+
import { LintMessage, MessageSeverity, __ΩLintMessage, __ΩMessageSeverity, formatMessage } from "./format-message.mjs";
|
|
3
2
|
export { LintMessage, MessageSeverity, __ΩLintMessage, __ΩMessageSeverity, formatMessage };
|
package/dist/helpers/index.mjs
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
const
|
|
3
|
-
require('./helpers-
|
|
4
|
-
require('./
|
|
5
|
-
require('./types-o3zWarRp.cjs');
|
|
2
|
+
const require_is_set_object = require('./node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-set-object.cjs');
|
|
3
|
+
const require_helpers_format_message = require('./helpers/format-message.cjs');
|
|
4
|
+
require('./helpers/index.cjs');
|
|
6
5
|
let __stryke_fs_exists = require("@stryke/fs/exists");
|
|
7
6
|
let __stryke_fs_get_parent_path = require("@stryke/fs/get-parent-path");
|
|
8
7
|
let __stryke_fs_package_fns = require("@stryke/fs/package-fns");
|
|
@@ -11,171 +10,6 @@ let __stryke_fs_semver_fns = require("@stryke/fs/semver-fns");
|
|
|
11
10
|
let __stryke_path_find = require("@stryke/path/find");
|
|
12
11
|
let defu = require("defu");
|
|
13
12
|
|
|
14
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/get-object-tag.mjs
|
|
15
|
-
/**
|
|
16
|
-
* Gets the `toStringTag` of `obj`.
|
|
17
|
-
*
|
|
18
|
-
* @param value - The obj to query.
|
|
19
|
-
* @returns Returns the `toStringTag`.
|
|
20
|
-
*/
|
|
21
|
-
const getObjectTag = (value) => {
|
|
22
|
-
if (value == null) return value === void 0 ? "[object Undefined]" : "[object Null]";
|
|
23
|
-
return Object.prototype.toString.call(value);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
//#endregion
|
|
27
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-plain-object.mjs
|
|
28
|
-
/**
|
|
29
|
-
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
30
|
-
* and has a `typeof` result of "object".
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* ```typescript
|
|
34
|
-
* isObjectLike({})
|
|
35
|
-
* // => true
|
|
36
|
-
*
|
|
37
|
-
* isObjectLike([1, 2, 3])
|
|
38
|
-
* // => true
|
|
39
|
-
*
|
|
40
|
-
* isObjectLike(Function)
|
|
41
|
-
* // => false
|
|
42
|
-
*
|
|
43
|
-
* isObjectLike(null)
|
|
44
|
-
* // => false
|
|
45
|
-
* ```
|
|
46
|
-
*
|
|
47
|
-
* @param value - The value to check.
|
|
48
|
-
* @returns Returns `true` if `value` is object-like, else `false`.
|
|
49
|
-
*/
|
|
50
|
-
const isObjectLike = (obj) => {
|
|
51
|
-
return typeof obj === "object" && obj !== null;
|
|
52
|
-
};
|
|
53
|
-
/**
|
|
54
|
-
* Checks if `obj` is a plain object, that is, an object created by the `Object` constructor or one with a `[[Prototype]]` of `null`.
|
|
55
|
-
*
|
|
56
|
-
* @example
|
|
57
|
-
* ```typescript
|
|
58
|
-
* function Foo() {
|
|
59
|
-
* this.a = 1
|
|
60
|
-
* }
|
|
61
|
-
*
|
|
62
|
-
* isPlainObject(new Foo)
|
|
63
|
-
* // => false
|
|
64
|
-
*
|
|
65
|
-
* isPlainObject([1, 2, 3])
|
|
66
|
-
* // => false
|
|
67
|
-
*
|
|
68
|
-
* isPlainObject({ 'x': 0, 'y': 0 })
|
|
69
|
-
* // => true
|
|
70
|
-
*
|
|
71
|
-
* isPlainObject(Object.create(null))
|
|
72
|
-
* // => true
|
|
73
|
-
* ```
|
|
74
|
-
*
|
|
75
|
-
* @param obj - The value to check.
|
|
76
|
-
* @returns Returns `true` if `obj` is a plain object, else `false`.
|
|
77
|
-
*/
|
|
78
|
-
const isPlainObject = (obj) => {
|
|
79
|
-
if (!isObjectLike(obj) || getObjectTag(obj) !== "[object Object]") return false;
|
|
80
|
-
if (Object.getPrototypeOf(obj) === null) return true;
|
|
81
|
-
let proto = obj;
|
|
82
|
-
while (Object.getPrototypeOf(proto) !== null) proto = Object.getPrototypeOf(proto);
|
|
83
|
-
return Object.getPrototypeOf(obj) === proto;
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
//#endregion
|
|
87
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-object.mjs
|
|
88
|
-
/**
|
|
89
|
-
* Check if the provided value's type is `Object`
|
|
90
|
-
*
|
|
91
|
-
* @param value - The value to type check
|
|
92
|
-
* @returns An indicator specifying if the value provided is of type `Object`
|
|
93
|
-
*/
|
|
94
|
-
const isObject = (value) => {
|
|
95
|
-
try {
|
|
96
|
-
return typeof value === "object" || Boolean(value) && value?.constructor === Object || isPlainObject(value);
|
|
97
|
-
} catch {
|
|
98
|
-
return false;
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
//#endregion
|
|
103
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-null.mjs
|
|
104
|
-
const isNull = (value) => {
|
|
105
|
-
try {
|
|
106
|
-
return value === null;
|
|
107
|
-
} catch {
|
|
108
|
-
return false;
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
//#endregion
|
|
113
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-undefined.mjs
|
|
114
|
-
const isUndefined = (value) => {
|
|
115
|
-
return value === void 0;
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
//#endregion
|
|
119
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-empty.mjs
|
|
120
|
-
/**
|
|
121
|
-
* Check if the provided value's type is `null` or `undefined`
|
|
122
|
-
*
|
|
123
|
-
* @param value - The value to type check
|
|
124
|
-
* @returns An indicator specifying if the value provided is of type `null` or `undefined`
|
|
125
|
-
*/
|
|
126
|
-
const isEmpty = (value) => {
|
|
127
|
-
try {
|
|
128
|
-
return isUndefined(value) || isNull(value);
|
|
129
|
-
} catch {
|
|
130
|
-
return false;
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
//#endregion
|
|
135
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-set.mjs
|
|
136
|
-
/**
|
|
137
|
-
* The inverse of the `isEmpty` function
|
|
138
|
-
*
|
|
139
|
-
* @param value - The value to type check
|
|
140
|
-
* @returns An indicator specifying if the value provided is **NOT** of type `null` or `undefined`
|
|
141
|
-
*/
|
|
142
|
-
const isSet = (value) => {
|
|
143
|
-
try {
|
|
144
|
-
return !isEmpty(value);
|
|
145
|
-
} catch {
|
|
146
|
-
return false;
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
//#endregion
|
|
151
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-non-null-object.mjs
|
|
152
|
-
/**
|
|
153
|
-
* Check if the provided value's type is `Object` and is not `null` or `undefined`
|
|
154
|
-
*
|
|
155
|
-
* @param value - The value to type check
|
|
156
|
-
* @returns An indicator specifying if the value provided is of type `Object` and is not `null` or `undefined`
|
|
157
|
-
*/
|
|
158
|
-
const isNonNullObject = (value) => {
|
|
159
|
-
return isSet(value) && isObject(value);
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
//#endregion
|
|
163
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-set-object.mjs
|
|
164
|
-
/**
|
|
165
|
-
* Check if the provided value's type is an object with some fields set
|
|
166
|
-
*
|
|
167
|
-
* @param value - The value to type check
|
|
168
|
-
* @returns An indicator specifying if the value provided is an object with some fields se
|
|
169
|
-
*/
|
|
170
|
-
const isSetObject = (value) => {
|
|
171
|
-
try {
|
|
172
|
-
return isNonNullObject(value) && Object.keys(value).length > 0;
|
|
173
|
-
} catch {
|
|
174
|
-
return false;
|
|
175
|
-
}
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
//#endregion
|
|
179
13
|
//#region src/index.ts
|
|
180
14
|
/**
|
|
181
15
|
* A Powerlines plugin to lint a project's source code with ESLint.
|
|
@@ -212,7 +46,7 @@ function plugin(options = {}) {
|
|
|
212
46
|
}) } };
|
|
213
47
|
},
|
|
214
48
|
async configResolved() {
|
|
215
|
-
if (!isSetObject(this.packageJson.eslintConfig) && (!this.config.lint.eslint.configFile || !(0, __stryke_fs_exists.existsSync)(this.config.lint.eslint.configFile))) throw new Error("No ESLint configuration file could be found");
|
|
49
|
+
if (!require_is_set_object.isSetObject(this.packageJson.eslintConfig) && (!this.config.lint.eslint.configFile || !(0, __stryke_fs_exists.existsSync)(this.config.lint.eslint.configFile))) throw new Error("No ESLint configuration file could be found");
|
|
216
50
|
else if (this.config.lint.eslint.configFile && (0, __stryke_fs_exists.existsSync)(this.config.lint.eslint.configFile)) {
|
|
217
51
|
const content = await (0, __stryke_fs_read_file.readFile)(this.config.lint.eslint.configFile);
|
|
218
52
|
if (content?.trim().replace(/\s/g, "") || content?.trim().replace(/\s/g, "") === "---" || content?.trim().replace(/\s/g, "") === "{}" || content?.trim().replace(/\s/g, "") === "module.exports={}") throw new Error(`The ESLint configuration file at "${this.config.lint.eslint.configFile}" is empty`);
|
|
@@ -258,7 +92,7 @@ function plugin(options = {}) {
|
|
|
258
92
|
if ("loadESLint" in module$1) ESLint = await module$1.loadESLint({ useFlatConfig: this.config.lint.eslint.configFile ? (0, __stryke_path_find.findFileName)(this.config.lint.eslint.configFile).startsWith("eslint.config.") : true });
|
|
259
93
|
if (this.config.lint.eslint.fix) await ESLint.outputFixes(results);
|
|
260
94
|
if (this.config.lint.eslint.reportErrorsOnly) results = ESLint.getErrorResults(results);
|
|
261
|
-
const output = results.filter(({ messages }) => messages?.length).map(({ messages, filePath }) =>
|
|
95
|
+
const output = results.filter(({ messages }) => messages?.length).map(({ messages, filePath }) => require_helpers_format_message.formatMessage(this.config.projectRoot, messages, filePath)).join("\n");
|
|
262
96
|
if (this.config.lint.eslint.outputFile) await this.fs.write(this.config.lint.eslint.outputFile, output);
|
|
263
97
|
else this.info(output);
|
|
264
98
|
}
|
|
@@ -267,7 +101,7 @@ function plugin(options = {}) {
|
|
|
267
101
|
var src_default = plugin;
|
|
268
102
|
|
|
269
103
|
//#endregion
|
|
270
|
-
exports.MessageSeverity =
|
|
104
|
+
exports.MessageSeverity = require_helpers_format_message.MessageSeverity;
|
|
271
105
|
exports.default = src_default;
|
|
272
|
-
exports.formatMessage =
|
|
106
|
+
exports.formatMessage = require_helpers_format_message.formatMessage;
|
|
273
107
|
exports.plugin = plugin;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./
|
|
3
|
-
import
|
|
4
|
-
import "./index-D4ELpJXS.cjs";
|
|
1
|
+
import { LintMessage, MessageSeverity, __ΩLintMessage, __ΩMessageSeverity, formatMessage } from "./helpers/format-message.cjs";
|
|
2
|
+
import { ESLintPluginContext, ESLintPluginOptions, ESLintPluginResolvedConfig, ESLintPluginUserConfig, __ΩESLintPluginContext, __ΩESLintPluginOptions, __ΩESLintPluginResolvedConfig, __ΩESLintPluginUserConfig } from "./types/plugin.cjs";
|
|
3
|
+
import "./types/index.cjs";
|
|
5
4
|
import { Plugin } from "powerlines/types/plugin";
|
|
6
5
|
|
|
7
6
|
//#region src/index.d.ts
|
|
7
|
+
|
|
8
8
|
/**
|
|
9
9
|
* A Powerlines plugin to lint a project's source code with ESLint.
|
|
10
10
|
*/
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAsCA;AACW,iBADK,MAAA,CACL,OAAA,CAAA,EAAA,mBAAA,CAAA,EACR,MADQ,CACD,mBADC,CAAA"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./
|
|
3
|
-
import
|
|
4
|
-
import "./index-9iG2qHLe.mjs";
|
|
1
|
+
import { LintMessage, MessageSeverity, __ΩLintMessage, __ΩMessageSeverity, formatMessage } from "./helpers/format-message.mjs";
|
|
2
|
+
import { ESLintPluginContext, ESLintPluginOptions, ESLintPluginResolvedConfig, ESLintPluginUserConfig, __ΩESLintPluginContext, __ΩESLintPluginOptions, __ΩESLintPluginResolvedConfig, __ΩESLintPluginUserConfig } from "./types/plugin.mjs";
|
|
3
|
+
import "./types/index.mjs";
|
|
5
4
|
import { Plugin } from "powerlines/types/plugin";
|
|
6
5
|
|
|
7
6
|
//#region src/index.d.ts
|
|
7
|
+
|
|
8
8
|
/**
|
|
9
9
|
* A Powerlines plugin to lint a project's source code with ESLint.
|
|
10
10
|
*/
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAsCA;AACW,iBADK,MAAA,CACL,OAAA,CAAA,EAAA,mBAAA,CAAA,EACR,MADQ,CACD,mBADC,CAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./helpers-
|
|
3
|
-
import "./
|
|
4
|
-
import "./types-U3zd8PTP.mjs";
|
|
1
|
+
import { isSetObject } from "./node_modules/.pnpm/@stryke_type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-set-object.mjs";
|
|
2
|
+
import { MessageSeverity, formatMessage } from "./helpers/format-message.mjs";
|
|
3
|
+
import "./helpers/index.mjs";
|
|
5
4
|
import { existsSync } from "@stryke/fs/exists";
|
|
6
5
|
import { getParentPath } from "@stryke/fs/get-parent-path";
|
|
7
6
|
import { isPackageExists } from "@stryke/fs/package-fns";
|
|
@@ -10,171 +9,6 @@ import { parseVersion } from "@stryke/fs/semver-fns";
|
|
|
10
9
|
import { findFileName } from "@stryke/path/find";
|
|
11
10
|
import { defu } from "defu";
|
|
12
11
|
|
|
13
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/get-object-tag.mjs
|
|
14
|
-
/**
|
|
15
|
-
* Gets the `toStringTag` of `obj`.
|
|
16
|
-
*
|
|
17
|
-
* @param value - The obj to query.
|
|
18
|
-
* @returns Returns the `toStringTag`.
|
|
19
|
-
*/
|
|
20
|
-
const getObjectTag = (value) => {
|
|
21
|
-
if (value == null) return value === void 0 ? "[object Undefined]" : "[object Null]";
|
|
22
|
-
return Object.prototype.toString.call(value);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
//#endregion
|
|
26
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-plain-object.mjs
|
|
27
|
-
/**
|
|
28
|
-
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
29
|
-
* and has a `typeof` result of "object".
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* ```typescript
|
|
33
|
-
* isObjectLike({})
|
|
34
|
-
* // => true
|
|
35
|
-
*
|
|
36
|
-
* isObjectLike([1, 2, 3])
|
|
37
|
-
* // => true
|
|
38
|
-
*
|
|
39
|
-
* isObjectLike(Function)
|
|
40
|
-
* // => false
|
|
41
|
-
*
|
|
42
|
-
* isObjectLike(null)
|
|
43
|
-
* // => false
|
|
44
|
-
* ```
|
|
45
|
-
*
|
|
46
|
-
* @param value - The value to check.
|
|
47
|
-
* @returns Returns `true` if `value` is object-like, else `false`.
|
|
48
|
-
*/
|
|
49
|
-
const isObjectLike = (obj) => {
|
|
50
|
-
return typeof obj === "object" && obj !== null;
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* Checks if `obj` is a plain object, that is, an object created by the `Object` constructor or one with a `[[Prototype]]` of `null`.
|
|
54
|
-
*
|
|
55
|
-
* @example
|
|
56
|
-
* ```typescript
|
|
57
|
-
* function Foo() {
|
|
58
|
-
* this.a = 1
|
|
59
|
-
* }
|
|
60
|
-
*
|
|
61
|
-
* isPlainObject(new Foo)
|
|
62
|
-
* // => false
|
|
63
|
-
*
|
|
64
|
-
* isPlainObject([1, 2, 3])
|
|
65
|
-
* // => false
|
|
66
|
-
*
|
|
67
|
-
* isPlainObject({ 'x': 0, 'y': 0 })
|
|
68
|
-
* // => true
|
|
69
|
-
*
|
|
70
|
-
* isPlainObject(Object.create(null))
|
|
71
|
-
* // => true
|
|
72
|
-
* ```
|
|
73
|
-
*
|
|
74
|
-
* @param obj - The value to check.
|
|
75
|
-
* @returns Returns `true` if `obj` is a plain object, else `false`.
|
|
76
|
-
*/
|
|
77
|
-
const isPlainObject = (obj) => {
|
|
78
|
-
if (!isObjectLike(obj) || getObjectTag(obj) !== "[object Object]") return false;
|
|
79
|
-
if (Object.getPrototypeOf(obj) === null) return true;
|
|
80
|
-
let proto = obj;
|
|
81
|
-
while (Object.getPrototypeOf(proto) !== null) proto = Object.getPrototypeOf(proto);
|
|
82
|
-
return Object.getPrototypeOf(obj) === proto;
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
//#endregion
|
|
86
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-object.mjs
|
|
87
|
-
/**
|
|
88
|
-
* Check if the provided value's type is `Object`
|
|
89
|
-
*
|
|
90
|
-
* @param value - The value to type check
|
|
91
|
-
* @returns An indicator specifying if the value provided is of type `Object`
|
|
92
|
-
*/
|
|
93
|
-
const isObject = (value) => {
|
|
94
|
-
try {
|
|
95
|
-
return typeof value === "object" || Boolean(value) && value?.constructor === Object || isPlainObject(value);
|
|
96
|
-
} catch {
|
|
97
|
-
return false;
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
//#endregion
|
|
102
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-null.mjs
|
|
103
|
-
const isNull = (value) => {
|
|
104
|
-
try {
|
|
105
|
-
return value === null;
|
|
106
|
-
} catch {
|
|
107
|
-
return false;
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
//#endregion
|
|
112
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-undefined.mjs
|
|
113
|
-
const isUndefined = (value) => {
|
|
114
|
-
return value === void 0;
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
//#endregion
|
|
118
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-empty.mjs
|
|
119
|
-
/**
|
|
120
|
-
* Check if the provided value's type is `null` or `undefined`
|
|
121
|
-
*
|
|
122
|
-
* @param value - The value to type check
|
|
123
|
-
* @returns An indicator specifying if the value provided is of type `null` or `undefined`
|
|
124
|
-
*/
|
|
125
|
-
const isEmpty = (value) => {
|
|
126
|
-
try {
|
|
127
|
-
return isUndefined(value) || isNull(value);
|
|
128
|
-
} catch {
|
|
129
|
-
return false;
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
//#endregion
|
|
134
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-set.mjs
|
|
135
|
-
/**
|
|
136
|
-
* The inverse of the `isEmpty` function
|
|
137
|
-
*
|
|
138
|
-
* @param value - The value to type check
|
|
139
|
-
* @returns An indicator specifying if the value provided is **NOT** of type `null` or `undefined`
|
|
140
|
-
*/
|
|
141
|
-
const isSet = (value) => {
|
|
142
|
-
try {
|
|
143
|
-
return !isEmpty(value);
|
|
144
|
-
} catch {
|
|
145
|
-
return false;
|
|
146
|
-
}
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
//#endregion
|
|
150
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-non-null-object.mjs
|
|
151
|
-
/**
|
|
152
|
-
* Check if the provided value's type is `Object` and is not `null` or `undefined`
|
|
153
|
-
*
|
|
154
|
-
* @param value - The value to type check
|
|
155
|
-
* @returns An indicator specifying if the value provided is of type `Object` and is not `null` or `undefined`
|
|
156
|
-
*/
|
|
157
|
-
const isNonNullObject = (value) => {
|
|
158
|
-
return isSet(value) && isObject(value);
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
//#endregion
|
|
162
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-set-object.mjs
|
|
163
|
-
/**
|
|
164
|
-
* Check if the provided value's type is an object with some fields set
|
|
165
|
-
*
|
|
166
|
-
* @param value - The value to type check
|
|
167
|
-
* @returns An indicator specifying if the value provided is an object with some fields se
|
|
168
|
-
*/
|
|
169
|
-
const isSetObject = (value) => {
|
|
170
|
-
try {
|
|
171
|
-
return isNonNullObject(value) && Object.keys(value).length > 0;
|
|
172
|
-
} catch {
|
|
173
|
-
return false;
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
//#endregion
|
|
178
12
|
//#region src/index.ts
|
|
179
13
|
/**
|
|
180
14
|
* A Powerlines plugin to lint a project's source code with ESLint.
|