@powerlines/plugin-eslint 0.8.242 → 0.8.244
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/format-message-B0zrT_tN.d.cts +18 -0
- package/dist/format-message-B0zrT_tN.d.cts.map +1 -0
- package/dist/format-message-Bt4W9wqe.cjs +38 -0
- package/dist/format-message-CKuUKX7C.mjs +28 -0
- package/dist/format-message-CKuUKX7C.mjs.map +1 -0
- package/dist/format-message-Ck01aLfz.d.mts +18 -0
- package/dist/format-message-Ck01aLfz.d.mts.map +1 -0
- package/dist/helpers/format-message.cjs +3 -27
- package/dist/helpers/format-message.d.cts +1 -16
- package/dist/helpers/format-message.d.mts +1 -16
- package/dist/helpers/format-message.mjs +1 -25
- package/dist/helpers/index.cjs +4 -3
- package/dist/helpers/index.d.cts +2 -1
- package/dist/helpers/index.d.mts +2 -1
- package/dist/helpers/index.mjs +2 -1
- package/dist/helpers-B15z10jN.mjs +1 -0
- package/dist/helpers-LF26RHol.cjs +0 -0
- package/dist/index-9iG2qHLe.d.mts +1 -0
- package/dist/index-D-CYNcT9.d.mts +1 -0
- package/dist/index-D4ELpJXS.d.cts +1 -0
- package/dist/index-DLoAMD9J.d.cts +1 -0
- package/dist/index.cjs +173 -7
- package/dist/index.d.cts +6 -5
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +6 -5
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +171 -4
- package/dist/index.mjs.map +1 -0
- package/dist/plugin-0NJpq6om.d.cts +71 -0
- package/dist/plugin-0NJpq6om.d.cts.map +1 -0
- package/dist/plugin-CaqHREhr.d.mts +71 -0
- package/dist/plugin-CaqHREhr.d.mts.map +1 -0
- package/dist/plugin-ifZVa20V.mjs +1 -0
- package/dist/plugin-pBKbb5K9.cjs +0 -0
- package/dist/types/index.cjs +2 -0
- package/dist/types/index.d.cts +2 -1
- package/dist/types/index.d.mts +2 -1
- package/dist/types/index.mjs +3 -0
- package/dist/types/plugin.cjs +1 -0
- package/dist/types/plugin.d.cts +1 -69
- package/dist/types/plugin.d.mts +1 -69
- package/dist/types/plugin.mjs +2 -0
- package/dist/types-U3zd8PTP.mjs +1 -0
- package/dist/types-o3zWarRp.cjs +0 -0
- package/package.json +3 -3
|
@@ -0,0 +1,18 @@
|
|
|
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 { formatMessage as a, __ΩMessageSeverity as i, MessageSeverity as n, __ΩLintMessage as r, LintMessage as t };
|
|
18
|
+
//# sourceMappingURL=format-message-B0zrT_tN.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-message-B0zrT_tN.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"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
let __stryke_path_find = require("@stryke/path/find");
|
|
2
|
+
let __stryke_path_normalize = require("@stryke/path/normalize");
|
|
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 = (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
|
+
Object.defineProperty(exports, 'MessageSeverity', {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function () {
|
|
30
|
+
return MessageSeverity;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
Object.defineProperty(exports, 'formatMessage', {
|
|
34
|
+
enumerable: true,
|
|
35
|
+
get: function () {
|
|
36
|
+
return formatMessage;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { relative } from "@stryke/path/find";
|
|
2
|
+
import { correctPath } from "@stryke/path/normalize";
|
|
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 { formatMessage as n, MessageSeverity as t };
|
|
28
|
+
//# sourceMappingURL=format-message-CKuUKX7C.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-message-CKuUKX7C.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"}
|
|
@@ -0,0 +1,18 @@
|
|
|
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 { formatMessage as a, __ΩMessageSeverity as i, MessageSeverity as n, __ΩLintMessage as r, LintMessage as t };
|
|
18
|
+
//# sourceMappingURL=format-message-Ck01aLfz.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-message-Ck01aLfz.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,28 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
let __stryke_path_normalize = require("@stryke/path/normalize");
|
|
1
|
+
const require_format_message = require('../format-message-Bt4W9wqe.cjs');
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
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;
|
|
3
|
+
exports.MessageSeverity = require_format_message.MessageSeverity;
|
|
4
|
+
exports.formatMessage = require_format_message.formatMessage;
|
|
@@ -1,17 +1,2 @@
|
|
|
1
|
-
|
|
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
|
|
1
|
+
import { a as formatMessage, i as __ΩMessageSeverity, n as MessageSeverity, r as __ΩLintMessage, t as LintMessage } from "../format-message-B0zrT_tN.cjs";
|
|
17
2
|
export { LintMessage, MessageSeverity, __ΩLintMessage, __ΩMessageSeverity, formatMessage };
|
|
@@ -1,17 +1,2 @@
|
|
|
1
|
-
|
|
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
|
|
1
|
+
import { a as formatMessage, i as __ΩMessageSeverity, n as MessageSeverity, r as __ΩLintMessage, t as LintMessage } from "../format-message-Ck01aLfz.mjs";
|
|
17
2
|
export { LintMessage, MessageSeverity, __ΩLintMessage, __ΩMessageSeverity, formatMessage };
|
|
@@ -1,27 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { correctPath } from "@stryke/path/normalize";
|
|
1
|
+
import { n as formatMessage, t as MessageSeverity } from "../format-message-CKuUKX7C.mjs";
|
|
3
2
|
|
|
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
3
|
export { MessageSeverity, formatMessage };
|
package/dist/helpers/index.cjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_format_message = require('../format-message-Bt4W9wqe.cjs');
|
|
2
|
+
require('../helpers-LF26RHol.cjs');
|
|
2
3
|
|
|
3
|
-
exports.MessageSeverity =
|
|
4
|
-
exports.formatMessage =
|
|
4
|
+
exports.MessageSeverity = require_format_message.MessageSeverity;
|
|
5
|
+
exports.formatMessage = require_format_message.formatMessage;
|
package/dist/helpers/index.d.cts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as formatMessage, i as __ΩMessageSeverity, n as MessageSeverity, r as __ΩLintMessage, t as LintMessage } from "../format-message-B0zrT_tN.cjs";
|
|
2
|
+
import "../index-DLoAMD9J.cjs";
|
|
2
3
|
export { LintMessage, MessageSeverity, __ΩLintMessage, __ΩMessageSeverity, formatMessage };
|
package/dist/helpers/index.d.mts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as formatMessage, i as __ΩMessageSeverity, n as MessageSeverity, r as __ΩLintMessage, t as LintMessage } from "../format-message-Ck01aLfz.mjs";
|
|
2
|
+
import "../index-D-CYNcT9.mjs";
|
|
2
3
|
export { LintMessage, MessageSeverity, __ΩLintMessage, __ΩMessageSeverity, formatMessage };
|
package/dist/helpers/index.mjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/index.cjs
CHANGED
|
@@ -1,15 +1,181 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
const
|
|
3
|
-
require('./helpers
|
|
2
|
+
const require_format_message = require('./format-message-Bt4W9wqe.cjs');
|
|
3
|
+
require('./helpers-LF26RHol.cjs');
|
|
4
|
+
require('./plugin-pBKbb5K9.cjs');
|
|
5
|
+
require('./types-o3zWarRp.cjs');
|
|
4
6
|
let __stryke_fs_exists = require("@stryke/fs/exists");
|
|
5
7
|
let __stryke_fs_get_parent_path = require("@stryke/fs/get-parent-path");
|
|
6
8
|
let __stryke_fs_package_fns = require("@stryke/fs/package-fns");
|
|
7
9
|
let __stryke_fs_read_file = require("@stryke/fs/read-file");
|
|
8
10
|
let __stryke_fs_semver_fns = require("@stryke/fs/semver-fns");
|
|
9
11
|
let __stryke_path_find = require("@stryke/path/find");
|
|
10
|
-
let __stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
|
|
11
12
|
let defu = require("defu");
|
|
12
13
|
|
|
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
|
|
13
179
|
//#region src/index.ts
|
|
14
180
|
/**
|
|
15
181
|
* A Powerlines plugin to lint a project's source code with ESLint.
|
|
@@ -46,7 +212,7 @@ function plugin(options = {}) {
|
|
|
46
212
|
}) } };
|
|
47
213
|
},
|
|
48
214
|
async configResolved() {
|
|
49
|
-
if (!
|
|
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");
|
|
50
216
|
else if (this.config.lint.eslint.configFile && (0, __stryke_fs_exists.existsSync)(this.config.lint.eslint.configFile)) {
|
|
51
217
|
const content = await (0, __stryke_fs_read_file.readFile)(this.config.lint.eslint.configFile);
|
|
52
218
|
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`);
|
|
@@ -92,7 +258,7 @@ function plugin(options = {}) {
|
|
|
92
258
|
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 });
|
|
93
259
|
if (this.config.lint.eslint.fix) await ESLint.outputFixes(results);
|
|
94
260
|
if (this.config.lint.eslint.reportErrorsOnly) results = ESLint.getErrorResults(results);
|
|
95
|
-
const output = results.filter(({ messages }) => messages?.length).map(({ messages, filePath }) =>
|
|
261
|
+
const output = results.filter(({ messages }) => messages?.length).map(({ messages, filePath }) => require_format_message.formatMessage(this.config.projectRoot, messages, filePath)).join("\n");
|
|
96
262
|
if (this.config.lint.eslint.outputFile) await this.fs.write(this.config.lint.eslint.outputFile, output);
|
|
97
263
|
else this.info(output);
|
|
98
264
|
}
|
|
@@ -101,7 +267,7 @@ function plugin(options = {}) {
|
|
|
101
267
|
var src_default = plugin;
|
|
102
268
|
|
|
103
269
|
//#endregion
|
|
104
|
-
exports.MessageSeverity =
|
|
270
|
+
exports.MessageSeverity = require_format_message.MessageSeverity;
|
|
105
271
|
exports.default = src_default;
|
|
106
|
-
exports.formatMessage =
|
|
272
|
+
exports.formatMessage = require_format_message.formatMessage;
|
|
107
273
|
exports.plugin = plugin;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
1
|
+
import { a as formatMessage, i as __ΩMessageSeverity, n as MessageSeverity, r as __ΩLintMessage, t as LintMessage } from "./format-message-B0zrT_tN.cjs";
|
|
2
|
+
import "./index-DLoAMD9J.cjs";
|
|
3
|
+
import { a as __ΩESLintPluginContext, c as __ΩESLintPluginUserConfig, i as ESLintPluginUserConfig, n as ESLintPluginOptions, o as __ΩESLintPluginOptions, r as ESLintPluginResolvedConfig, s as __ΩESLintPluginResolvedConfig, t as ESLintPluginContext } from "./plugin-0NJpq6om.cjs";
|
|
4
|
+
import "./index-D4ELpJXS.cjs";
|
|
4
5
|
import { Plugin } from "powerlines/types/plugin";
|
|
5
6
|
|
|
6
7
|
//#region src/index.d.ts
|
|
7
|
-
|
|
8
8
|
/**
|
|
9
9
|
* A Powerlines plugin to lint a project's source code with ESLint.
|
|
10
10
|
*/
|
|
11
11
|
declare function plugin(options?: ESLintPluginOptions): Plugin<ESLintPluginContext>;
|
|
12
12
|
//#endregion
|
|
13
|
-
export { ESLintPluginContext, ESLintPluginOptions, ESLintPluginResolvedConfig, ESLintPluginUserConfig, LintMessage, MessageSeverity, __ΩESLintPluginContext, __ΩESLintPluginOptions, __ΩESLintPluginResolvedConfig, __ΩESLintPluginUserConfig, __ΩLintMessage, __ΩMessageSeverity, plugin as default, plugin, formatMessage };
|
|
13
|
+
export { ESLintPluginContext, ESLintPluginOptions, ESLintPluginResolvedConfig, ESLintPluginUserConfig, LintMessage, MessageSeverity, __ΩESLintPluginContext, __ΩESLintPluginOptions, __ΩESLintPluginResolvedConfig, __ΩESLintPluginUserConfig, __ΩLintMessage, __ΩMessageSeverity, plugin as default, plugin, formatMessage };
|
|
14
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;AAsCgB,iBAAA,MAAA,CAAM,OAAA,CAAA,EACX,mBADW,CAAA,EAEnB,MAFmB,CAEZ,mBAFY,CAAA"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
1
|
+
import { a as formatMessage, i as __ΩMessageSeverity, n as MessageSeverity, r as __ΩLintMessage, t as LintMessage } from "./format-message-Ck01aLfz.mjs";
|
|
2
|
+
import "./index-D-CYNcT9.mjs";
|
|
3
|
+
import { a as __ΩESLintPluginContext, c as __ΩESLintPluginUserConfig, i as ESLintPluginUserConfig, n as ESLintPluginOptions, o as __ΩESLintPluginOptions, r as ESLintPluginResolvedConfig, s as __ΩESLintPluginResolvedConfig, t as ESLintPluginContext } from "./plugin-CaqHREhr.mjs";
|
|
4
|
+
import "./index-9iG2qHLe.mjs";
|
|
4
5
|
import { Plugin } from "powerlines/types/plugin";
|
|
5
6
|
|
|
6
7
|
//#region src/index.d.ts
|
|
7
|
-
|
|
8
8
|
/**
|
|
9
9
|
* A Powerlines plugin to lint a project's source code with ESLint.
|
|
10
10
|
*/
|
|
11
11
|
declare function plugin(options?: ESLintPluginOptions): Plugin<ESLintPluginContext>;
|
|
12
12
|
//#endregion
|
|
13
|
-
export { ESLintPluginContext, ESLintPluginOptions, ESLintPluginResolvedConfig, ESLintPluginUserConfig, LintMessage, MessageSeverity, __ΩESLintPluginContext, __ΩESLintPluginOptions, __ΩESLintPluginResolvedConfig, __ΩESLintPluginUserConfig, __ΩLintMessage, __ΩMessageSeverity, plugin as default, plugin, formatMessage };
|
|
13
|
+
export { ESLintPluginContext, ESLintPluginOptions, ESLintPluginResolvedConfig, ESLintPluginUserConfig, LintMessage, MessageSeverity, __ΩESLintPluginContext, __ΩESLintPluginOptions, __ΩESLintPluginResolvedConfig, __ΩESLintPluginUserConfig, __ΩLintMessage, __ΩMessageSeverity, plugin as default, plugin, formatMessage };
|
|
14
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;AAsCgB,iBAAA,MAAA,CAAM,OAAA,CAAA,EACX,mBADW,CAAA,EAEnB,MAFmB,CAEZ,mBAFY,CAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,14 +1,180 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./helpers
|
|
1
|
+
import { n as formatMessage, t as MessageSeverity } from "./format-message-CKuUKX7C.mjs";
|
|
2
|
+
import "./helpers-B15z10jN.mjs";
|
|
3
|
+
import "./plugin-ifZVa20V.mjs";
|
|
4
|
+
import "./types-U3zd8PTP.mjs";
|
|
3
5
|
import { existsSync } from "@stryke/fs/exists";
|
|
4
6
|
import { getParentPath } from "@stryke/fs/get-parent-path";
|
|
5
7
|
import { isPackageExists } from "@stryke/fs/package-fns";
|
|
6
8
|
import { readFile } from "@stryke/fs/read-file";
|
|
7
9
|
import { parseVersion } from "@stryke/fs/semver-fns";
|
|
8
10
|
import { findFileName } from "@stryke/path/find";
|
|
9
|
-
import { isSetObject } from "@stryke/type-checks/is-set-object";
|
|
10
11
|
import { defu } from "defu";
|
|
11
12
|
|
|
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
|
|
12
178
|
//#region src/index.ts
|
|
13
179
|
/**
|
|
14
180
|
* A Powerlines plugin to lint a project's source code with ESLint.
|
|
@@ -100,4 +266,5 @@ function plugin(options = {}) {
|
|
|
100
266
|
var src_default = plugin;
|
|
101
267
|
|
|
102
268
|
//#endregion
|
|
103
|
-
export { MessageSeverity, src_default as default, formatMessage, plugin };
|
|
269
|
+
export { MessageSeverity, src_default as default, formatMessage, plugin };
|
|
270
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["ESLint!: typeof FlatESLint | typeof LegacyESLint","options: any","options"],"sources":["../../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/get-object-tag.mjs","../../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-plain-object.mjs","../../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-object.mjs","../../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-null.mjs","../../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-undefined.mjs","../../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-empty.mjs","../../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-set.mjs","../../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-non-null-object.mjs","../../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-set-object.mjs","../src/index.ts"],"sourcesContent":["//#region src/get-object-tag.ts\n/**\n* Gets the `toStringTag` of `obj`.\n*\n* @param value - The obj to query.\n* @returns Returns the `toStringTag`.\n*/\nconst getObjectTag = (value) => {\n\tif (value == null) return value === void 0 ? \"[object Undefined]\" : \"[object Null]\";\n\treturn Object.prototype.toString.call(value);\n};\n\n//#endregion\nexport { getObjectTag };\n//# sourceMappingURL=get-object-tag.mjs.map","import { getObjectTag } from \"./get-object-tag.mjs\";\n\n//#region src/is-plain-object.ts\n/**\n* Checks if `value` is object-like. A value is object-like if it's not `null`\n* and has a `typeof` result of \"object\".\n*\n* @example\n* ```typescript\n* isObjectLike({})\n* // => true\n*\n* isObjectLike([1, 2, 3])\n* // => true\n*\n* isObjectLike(Function)\n* // => false\n*\n* isObjectLike(null)\n* // => false\n* ```\n*\n* @param value - The value to check.\n* @returns Returns `true` if `value` is object-like, else `false`.\n*/\nconst isObjectLike = (obj) => {\n\treturn typeof obj === \"object\" && obj !== null;\n};\n/**\n* Checks if `obj` is a plain object, that is, an object created by the `Object` constructor or one with a `[[Prototype]]` of `null`.\n*\n* @example\n* ```typescript\n* function Foo() {\n* this.a = 1\n* }\n*\n* isPlainObject(new Foo)\n* // => false\n*\n* isPlainObject([1, 2, 3])\n* // => false\n*\n* isPlainObject({ 'x': 0, 'y': 0 })\n* // => true\n*\n* isPlainObject(Object.create(null))\n* // => true\n* ```\n*\n* @param obj - The value to check.\n* @returns Returns `true` if `obj` is a plain object, else `false`.\n*/\nconst isPlainObject = (obj) => {\n\tif (!isObjectLike(obj) || getObjectTag(obj) !== \"[object Object]\") return false;\n\tif (Object.getPrototypeOf(obj) === null) return true;\n\tlet proto = obj;\n\twhile (Object.getPrototypeOf(proto) !== null) proto = Object.getPrototypeOf(proto);\n\treturn Object.getPrototypeOf(obj) === proto;\n};\n\n//#endregion\nexport { isObjectLike, isPlainObject };\n//# sourceMappingURL=is-plain-object.mjs.map","import { isPlainObject } from \"./is-plain-object.mjs\";\n\n//#region src/is-object.ts\nconst isClassRegex = /^class\\s|^function\\s+[A-Z]/;\nconst isConventionalClassRegex = /^function\\s+[A-Z]/;\nconst isNativeClassRegex = /^class\\s/;\n/** Is ES6+ class */\nfunction isNativeClass(value) {\n\treturn typeof value === \"function\" && isNativeClassRegex.test(value.toString());\n}\n/**\n* Check if the provided value's type is a conventional class\n*\n* @remarks\n* Is Conventional Class\n* Looks for function with capital first letter MyClass\n* First letter is the 9th character\n* If changed, isClass must also be updated\n*\n* @param value - The value to type check\n* @returns An indicator specifying if the value provided is a conventional class\n*/\nfunction isConventionalClass(value) {\n\treturn typeof value === \"function\" && isConventionalClassRegex.test(value.toString());\n}\nfunction isClass(value) {\n\treturn typeof value === \"function\" && isClassRegex.test(value.toString());\n}\n/**\n* Check if the provided value's type is `Object`\n*\n* @param value - The value to type check\n* @returns An indicator specifying if the value provided is of type `Object`\n*/\nconst isObject = (value) => {\n\ttry {\n\t\treturn typeof value === \"object\" || Boolean(value) && value?.constructor === Object || isPlainObject(value);\n\t} catch {\n\t\treturn false;\n\t}\n};\n\n//#endregion\nexport { isClass, isConventionalClass, isNativeClass, isObject };\n//# sourceMappingURL=is-object.mjs.map","//#region src/is-null.ts\nconst isNull = (value) => {\n\ttry {\n\t\treturn value === null;\n\t} catch {\n\t\treturn false;\n\t}\n};\n\n//#endregion\nexport { isNull };\n//# sourceMappingURL=is-null.mjs.map","//#region src/is-undefined.ts\nconst isUndefined = (value) => {\n\treturn value === void 0;\n};\n\n//#endregion\nexport { isUndefined };\n//# sourceMappingURL=is-undefined.mjs.map","import { isDate } from \"./is-date.mjs\";\nimport { isFunction } from \"./is-function.mjs\";\nimport { isNull } from \"./is-null.mjs\";\nimport { isNumber } from \"./is-number.mjs\";\nimport { isSymbol } from \"./is-symbol.mjs\";\nimport { isUndefined } from \"./is-undefined.mjs\";\n\n//#region src/is-empty.ts\n/**\n* Check if the provided value's type is `null` or `undefined`\n*\n* @param value - The value to type check\n* @returns An indicator specifying if the value provided is of type `null` or `undefined`\n*/\nconst isEmpty = (value) => {\n\ttry {\n\t\treturn isUndefined(value) || isNull(value);\n\t} catch {\n\t\treturn false;\n\t}\n};\nconst isEmptyAnything = (value) => {\n\tif (value === true || value === false) return true;\n\tif (value === null || value === void 0) return true;\n\tif (isNumber(value)) return value === 0;\n\tif (isDate(value)) return Number.isNaN(value.getTime());\n\tif (isFunction(value)) return false;\n\tif (isSymbol(value)) return false;\n\tconst { length } = value;\n\tif (isNumber(length)) return length === 0;\n\tconst { size } = value;\n\tif (isNumber(size)) return size === 0;\n\treturn Object.keys(value).length === 0;\n};\n\n//#endregion\nexport { isEmpty, isEmptyAnything };\n//# sourceMappingURL=is-empty.mjs.map","import { isEmpty } from \"./is-empty.mjs\";\n\n//#region src/is-set.ts\n/**\n* The inverse of the `isEmpty` function\n*\n* @param value - The value to type check\n* @returns An indicator specifying if the value provided is **NOT** of type `null` or `undefined`\n*/\nconst isSet = (value) => {\n\ttry {\n\t\treturn !isEmpty(value);\n\t} catch {\n\t\treturn false;\n\t}\n};\n\n//#endregion\nexport { isSet };\n//# sourceMappingURL=is-set.mjs.map","import { isObject } from \"./is-object.mjs\";\nimport { isSet } from \"./is-set.mjs\";\n\n//#region src/is-non-null-object.ts\n/**\n* Check if the provided value's type is `Object` and is not `null` or `undefined`\n*\n* @param value - The value to type check\n* @returns An indicator specifying if the value provided is of type `Object` and is not `null` or `undefined`\n*/\nconst isNonNullObject = (value) => {\n\treturn isSet(value) && isObject(value);\n};\n\n//#endregion\nexport { isNonNullObject };\n//# sourceMappingURL=is-non-null-object.mjs.map","import { isNonNullObject } from \"./is-non-null-object.mjs\";\n\n//#region src/is-set-object.ts\n/**\n* Check if the provided value's type is an object with some fields set\n*\n* @param value - The value to type check\n* @returns An indicator specifying if the value provided is an object with some fields se\n*/\nconst isSetObject = (value) => {\n\ttry {\n\t\treturn isNonNullObject(value) && Object.keys(value).length > 0;\n\t} catch {\n\t\treturn false;\n\t}\n};\n\n//#endregion\nexport { isSetObject };\n//# sourceMappingURL=is-set-object.mjs.map","/* -------------------------------------------------------------------\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 { existsSync } from \"@stryke/fs/exists\";\nimport { getParentPath } from \"@stryke/fs/get-parent-path\";\nimport { isPackageExists } from \"@stryke/fs/package-fns\";\nimport { readFile } from \"@stryke/fs/read-file\";\nimport { parseVersion } from \"@stryke/fs/semver-fns\";\nimport { findFileName } from \"@stryke/path/find\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { defu } from \"defu\";\nimport type { ESLint as FlatESLint } from \"eslint\";\nimport type { LegacyESLint } from \"eslint/use-at-your-own-risk\";\nimport { Plugin } from \"powerlines/types/plugin\";\nimport { formatMessage } from \"./helpers/format-message\";\nimport { ESLintPluginContext, ESLintPluginOptions } from \"./types/plugin\";\n\nexport * from \"./helpers\";\nexport * from \"./types\";\n\n/**\n * A Powerlines plugin to lint a project's source code with ESLint.\n */\nexport function plugin(\n options: ESLintPluginOptions = {}\n): Plugin<ESLintPluginContext> {\n return {\n name: \"eslint\",\n async config() {\n this.debug(\n \"Providing default configuration for the Powerlines `eslint` build plugin.\"\n );\n\n const configFile = getParentPath(\n [\n \"eslint.config.js\",\n \"eslint.config.mjs\",\n \"eslint.config.cjs\",\n \"eslint.config.ts\",\n \"eslint.config.mts\",\n \"eslint.config.cts\",\n \".eslintrc.js\",\n \".eslintrc.cjs\",\n \".eslintrc.yaml\",\n \".eslintrc.yml\",\n \".eslintrc.json\",\n \".eslintrc\"\n ],\n this.config.projectRoot,\n {\n ignoreCase: true,\n skipCwd: false,\n includeNameInResults: true\n }\n );\n\n return {\n lint: {\n eslint: defu(options, {\n configFile,\n reportErrorsOnly: false,\n maxWarnings: 5,\n fix: true,\n outputFile: null,\n type: \"recommended\"\n })\n }\n };\n },\n async configResolved() {\n if (\n !isSetObject(this.packageJson.eslintConfig) &&\n (!this.config.lint.eslint.configFile ||\n !existsSync(this.config.lint.eslint.configFile))\n ) {\n throw new Error(\"No ESLint configuration file could be found\");\n } else if (\n this.config.lint.eslint.configFile &&\n existsSync(this.config.lint.eslint.configFile)\n ) {\n const content = await readFile(this.config.lint.eslint.configFile);\n if (\n content?.trim().replace(/\\s/g, \"\") ||\n content?.trim().replace(/\\s/g, \"\") === \"---\" ||\n content?.trim().replace(/\\s/g, \"\") === \"{}\" ||\n content?.trim().replace(/\\s/g, \"\") === \"module.exports={}\"\n ) {\n throw new Error(\n `The ESLint configuration file at \"${this.config.lint.eslint.configFile}\" is empty`\n );\n }\n }\n\n const isInstalled = isPackageExists(\"eslint\", {\n paths: [this.workspaceConfig.workspaceRoot, this.config.projectRoot]\n });\n if (!isInstalled) {\n throw new Error(\n `ESLint must be installed to use the Powerlines ESLint plugin. Please run: npm install --save-dev eslint`\n );\n }\n\n // if (generateReason) {\n // this.log(\n // LogLevelLabel.WARN,\n // `${generateReason}. Generating a default configuration at the project root.`\n // );\n\n // this.devDependencies[\"eslint-config-powerlines\"] = \"*\";\n // this.config.lint.eslint.configFile = joinPaths(\n // this.config.projectRoot,\n // \"eslint.config.js\"\n // );\n\n // await writeFile(\n // this.config.lint.eslint.configFile,\n // `import { defineConfig } from \"eslint-config-powerlines\";\n\n // Error.stackTraceLimit = Number.POSITIVE_INFINITY;\n\n // /** @type {import('eslint').Linter.Config[]} */\n // export default defineConfig({${\n // this.config.name\n // ? `\n // name: \"${this.config.name}\", `\n // : \"\"\n // }\n // powerlines: ${this.config.lint.eslint.type}\n // });\n\n // `\n // );\n // }\n\n const module = await this.resolver.import<typeof import(\"eslint\")>(\n this.resolver.esmResolve(\"eslint\")\n );\n\n const useFlatConfig = this.config.lint.eslint.configFile\n ? findFileName(this.config.lint.eslint.configFile).startsWith(\n \"eslint.config.\"\n )\n : true;\n\n let ESLint!: typeof FlatESLint | typeof LegacyESLint;\n // loadESLint is >= 8.57.0\n // PR https://github.com/eslint/eslint/pull/18098\n // Release https://github.com/eslint/eslint/releases/tag/v8.57.0\n if (\"loadESLint\" in module) {\n // By default, configType is `flat`. If `useFlatConfig` is false, the return value is `LegacyESLint`.\n // https://github.com/eslint/eslint/blob/1def4cdfab1f067c5089df8b36242cdf912b0eb6/lib/types/index.d.ts#L1609-L1613\n ESLint = await module.loadESLint({\n useFlatConfig\n });\n }\n\n const eslintVersion = parseVersion(ESLint?.version);\n if (!eslintVersion || eslintVersion.compare(\"8.57.0\") < 0) {\n throw new Error(\n `Error - Your project has an older version of ESLint installed${\n eslintVersion\n ? ` (${eslintVersion.major}.${eslintVersion.minor}.${eslintVersion.patch})`\n : \"\"\n }. Please upgrade to ESLint version 8.57.0 or above`\n );\n }\n\n const options: any = {\n useEslintrc: !useFlatConfig,\n baseConfig: {},\n errorOnUnmatchedPattern: false,\n extensions: [\".js\", \".jsx\", \".ts\", \".tsx\"],\n cache: true\n };\n\n if (eslintVersion?.compare(\"9.0.0\") && useFlatConfig) {\n for (const option of [\n \"useEslintrc\",\n \"extensions\",\n \"ignorePath\",\n \"reportUnusedDisableDirectives\",\n \"resolvePluginsRelativeTo\",\n \"rulePaths\",\n \"inlineConfig\",\n \"maxWarnings\"\n ]) {\n if (option in options) {\n delete options[option];\n }\n }\n }\n\n this.eslint = new ESLint(options);\n },\n async lint() {\n this.debug(\"Linting project files with ESLint.\");\n\n let results = await this.eslint.lintFiles(\n this.tsconfig.fileNames.filter(\n fileName =>\n !fileName.includes(this.artifactsPath) &&\n !fileName.includes(\"node_modules\")\n )\n );\n\n const module = await this.resolver.import<typeof import(\"eslint\")>(\n this.resolver.esmResolve(\"eslint\")\n );\n\n let ESLint!: typeof FlatESLint | typeof LegacyESLint;\n // loadESLint is >= 8.57.0\n // PR https://github.com/eslint/eslint/pull/18098\n // Release https://github.com/eslint/eslint/releases/tag/v8.57.0\n if (\"loadESLint\" in module) {\n // By default, configType is `flat`. If `useFlatConfig` is false, the return value is `LegacyESLint`.\n // https://github.com/eslint/eslint/blob/1def4cdfab1f067c5089df8b36242cdf912b0eb6/lib/types/index.d.ts#L1609-L1613\n ESLint = await module.loadESLint({\n useFlatConfig: this.config.lint.eslint.configFile\n ? findFileName(this.config.lint.eslint.configFile).startsWith(\n \"eslint.config.\"\n )\n : true\n });\n }\n\n if (this.config.lint.eslint.fix) {\n await ESLint.outputFixes(results);\n }\n\n if (this.config.lint.eslint.reportErrorsOnly) {\n results = ESLint.getErrorResults(results);\n }\n\n const resultsWithMessages = results.filter(\n ({ messages }) => messages?.length\n );\n\n const output = resultsWithMessages\n .map(({ messages, filePath }) =>\n formatMessage(this.config.projectRoot, messages, filePath)\n )\n .join(\"\\n\");\n\n if (this.config.lint.eslint.outputFile) {\n await this.fs.write(this.config.lint.eslint.outputFile, output);\n } else {\n this.info(output);\n }\n }\n };\n}\n\nexport default plugin;\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8],"mappings":"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"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ESLint } from "eslint";
|
|
2
|
+
import { LegacyESLint } from "eslint/use-at-your-own-risk";
|
|
3
|
+
import { UserConfig } from "powerlines/types/config";
|
|
4
|
+
import { PluginContext } from "powerlines/types/context";
|
|
5
|
+
import { ResolvedConfig } from "powerlines/types/resolved";
|
|
6
|
+
|
|
7
|
+
//#region src/types/plugin.d.ts
|
|
8
|
+
interface ESLintPluginOptions {
|
|
9
|
+
/**
|
|
10
|
+
* The path to the ESLint configuration file.
|
|
11
|
+
*/
|
|
12
|
+
configFile?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Whether to report errors only
|
|
15
|
+
*/
|
|
16
|
+
reportErrorsOnly?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The maximum number of warnings to allow before failing the process
|
|
19
|
+
*/
|
|
20
|
+
maxWarnings?: number;
|
|
21
|
+
/**
|
|
22
|
+
* The output file to write the results to.
|
|
23
|
+
*/
|
|
24
|
+
outputFile?: string | null;
|
|
25
|
+
/**
|
|
26
|
+
* Whether to automatically fix problems
|
|
27
|
+
*
|
|
28
|
+
* @defaultValue true
|
|
29
|
+
*/
|
|
30
|
+
fix?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* The type of ESLint configuration to use.
|
|
33
|
+
*/
|
|
34
|
+
type?: "base" | "recommended" | "strict";
|
|
35
|
+
/**
|
|
36
|
+
* Options to be passed to the ESLint generator.
|
|
37
|
+
*
|
|
38
|
+
* @remarks
|
|
39
|
+
* These options will be override any other values passed to the ESLint generator.
|
|
40
|
+
*/
|
|
41
|
+
override?: Partial<ESLint.Options>;
|
|
42
|
+
}
|
|
43
|
+
interface ESLintPluginUserConfig extends UserConfig {
|
|
44
|
+
/**
|
|
45
|
+
* Options for the ESLint plugin.
|
|
46
|
+
*/
|
|
47
|
+
lint?: {
|
|
48
|
+
eslint?: ESLintPluginOptions;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
interface ESLintPluginResolvedConfig extends ResolvedConfig {
|
|
52
|
+
/**
|
|
53
|
+
* Options for the ESLint plugin.
|
|
54
|
+
*/
|
|
55
|
+
lint: {
|
|
56
|
+
eslint: ESLintPluginOptions;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
type ESLintPluginContext<TResolvedConfig extends ESLintPluginResolvedConfig = ESLintPluginResolvedConfig> = PluginContext<TResolvedConfig> & {
|
|
60
|
+
/**
|
|
61
|
+
* The initialized ESLint application.
|
|
62
|
+
*/
|
|
63
|
+
eslint: ESLint | LegacyESLint;
|
|
64
|
+
};
|
|
65
|
+
declare type __ΩESLintPluginOptions = any[];
|
|
66
|
+
declare type __ΩESLintPluginUserConfig = any[];
|
|
67
|
+
declare type __ΩESLintPluginResolvedConfig = any[];
|
|
68
|
+
declare type __ΩESLintPluginContext = any[];
|
|
69
|
+
//#endregion
|
|
70
|
+
export { __ΩESLintPluginContext as a, __ΩESLintPluginUserConfig as c, ESLintPluginUserConfig as i, ESLintPluginOptions as n, __ΩESLintPluginOptions as o, ESLintPluginResolvedConfig as r, __ΩESLintPluginResolvedConfig as s, ESLintPluginContext as t };
|
|
71
|
+
//# sourceMappingURL=plugin-0NJpq6om.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-0NJpq6om.d.cts","names":[],"sources":["../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;;;UAyBiB,mBAAA;EAAA;AA0CjB;AASA;EASY,UAAA,CAAA,EAAA,MAAA;EAER;;;EACA,gBAAA,CAAA,EAAA,OAAA;EAIM;;;;;;;;;;;;;;;;;;;;;;;;aA5BG,QAAQ,MAAA,CAAO;;UAGX,sBAAA,SAA+B;;;;;aAKnC;;;UAII,0BAAA,SAAmC;;;;;YAKxC;;;KAIA,4CAER,6BAA6B,8BAC7B,cAAc;;;;UAIR,SAAa"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ESLint } from "eslint";
|
|
2
|
+
import { LegacyESLint } from "eslint/use-at-your-own-risk";
|
|
3
|
+
import { UserConfig } from "powerlines/types/config";
|
|
4
|
+
import { PluginContext } from "powerlines/types/context";
|
|
5
|
+
import { ResolvedConfig } from "powerlines/types/resolved";
|
|
6
|
+
|
|
7
|
+
//#region src/types/plugin.d.ts
|
|
8
|
+
interface ESLintPluginOptions {
|
|
9
|
+
/**
|
|
10
|
+
* The path to the ESLint configuration file.
|
|
11
|
+
*/
|
|
12
|
+
configFile?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Whether to report errors only
|
|
15
|
+
*/
|
|
16
|
+
reportErrorsOnly?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The maximum number of warnings to allow before failing the process
|
|
19
|
+
*/
|
|
20
|
+
maxWarnings?: number;
|
|
21
|
+
/**
|
|
22
|
+
* The output file to write the results to.
|
|
23
|
+
*/
|
|
24
|
+
outputFile?: string | null;
|
|
25
|
+
/**
|
|
26
|
+
* Whether to automatically fix problems
|
|
27
|
+
*
|
|
28
|
+
* @defaultValue true
|
|
29
|
+
*/
|
|
30
|
+
fix?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* The type of ESLint configuration to use.
|
|
33
|
+
*/
|
|
34
|
+
type?: "base" | "recommended" | "strict";
|
|
35
|
+
/**
|
|
36
|
+
* Options to be passed to the ESLint generator.
|
|
37
|
+
*
|
|
38
|
+
* @remarks
|
|
39
|
+
* These options will be override any other values passed to the ESLint generator.
|
|
40
|
+
*/
|
|
41
|
+
override?: Partial<ESLint.Options>;
|
|
42
|
+
}
|
|
43
|
+
interface ESLintPluginUserConfig extends UserConfig {
|
|
44
|
+
/**
|
|
45
|
+
* Options for the ESLint plugin.
|
|
46
|
+
*/
|
|
47
|
+
lint?: {
|
|
48
|
+
eslint?: ESLintPluginOptions;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
interface ESLintPluginResolvedConfig extends ResolvedConfig {
|
|
52
|
+
/**
|
|
53
|
+
* Options for the ESLint plugin.
|
|
54
|
+
*/
|
|
55
|
+
lint: {
|
|
56
|
+
eslint: ESLintPluginOptions;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
type ESLintPluginContext<TResolvedConfig extends ESLintPluginResolvedConfig = ESLintPluginResolvedConfig> = PluginContext<TResolvedConfig> & {
|
|
60
|
+
/**
|
|
61
|
+
* The initialized ESLint application.
|
|
62
|
+
*/
|
|
63
|
+
eslint: ESLint | LegacyESLint;
|
|
64
|
+
};
|
|
65
|
+
declare type __ΩESLintPluginOptions = any[];
|
|
66
|
+
declare type __ΩESLintPluginUserConfig = any[];
|
|
67
|
+
declare type __ΩESLintPluginResolvedConfig = any[];
|
|
68
|
+
declare type __ΩESLintPluginContext = any[];
|
|
69
|
+
//#endregion
|
|
70
|
+
export { __ΩESLintPluginContext as a, __ΩESLintPluginUserConfig as c, ESLintPluginUserConfig as i, ESLintPluginOptions as n, __ΩESLintPluginOptions as o, ESLintPluginResolvedConfig as r, __ΩESLintPluginResolvedConfig as s, ESLintPluginContext as t };
|
|
71
|
+
//# sourceMappingURL=plugin-CaqHREhr.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-CaqHREhr.d.mts","names":[],"sources":["../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;;;UAyBiB,mBAAA;EAAA;AA0CjB;AASA;EASY,UAAA,CAAA,EAAA,MAAA;EAER;;;EACA,gBAAA,CAAA,EAAA,OAAA;EAIM;;;;;;;;;;;;;;;;;;;;;;;;aA5BG,QAAQ,MAAA,CAAO;;UAGX,sBAAA,SAA+B;;;;;aAKnC;;;UAII,0BAAA,SAAmC;;;;;YAKxC;;;KAIA,4CAER,6BAA6B,8BAC7B,cAAc;;;;UAIR,SAAa"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
File without changes
|
package/dist/types/index.cjs
CHANGED
package/dist/types/index.d.cts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { ESLintPluginContext,
|
|
1
|
+
import { a as __ΩESLintPluginContext, c as __ΩESLintPluginUserConfig, i as ESLintPluginUserConfig, n as ESLintPluginOptions, o as __ΩESLintPluginOptions, r as ESLintPluginResolvedConfig, s as __ΩESLintPluginResolvedConfig, t as ESLintPluginContext } from "../plugin-0NJpq6om.cjs";
|
|
2
|
+
import "../index-D4ELpJXS.cjs";
|
|
2
3
|
export { ESLintPluginContext, ESLintPluginOptions, ESLintPluginResolvedConfig, ESLintPluginUserConfig, __ΩESLintPluginContext, __ΩESLintPluginOptions, __ΩESLintPluginResolvedConfig, __ΩESLintPluginUserConfig };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { ESLintPluginContext,
|
|
1
|
+
import { a as __ΩESLintPluginContext, c as __ΩESLintPluginUserConfig, i as ESLintPluginUserConfig, n as ESLintPluginOptions, o as __ΩESLintPluginOptions, r as ESLintPluginResolvedConfig, s as __ΩESLintPluginResolvedConfig, t as ESLintPluginContext } from "../plugin-CaqHREhr.mjs";
|
|
2
|
+
import "../index-9iG2qHLe.mjs";
|
|
2
3
|
export { ESLintPluginContext, ESLintPluginOptions, ESLintPluginResolvedConfig, ESLintPluginUserConfig, __ΩESLintPluginContext, __ΩESLintPluginOptions, __ΩESLintPluginResolvedConfig, __ΩESLintPluginUserConfig };
|
package/dist/types/index.mjs
CHANGED
package/dist/types/plugin.cjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('../plugin-pBKbb5K9.cjs');
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -1,70 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { LegacyESLint } from "eslint/use-at-your-own-risk";
|
|
3
|
-
import { UserConfig } from "powerlines/types/config";
|
|
4
|
-
import { PluginContext } from "powerlines/types/context";
|
|
5
|
-
import { ResolvedConfig } from "powerlines/types/resolved";
|
|
6
|
-
|
|
7
|
-
//#region src/types/plugin.d.ts
|
|
8
|
-
interface ESLintPluginOptions {
|
|
9
|
-
/**
|
|
10
|
-
* The path to the ESLint configuration file.
|
|
11
|
-
*/
|
|
12
|
-
configFile?: string;
|
|
13
|
-
/**
|
|
14
|
-
* Whether to report errors only
|
|
15
|
-
*/
|
|
16
|
-
reportErrorsOnly?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* The maximum number of warnings to allow before failing the process
|
|
19
|
-
*/
|
|
20
|
-
maxWarnings?: number;
|
|
21
|
-
/**
|
|
22
|
-
* The output file to write the results to.
|
|
23
|
-
*/
|
|
24
|
-
outputFile?: string | null;
|
|
25
|
-
/**
|
|
26
|
-
* Whether to automatically fix problems
|
|
27
|
-
*
|
|
28
|
-
* @defaultValue true
|
|
29
|
-
*/
|
|
30
|
-
fix?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* The type of ESLint configuration to use.
|
|
33
|
-
*/
|
|
34
|
-
type?: "base" | "recommended" | "strict";
|
|
35
|
-
/**
|
|
36
|
-
* Options to be passed to the ESLint generator.
|
|
37
|
-
*
|
|
38
|
-
* @remarks
|
|
39
|
-
* These options will be override any other values passed to the ESLint generator.
|
|
40
|
-
*/
|
|
41
|
-
override?: Partial<ESLint.Options>;
|
|
42
|
-
}
|
|
43
|
-
interface ESLintPluginUserConfig extends UserConfig {
|
|
44
|
-
/**
|
|
45
|
-
* Options for the ESLint plugin.
|
|
46
|
-
*/
|
|
47
|
-
lint?: {
|
|
48
|
-
eslint?: ESLintPluginOptions;
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
interface ESLintPluginResolvedConfig extends ResolvedConfig {
|
|
52
|
-
/**
|
|
53
|
-
* Options for the ESLint plugin.
|
|
54
|
-
*/
|
|
55
|
-
lint: {
|
|
56
|
-
eslint: ESLintPluginOptions;
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
type ESLintPluginContext<TResolvedConfig extends ESLintPluginResolvedConfig = ESLintPluginResolvedConfig> = PluginContext<TResolvedConfig> & {
|
|
60
|
-
/**
|
|
61
|
-
* The initialized ESLint application.
|
|
62
|
-
*/
|
|
63
|
-
eslint: ESLint | LegacyESLint;
|
|
64
|
-
};
|
|
65
|
-
declare type __ΩESLintPluginOptions = any[];
|
|
66
|
-
declare type __ΩESLintPluginUserConfig = any[];
|
|
67
|
-
declare type __ΩESLintPluginResolvedConfig = any[];
|
|
68
|
-
declare type __ΩESLintPluginContext = any[];
|
|
69
|
-
//#endregion
|
|
1
|
+
import { a as __ΩESLintPluginContext, c as __ΩESLintPluginUserConfig, i as ESLintPluginUserConfig, n as ESLintPluginOptions, o as __ΩESLintPluginOptions, r as ESLintPluginResolvedConfig, s as __ΩESLintPluginResolvedConfig, t as ESLintPluginContext } from "../plugin-0NJpq6om.cjs";
|
|
70
2
|
export { ESLintPluginContext, ESLintPluginOptions, ESLintPluginResolvedConfig, ESLintPluginUserConfig, __ΩESLintPluginContext, __ΩESLintPluginOptions, __ΩESLintPluginResolvedConfig, __ΩESLintPluginUserConfig };
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -1,70 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { LegacyESLint } from "eslint/use-at-your-own-risk";
|
|
3
|
-
import { UserConfig } from "powerlines/types/config";
|
|
4
|
-
import { PluginContext } from "powerlines/types/context";
|
|
5
|
-
import { ResolvedConfig } from "powerlines/types/resolved";
|
|
6
|
-
|
|
7
|
-
//#region src/types/plugin.d.ts
|
|
8
|
-
interface ESLintPluginOptions {
|
|
9
|
-
/**
|
|
10
|
-
* The path to the ESLint configuration file.
|
|
11
|
-
*/
|
|
12
|
-
configFile?: string;
|
|
13
|
-
/**
|
|
14
|
-
* Whether to report errors only
|
|
15
|
-
*/
|
|
16
|
-
reportErrorsOnly?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* The maximum number of warnings to allow before failing the process
|
|
19
|
-
*/
|
|
20
|
-
maxWarnings?: number;
|
|
21
|
-
/**
|
|
22
|
-
* The output file to write the results to.
|
|
23
|
-
*/
|
|
24
|
-
outputFile?: string | null;
|
|
25
|
-
/**
|
|
26
|
-
* Whether to automatically fix problems
|
|
27
|
-
*
|
|
28
|
-
* @defaultValue true
|
|
29
|
-
*/
|
|
30
|
-
fix?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* The type of ESLint configuration to use.
|
|
33
|
-
*/
|
|
34
|
-
type?: "base" | "recommended" | "strict";
|
|
35
|
-
/**
|
|
36
|
-
* Options to be passed to the ESLint generator.
|
|
37
|
-
*
|
|
38
|
-
* @remarks
|
|
39
|
-
* These options will be override any other values passed to the ESLint generator.
|
|
40
|
-
*/
|
|
41
|
-
override?: Partial<ESLint.Options>;
|
|
42
|
-
}
|
|
43
|
-
interface ESLintPluginUserConfig extends UserConfig {
|
|
44
|
-
/**
|
|
45
|
-
* Options for the ESLint plugin.
|
|
46
|
-
*/
|
|
47
|
-
lint?: {
|
|
48
|
-
eslint?: ESLintPluginOptions;
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
interface ESLintPluginResolvedConfig extends ResolvedConfig {
|
|
52
|
-
/**
|
|
53
|
-
* Options for the ESLint plugin.
|
|
54
|
-
*/
|
|
55
|
-
lint: {
|
|
56
|
-
eslint: ESLintPluginOptions;
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
type ESLintPluginContext<TResolvedConfig extends ESLintPluginResolvedConfig = ESLintPluginResolvedConfig> = PluginContext<TResolvedConfig> & {
|
|
60
|
-
/**
|
|
61
|
-
* The initialized ESLint application.
|
|
62
|
-
*/
|
|
63
|
-
eslint: ESLint | LegacyESLint;
|
|
64
|
-
};
|
|
65
|
-
declare type __ΩESLintPluginOptions = any[];
|
|
66
|
-
declare type __ΩESLintPluginUserConfig = any[];
|
|
67
|
-
declare type __ΩESLintPluginResolvedConfig = any[];
|
|
68
|
-
declare type __ΩESLintPluginContext = any[];
|
|
69
|
-
//#endregion
|
|
1
|
+
import { a as __ΩESLintPluginContext, c as __ΩESLintPluginUserConfig, i as ESLintPluginUserConfig, n as ESLintPluginOptions, o as __ΩESLintPluginOptions, r as ESLintPluginResolvedConfig, s as __ΩESLintPluginResolvedConfig, t as ESLintPluginContext } from "../plugin-CaqHREhr.mjs";
|
|
70
2
|
export { ESLintPluginContext, ESLintPluginOptions, ESLintPluginResolvedConfig, ESLintPluginUserConfig, __ΩESLintPluginContext, __ΩESLintPluginOptions, __ΩESLintPluginResolvedConfig, __ΩESLintPluginUserConfig };
|
package/dist/types/plugin.mjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-eslint",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.244",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing a Powerlines plugin for running ESLint on the codebase.",
|
|
6
6
|
"repository": {
|
|
@@ -119,12 +119,12 @@
|
|
|
119
119
|
"@stryke/path": "^0.26.3",
|
|
120
120
|
"defu": "^6.1.4",
|
|
121
121
|
"eslint": "^9.39.2",
|
|
122
|
-
"powerlines": "^0.38.
|
|
122
|
+
"powerlines": "^0.38.7"
|
|
123
123
|
},
|
|
124
124
|
"devDependencies": { "@types/node": "^24.10.9" },
|
|
125
125
|
"publishConfig": { "access": "public" },
|
|
126
126
|
"main": "./dist/index.cjs",
|
|
127
127
|
"module": "./dist/index.mjs",
|
|
128
128
|
"types": "./dist/index.d.cts",
|
|
129
|
-
"gitHead": "
|
|
129
|
+
"gitHead": "d389997536baee28d116675d7916d9bfa5596dce"
|
|
130
130
|
}
|