@powerlines/plugin-eslint 0.8.344 → 0.8.346
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -16
- package/dist/_virtual/_rolldown/runtime.mjs +3 -0
- package/dist/helpers/format-message.cjs +8 -7
- package/dist/helpers/format-message.d.cts +1 -1
- package/dist/helpers/format-message.d.cts.map +1 -1
- package/dist/helpers/format-message.d.mts +1 -1
- package/dist/helpers/format-message.d.mts.map +1 -1
- package/dist/helpers/format-message.mjs +4 -4
- package/dist/helpers/format-message.mjs.map +1 -1
- package/dist/helpers/index.cjs +1 -0
- package/dist/index.cjs +25 -26
- package/dist/index.d.cts +0 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +0 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +5 -6
- package/dist/index.mjs.map +1 -1
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts.map +1 -1
- package/package.json +21 -20
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.38/node_modules/@stryke/type-checks/dist/get-object-tag.cjs +0 -15
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.38/node_modules/@stryke/type-checks/dist/get-object-tag.mjs +0 -15
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.38/node_modules/@stryke/type-checks/dist/get-object-tag.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-empty.cjs +0 -20
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-empty.mjs +0 -21
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-empty.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-non-null-object.cjs +0 -16
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-non-null-object.mjs +0 -17
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-non-null-object.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-null.cjs +0 -12
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-null.mjs +0 -12
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-null.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-object.cjs +0 -19
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-object.mjs +0 -20
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-object.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-plain-object.cjs +0 -63
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-plain-object.mjs +0 -64
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-plain-object.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-set-object.cjs +0 -19
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-set-object.mjs +0 -20
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-set-object.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-set.cjs +0 -19
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-set.mjs +0 -20
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-set.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-undefined.cjs +0 -8
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-undefined.mjs +0 -8
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-undefined.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ This package is part of the <b>🔌 Powerlines</b> monorepo. Powerlines is the "
|
|
|
27
27
|
|
|
28
28
|
<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
29
29
|
|
|
30
|
-
[](https://stormsoftware.com/projects/powerlines) [](http://commitizen.github.io/cz-cli/)  
|
|
31
31
|
|
|
32
32
|
<!-- prettier-ignore-start -->
|
|
33
33
|
<!-- markdownlint-disable -->
|
|
@@ -58,21 +58,19 @@ A package containing a Powerlines plugin that integrates ESLint into the Powerli
|
|
|
58
58
|
|
|
59
59
|
## Table of Contents
|
|
60
60
|
|
|
61
|
-
- [
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
- [
|
|
65
|
-
- [
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
- [Contributing](#contributing)
|
|
75
|
-
- [Contributors](#contributors)
|
|
61
|
+
- [Installing](#installing)
|
|
62
|
+
- [Reduced Package Size](#reduced-package-size)
|
|
63
|
+
- [Development](#development)
|
|
64
|
+
- [Building](#building)
|
|
65
|
+
- [Running unit tests](#running-unit-tests)
|
|
66
|
+
- [Linting](#linting)
|
|
67
|
+
- [Storm Workspaces](#storm-workspaces)
|
|
68
|
+
- [Roadmap](#roadmap)
|
|
69
|
+
- [Support](#support)
|
|
70
|
+
- [License](#license)
|
|
71
|
+
- [Changelog](#changelog)
|
|
72
|
+
- [Contributing](#contributing)
|
|
73
|
+
- [Contributors](#contributors)
|
|
76
74
|
|
|
77
75
|
<!-- END doctoc -->
|
|
78
76
|
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
let
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
let _stryke_path_find = require("@stryke/path/find");
|
|
3
|
+
let _stryke_path_normalize = require("@stryke/path/normalize");
|
|
3
4
|
|
|
4
5
|
//#region src/helpers/format-message.ts
|
|
5
|
-
let MessageSeverity = /* @__PURE__ */ function(MessageSeverity
|
|
6
|
-
MessageSeverity
|
|
7
|
-
MessageSeverity
|
|
8
|
-
return MessageSeverity
|
|
6
|
+
let MessageSeverity = /* @__PURE__ */ function(MessageSeverity) {
|
|
7
|
+
MessageSeverity[MessageSeverity["Warning"] = 1] = "Warning";
|
|
8
|
+
MessageSeverity[MessageSeverity["Error"] = 2] = "Error";
|
|
9
|
+
return MessageSeverity;
|
|
9
10
|
}({});
|
|
10
11
|
function formatMessage(dir, messages, filePath) {
|
|
11
|
-
let fileName = (0,
|
|
12
|
+
let fileName = (0, _stryke_path_normalize.correctPath)((0, _stryke_path_find.relative)(dir, filePath));
|
|
12
13
|
if (!fileName.startsWith(".")) fileName = `./${fileName}`;
|
|
13
14
|
let output = `\n${fileName}`;
|
|
14
15
|
for (let i = 0; i < messages.length; i++) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-message.d.cts","names":[],"sources":["../../src/helpers/format-message.ts"],"
|
|
1
|
+
{"version":3,"file":"format-message.d.cts","names":[],"sources":["../../src/helpers/format-message.ts"],"mappings":";aAqBY,eAAA;EACV,OAAA;EACA,KAAA;AAAA;AAAA,UAGe,WAAA;EACf,MAAA;EACA,QAAA,EAAU,eAAA;EACV,OAAA;EACA,IAAA;EACA,MAAA;AAAA;AAAA,iBAGc,aAAA,CACd,GAAA,UACA,QAAA,EAAU,WAAA,IACV,QAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-message.d.mts","names":[],"sources":["../../src/helpers/format-message.ts"],"
|
|
1
|
+
{"version":3,"file":"format-message.d.mts","names":[],"sources":["../../src/helpers/format-message.ts"],"mappings":";aAqBY,eAAA;EACV,OAAA;EACA,KAAA;AAAA;AAAA,UAGe,WAAA;EACf,MAAA;EACA,QAAA,EAAU,eAAA;EACV,OAAA;EACA,IAAA;EACA,MAAA;AAAA;AAAA,iBAGc,aAAA,CACd,GAAA,UACA,QAAA,EAAU,WAAA,IACV,QAAA;AAAA"}
|
|
@@ -2,10 +2,10 @@ import { relative } from "@stryke/path/find";
|
|
|
2
2
|
import { correctPath } from "@stryke/path/normalize";
|
|
3
3
|
|
|
4
4
|
//#region src/helpers/format-message.ts
|
|
5
|
-
let MessageSeverity = /* @__PURE__ */ function(MessageSeverity
|
|
6
|
-
MessageSeverity
|
|
7
|
-
MessageSeverity
|
|
8
|
-
return MessageSeverity
|
|
5
|
+
let MessageSeverity = /* @__PURE__ */ function(MessageSeverity) {
|
|
6
|
+
MessageSeverity[MessageSeverity["Warning"] = 1] = "Warning";
|
|
7
|
+
MessageSeverity[MessageSeverity["Error"] = 2] = "Error";
|
|
8
|
+
return MessageSeverity;
|
|
9
9
|
}({});
|
|
10
10
|
function formatMessage(dir, messages, filePath) {
|
|
11
11
|
let fileName = correctPath(relative(dir, filePath));
|
|
@@ -1 +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,
|
|
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,kBAAL;AACL;AACA;;KACD;AAUD,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
package/dist/index.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
Object.
|
|
2
|
-
const require_is_set_object = require('./node_modules/.pnpm/@stryke_type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-set-object.cjs');
|
|
1
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
3
2
|
const require_helpers_format_message = require('./helpers/format-message.cjs');
|
|
4
3
|
require('./helpers/index.cjs');
|
|
5
|
-
let
|
|
6
|
-
let
|
|
7
|
-
let
|
|
8
|
-
let
|
|
9
|
-
let
|
|
10
|
-
let
|
|
4
|
+
let _stryke_fs_exists = require("@stryke/fs/exists");
|
|
5
|
+
let _stryke_fs_get_parent_path = require("@stryke/fs/get-parent-path");
|
|
6
|
+
let _stryke_fs_package_fns = require("@stryke/fs/package-fns");
|
|
7
|
+
let _stryke_fs_read_file = require("@stryke/fs/read-file");
|
|
8
|
+
let _stryke_fs_semver_fns = require("@stryke/fs/semver-fns");
|
|
9
|
+
let _stryke_path_find = require("@stryke/path/find");
|
|
10
|
+
let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
|
|
11
11
|
let defu = require("defu");
|
|
12
12
|
|
|
13
13
|
//#region src/index.ts
|
|
@@ -20,7 +20,7 @@ function plugin(options = {}) {
|
|
|
20
20
|
async config() {
|
|
21
21
|
this.debug("Providing default configuration for the Powerlines `eslint` build plugin.");
|
|
22
22
|
return { eslint: (0, defu.defu)(options, {
|
|
23
|
-
configFile: (0,
|
|
23
|
+
configFile: (0, _stryke_fs_get_parent_path.getParentPath)([
|
|
24
24
|
"eslint.config.js",
|
|
25
25
|
"eslint.config.mjs",
|
|
26
26
|
"eslint.config.cjs",
|
|
@@ -46,19 +46,19 @@ function plugin(options = {}) {
|
|
|
46
46
|
}) };
|
|
47
47
|
},
|
|
48
48
|
async configResolved() {
|
|
49
|
-
if (!
|
|
50
|
-
else if (this.config.lint.eslint.configFile && (0,
|
|
51
|
-
const content = await (0,
|
|
49
|
+
if (!(0, _stryke_type_checks_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");
|
|
50
|
+
else if (this.config.lint.eslint.configFile && (0, _stryke_fs_exists.existsSync)(this.config.lint.eslint.configFile)) {
|
|
51
|
+
const content = await (0, _stryke_fs_read_file.readFile)(this.config.lint.eslint.configFile);
|
|
52
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`);
|
|
53
53
|
}
|
|
54
|
-
if (!(0,
|
|
55
|
-
const module
|
|
56
|
-
const useFlatConfig = this.config.lint.eslint.configFile ? (0,
|
|
54
|
+
if (!(0, _stryke_fs_package_fns.isPackageExists)("eslint", { paths: [this.workspaceConfig.workspaceRoot, this.config.root] })) throw new Error(`ESLint must be installed to use the Powerlines ESLint plugin. Please run: npm install --save-dev eslint`);
|
|
55
|
+
const module = await this.resolver.import(this.resolver.esmResolve("eslint"));
|
|
56
|
+
const useFlatConfig = this.config.lint.eslint.configFile ? (0, _stryke_path_find.findFileName)(this.config.lint.eslint.configFile).startsWith("eslint.config.") : true;
|
|
57
57
|
let ESLint;
|
|
58
|
-
if ("loadESLint" in module
|
|
59
|
-
const eslintVersion = (0,
|
|
58
|
+
if ("loadESLint" in module) ESLint = await module.loadESLint({ useFlatConfig });
|
|
59
|
+
const eslintVersion = (0, _stryke_fs_semver_fns.parseVersion)(ESLint?.version);
|
|
60
60
|
if (!eslintVersion || eslintVersion.compare("8.57.0") < 0) throw new Error(`Error - Your project has an older version of ESLint installed${eslintVersion ? ` (${eslintVersion.major}.${eslintVersion.minor}.${eslintVersion.patch})` : ""}. Please upgrade to ESLint version 8.57.0 or above`);
|
|
61
|
-
const options
|
|
61
|
+
const options = {
|
|
62
62
|
useEslintrc: !useFlatConfig,
|
|
63
63
|
baseConfig: {},
|
|
64
64
|
errorOnUnmatchedPattern: false,
|
|
@@ -80,16 +80,16 @@ function plugin(options = {}) {
|
|
|
80
80
|
"rulePaths",
|
|
81
81
|
"inlineConfig",
|
|
82
82
|
"maxWarnings"
|
|
83
|
-
]) if (option in options
|
|
83
|
+
]) if (option in options) delete options[option];
|
|
84
84
|
}
|
|
85
|
-
this.eslint = new ESLint(options
|
|
85
|
+
this.eslint = new ESLint(options);
|
|
86
86
|
},
|
|
87
87
|
async lint() {
|
|
88
88
|
this.debug("Linting project files with ESLint.");
|
|
89
89
|
let results = await this.eslint.lintFiles(this.tsconfig.fileNames.filter((fileName) => !fileName.includes(this.artifactsPath) && !fileName.includes("node_modules")));
|
|
90
|
-
const module
|
|
90
|
+
const module = await this.resolver.import(this.resolver.esmResolve("eslint"));
|
|
91
91
|
let ESLint;
|
|
92
|
-
if ("loadESLint" in module
|
|
92
|
+
if ("loadESLint" in module) ESLint = await module.loadESLint({ useFlatConfig: this.config.lint.eslint.configFile ? (0, _stryke_path_find.findFileName)(this.config.lint.eslint.configFile).startsWith("eslint.config.") : true });
|
|
93
93
|
if (this.config.lint.eslint.fix) await ESLint.outputFixes(results);
|
|
94
94
|
if (this.config.lint.eslint.reportErrorsOnly) results = ESLint.getErrorResults(results);
|
|
95
95
|
const output = results.filter(({ messages }) => messages?.length).map(({ messages, filePath }) => require_helpers_format_message.formatMessage(this.config.root, messages, filePath)).join("\n");
|
|
@@ -98,10 +98,9 @@ function plugin(options = {}) {
|
|
|
98
98
|
}
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
|
-
var src_default = plugin;
|
|
102
101
|
|
|
103
102
|
//#endregion
|
|
104
103
|
exports.MessageSeverity = require_helpers_format_message.MessageSeverity;
|
|
105
|
-
exports.default =
|
|
106
|
-
exports.
|
|
107
|
-
exports.
|
|
104
|
+
exports.default = plugin;
|
|
105
|
+
exports.plugin = plugin;
|
|
106
|
+
exports.formatMessage = require_helpers_format_message.formatMessage;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { LintMessage, MessageSeverity, __ΩLintMessage, __ΩMessageSeverity, formatMessage } from "./helpers/format-message.cjs";
|
|
2
2
|
import { ESLintPluginContext, ESLintPluginOptions, ESLintPluginResolvedConfig, ESLintPluginUserConfig, __ΩESLintPluginContext, __ΩESLintPluginOptions, __ΩESLintPluginResolvedConfig, __ΩESLintPluginUserConfig } from "./types/plugin.cjs";
|
|
3
|
-
import "./types/index.cjs";
|
|
4
3
|
import { Plugin } from "powerlines";
|
|
5
4
|
|
|
6
5
|
//#region src/index.d.ts
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;YAwCY,MAAA;IACR,MAAA,GAAS,mBAAA;EAAA;AAAA;;;;iBAOG,MAAA,CACd,OAAA,GAAS,mBAAA,GACR,MAAA,CAAO,mBAAA"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { LintMessage, MessageSeverity, __ΩLintMessage, __ΩMessageSeverity, formatMessage } from "./helpers/format-message.mjs";
|
|
2
2
|
import { ESLintPluginContext, ESLintPluginOptions, ESLintPluginResolvedConfig, ESLintPluginUserConfig, __ΩESLintPluginContext, __ΩESLintPluginOptions, __ΩESLintPluginResolvedConfig, __ΩESLintPluginUserConfig } from "./types/plugin.mjs";
|
|
3
|
-
import "./types/index.mjs";
|
|
4
3
|
import { Plugin } from "powerlines";
|
|
5
4
|
|
|
6
5
|
//#region src/index.d.ts
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;YAwCY,MAAA;IACR,MAAA,GAAS,mBAAA;EAAA;AAAA;;;;iBAOG,MAAA,CACd,OAAA,GAAS,mBAAA,GACR,MAAA,CAAO,mBAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { isSetObject } from "./node_modules/.pnpm/@stryke_type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-set-object.mjs";
|
|
2
1
|
import { MessageSeverity, formatMessage } from "./helpers/format-message.mjs";
|
|
3
2
|
import "./helpers/index.mjs";
|
|
4
3
|
import { existsSync } from "@stryke/fs/exists";
|
|
@@ -7,6 +6,7 @@ import { isPackageExists } from "@stryke/fs/package-fns";
|
|
|
7
6
|
import { readFile } from "@stryke/fs/read-file";
|
|
8
7
|
import { parseVersion } from "@stryke/fs/semver-fns";
|
|
9
8
|
import { findFileName } from "@stryke/path/find";
|
|
9
|
+
import { isSetObject } from "@stryke/type-checks/is-set-object";
|
|
10
10
|
import { defu } from "defu";
|
|
11
11
|
|
|
12
12
|
//#region src/index.ts
|
|
@@ -57,7 +57,7 @@ function plugin(options = {}) {
|
|
|
57
57
|
if ("loadESLint" in module) ESLint = await module.loadESLint({ useFlatConfig });
|
|
58
58
|
const eslintVersion = parseVersion(ESLint?.version);
|
|
59
59
|
if (!eslintVersion || eslintVersion.compare("8.57.0") < 0) throw new Error(`Error - Your project has an older version of ESLint installed${eslintVersion ? ` (${eslintVersion.major}.${eslintVersion.minor}.${eslintVersion.patch})` : ""}. Please upgrade to ESLint version 8.57.0 or above`);
|
|
60
|
-
const options
|
|
60
|
+
const options = {
|
|
61
61
|
useEslintrc: !useFlatConfig,
|
|
62
62
|
baseConfig: {},
|
|
63
63
|
errorOnUnmatchedPattern: false,
|
|
@@ -79,9 +79,9 @@ function plugin(options = {}) {
|
|
|
79
79
|
"rulePaths",
|
|
80
80
|
"inlineConfig",
|
|
81
81
|
"maxWarnings"
|
|
82
|
-
]) if (option in options
|
|
82
|
+
]) if (option in options) delete options[option];
|
|
83
83
|
}
|
|
84
|
-
this.eslint = new ESLint(options
|
|
84
|
+
this.eslint = new ESLint(options);
|
|
85
85
|
},
|
|
86
86
|
async lint() {
|
|
87
87
|
this.debug("Linting project files with ESLint.");
|
|
@@ -97,8 +97,7 @@ function plugin(options = {}) {
|
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
|
-
var src_default = plugin;
|
|
101
100
|
|
|
102
101
|
//#endregion
|
|
103
|
-
export { MessageSeverity,
|
|
102
|
+
export { MessageSeverity, plugin as default, plugin, formatMessage };
|
|
104
103
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["ESLint!: typeof FlatESLint | typeof LegacyESLint","options: any","options"],"sources":["../src/index.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 { 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\";\nimport { formatMessage } from \"./helpers/format-message\";\nimport {\n ESLintPluginContext,\n ESLintPluginOptions,\n ESLintPluginResolvedConfig\n} from \"./types/plugin\";\n\nexport * from \"./helpers\";\nexport * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n eslint?: ESLintPluginOptions;\n }\n}\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.root,\n {\n ignoreCase: true,\n skipCwd: false,\n includeNameInResults: true\n }\n );\n\n return {\n eslint: defu(options, {\n configFile,\n reportErrorsOnly: false,\n maxWarnings: 5,\n fix: true,\n outputFile: null,\n type: \"recommended\"\n })\n } as Partial<ESLintPluginResolvedConfig>;\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.root]\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.root, 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"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.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 { 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\";\nimport { formatMessage } from \"./helpers/format-message\";\nimport {\n ESLintPluginContext,\n ESLintPluginOptions,\n ESLintPluginResolvedConfig\n} from \"./types/plugin\";\n\nexport * from \"./helpers\";\nexport * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n eslint?: ESLintPluginOptions;\n }\n}\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.root,\n {\n ignoreCase: true,\n skipCwd: false,\n includeNameInResults: true\n }\n );\n\n return {\n eslint: defu(options, {\n configFile,\n reportErrorsOnly: false,\n maxWarnings: 5,\n fix: true,\n outputFile: null,\n type: \"recommended\"\n })\n } as Partial<ESLintPluginResolvedConfig>;\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.root]\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.root, 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"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"
|
|
1
|
+
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;UAuBiB,mBAAA;EAAA;;;EAIf,UAAA;EAAA;;;EAKA,gBAAA;EAiBA;;;EAZA,WAAA;EAyBmB;;;EApBnB,UAAA;EAuBe;;;;;EAhBf,GAAA;EAqBE;;;EAhBF,IAAA;EAoBe;;;;;;EAZf,QAAA,GAAW,OAAA,CAAQ,MAAA,CAAO,OAAA;AAAA;AAAA,UAGX,sBAAA,SAA+B,UAAA;EAcjB;AAI/B;;EAdE,IAAA;IACE,MAAA,GAAS,mBAAA;EAAA;AAAA;AAAA,UAII,0BAAA,SAAmC,cAAA;EAgB1C;;;EAZR,IAAA;IACE,MAAA,EAAQ,mBAAA;EAAA;AAAA;AAAA,KAIA,mBAAA,yBACc,0BAAA,GACtB,0BAAA,IACA,aAAA,CAAc,eAAA;EAAA;;;EAIhB,MAAA,EAAQ,MAAA,GAAa,YAAA;AAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;UAuBiB,mBAAA;EAAA;;;EAIf,UAAA;EAAA;;;EAKA,gBAAA;EAiBA;;;EAZA,WAAA;EAyBmB;;;EApBnB,UAAA;EAuBe;;;;;EAhBf,GAAA;EAqBE;;;EAhBF,IAAA;EAoBe;;;;;;EAZf,QAAA,GAAW,OAAA,CAAQ,MAAA,CAAO,OAAA;AAAA;AAAA,UAGX,sBAAA,SAA+B,UAAA;EAcjB;AAI/B;;EAdE,IAAA;IACE,MAAA,GAAS,mBAAA;EAAA;AAAA;AAAA,UAII,0BAAA,SAAmC,cAAA;EAgB1C;;;EAZR,IAAA;IACE,MAAA,EAAQ,mBAAA;EAAA;AAAA;AAAA,KAIA,mBAAA,yBACc,0BAAA,GACtB,0BAAA,IACA,aAAA,CAAc,eAAA;EAAA;;;EAIhB,MAAA,EAAQ,MAAA,GAAa,YAAA;AAAA;AAAA"}
|
package/package.json
CHANGED
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-eslint",
|
|
3
|
-
"version": "0.8.
|
|
4
|
-
"
|
|
3
|
+
"version": "0.8.346",
|
|
4
|
+
"private": false,
|
|
5
5
|
"description": "A package containing a Powerlines plugin for running ESLint on the codebase.",
|
|
6
|
+
"keywords": ["eslint", "powerlines", "storm-software", "powerlines-plugin"],
|
|
7
|
+
"homepage": "https://stormsoftware.com",
|
|
8
|
+
"bugs": {
|
|
9
|
+
"url": "https://stormsoftware.com/support",
|
|
10
|
+
"email": "support@stormsoftware.com"
|
|
11
|
+
},
|
|
6
12
|
"repository": {
|
|
7
13
|
"type": "github",
|
|
8
14
|
"url": "https://github.com/storm-software/powerlines.git",
|
|
9
15
|
"directory": "packages/plugin-eslint"
|
|
10
16
|
},
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
"url": "https://
|
|
14
|
-
"email": "support@stormsoftware.com"
|
|
17
|
+
"funding": {
|
|
18
|
+
"type": "github",
|
|
19
|
+
"url": "https://github.com/sponsors/storm-software"
|
|
15
20
|
},
|
|
21
|
+
"license": "Apache-2.0",
|
|
16
22
|
"author": {
|
|
17
23
|
"name": "Storm Software",
|
|
18
24
|
"email": "contact@stormsoftware.com",
|
|
@@ -32,12 +38,7 @@
|
|
|
32
38
|
"url": "https://stormsoftware.com"
|
|
33
39
|
}
|
|
34
40
|
],
|
|
35
|
-
"
|
|
36
|
-
"type": "github",
|
|
37
|
-
"url": "https://github.com/sponsors/storm-software"
|
|
38
|
-
},
|
|
39
|
-
"license": "Apache-2.0",
|
|
40
|
-
"private": false,
|
|
41
|
+
"type": "module",
|
|
41
42
|
"exports": {
|
|
42
43
|
".": {
|
|
43
44
|
"require": {
|
|
@@ -53,7 +54,6 @@
|
|
|
53
54
|
"default": "./dist/index.mjs"
|
|
54
55
|
}
|
|
55
56
|
},
|
|
56
|
-
"./*": "./*",
|
|
57
57
|
"./helpers": {
|
|
58
58
|
"require": {
|
|
59
59
|
"types": "./dist/helpers/index.d.cts",
|
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
"default": "./dist/helpers/format-message.mjs"
|
|
83
83
|
}
|
|
84
84
|
},
|
|
85
|
+
"./package.json": "./package.json",
|
|
85
86
|
"./types": {
|
|
86
87
|
"require": {
|
|
87
88
|
"types": "./dist/types/index.d.cts",
|
|
@@ -111,20 +112,20 @@
|
|
|
111
112
|
}
|
|
112
113
|
}
|
|
113
114
|
},
|
|
115
|
+
"main": "./dist/index.cjs",
|
|
116
|
+
"module": "./dist/index.mjs",
|
|
117
|
+
"types": "./dist/index.d.cts",
|
|
114
118
|
"files": ["dist/**/*"],
|
|
115
|
-
"keywords": ["eslint", "powerlines", "storm-software", "powerlines-plugin"],
|
|
116
119
|
"dependencies": {
|
|
117
|
-
"@storm-software/config-tools": "
|
|
120
|
+
"@storm-software/config-tools": "1.189.28",
|
|
118
121
|
"@stryke/fs": "^0.33.57",
|
|
119
122
|
"@stryke/path": "^0.26.19",
|
|
123
|
+
"@stryke/type-checks": "^0.5.38",
|
|
120
124
|
"defu": "^6.1.4",
|
|
121
125
|
"eslint": "^9.39.4",
|
|
122
|
-
"powerlines": "^0.41.
|
|
126
|
+
"powerlines": "^0.41.7"
|
|
123
127
|
},
|
|
124
128
|
"devDependencies": { "@types/node": "^25.4.0" },
|
|
125
129
|
"publishConfig": { "access": "public" },
|
|
126
|
-
"
|
|
127
|
-
"module": "./dist/index.mjs",
|
|
128
|
-
"types": "./dist/index.d.cts",
|
|
129
|
-
"gitHead": "0ed0ad0cd6f440d1584ac705987ef985931161db"
|
|
130
|
+
"gitHead": "2fb48143904805988bac9bdbc04cdc4a35ff398b"
|
|
130
131
|
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.38/node_modules/@stryke/type-checks/dist/get-object-tag.mjs
|
|
3
|
-
/**
|
|
4
|
-
* Gets the `toStringTag` of `obj`.
|
|
5
|
-
*
|
|
6
|
-
* @param value - The obj to query.
|
|
7
|
-
* @returns Returns the `toStringTag`.
|
|
8
|
-
*/
|
|
9
|
-
const getObjectTag = (value) => {
|
|
10
|
-
if (value == null) return value === void 0 ? "[object Undefined]" : "[object Null]";
|
|
11
|
-
return Object.prototype.toString.call(value);
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
//#endregion
|
|
15
|
-
exports.getObjectTag = getObjectTag;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.38/node_modules/@stryke/type-checks/dist/get-object-tag.mjs
|
|
2
|
-
/**
|
|
3
|
-
* Gets the `toStringTag` of `obj`.
|
|
4
|
-
*
|
|
5
|
-
* @param value - The obj to query.
|
|
6
|
-
* @returns Returns the `toStringTag`.
|
|
7
|
-
*/
|
|
8
|
-
const getObjectTag = (value) => {
|
|
9
|
-
if (value == null) return value === void 0 ? "[object Undefined]" : "[object Null]";
|
|
10
|
-
return Object.prototype.toString.call(value);
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
//#endregion
|
|
14
|
-
export { getObjectTag };
|
|
15
|
-
//# sourceMappingURL=get-object-tag.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-object-tag.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@stryke+type-checks@0.5.38/node_modules/@stryke/type-checks/dist/get-object-tag.mjs"],"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"],"x_google_ignoreList":[0],"mappings":";;;;;;;AAOA,MAAM,gBAAgB,UAAU;AAC/B,KAAI,SAAS,KAAM,QAAO,UAAU,KAAK,IAAI,uBAAuB;AACpE,QAAO,OAAO,UAAU,SAAS,KAAK,MAAM"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const require_is_null = require('./is-null.cjs');
|
|
2
|
-
const require_is_undefined = require('./is-undefined.cjs');
|
|
3
|
-
|
|
4
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-empty.mjs
|
|
5
|
-
/**
|
|
6
|
-
* Check if the provided value's type is `null` or `undefined`
|
|
7
|
-
*
|
|
8
|
-
* @param value - The value to type check
|
|
9
|
-
* @returns An indicator specifying if the value provided is of type `null` or `undefined`
|
|
10
|
-
*/
|
|
11
|
-
const isEmpty = (value) => {
|
|
12
|
-
try {
|
|
13
|
-
return require_is_undefined.isUndefined(value) || require_is_null.isNull(value);
|
|
14
|
-
} catch {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
//#endregion
|
|
20
|
-
exports.isEmpty = isEmpty;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { isNull } from "./is-null.mjs";
|
|
2
|
-
import { isUndefined } from "./is-undefined.mjs";
|
|
3
|
-
|
|
4
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-empty.mjs
|
|
5
|
-
/**
|
|
6
|
-
* Check if the provided value's type is `null` or `undefined`
|
|
7
|
-
*
|
|
8
|
-
* @param value - The value to type check
|
|
9
|
-
* @returns An indicator specifying if the value provided is of type `null` or `undefined`
|
|
10
|
-
*/
|
|
11
|
-
const isEmpty = (value) => {
|
|
12
|
-
try {
|
|
13
|
-
return isUndefined(value) || isNull(value);
|
|
14
|
-
} catch {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
//#endregion
|
|
20
|
-
export { isEmpty };
|
|
21
|
-
//# sourceMappingURL=is-empty.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-empty.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@stryke+type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-empty.mjs"],"sourcesContent":["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"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;AAcA,MAAM,WAAW,UAAU;AAC1B,KAAI;AACH,SAAO,YAAY,MAAM,IAAI,OAAO,MAAM;SACnC;AACP,SAAO"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
const require_is_object = require('./is-object.cjs');
|
|
2
|
-
const require_is_set = require('./is-set.cjs');
|
|
3
|
-
|
|
4
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-non-null-object.mjs
|
|
5
|
-
/**
|
|
6
|
-
* Check if the provided value's type is `Object` and is not `null` or `undefined`
|
|
7
|
-
*
|
|
8
|
-
* @param value - The value to type check
|
|
9
|
-
* @returns An indicator specifying if the value provided is of type `Object` and is not `null` or `undefined`
|
|
10
|
-
*/
|
|
11
|
-
const isNonNullObject = (value) => {
|
|
12
|
-
return require_is_set.isSet(value) && require_is_object.isObject(value);
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
//#endregion
|
|
16
|
-
exports.isNonNullObject = isNonNullObject;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { isObject } from "./is-object.mjs";
|
|
2
|
-
import { isSet } from "./is-set.mjs";
|
|
3
|
-
|
|
4
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-non-null-object.mjs
|
|
5
|
-
/**
|
|
6
|
-
* Check if the provided value's type is `Object` and is not `null` or `undefined`
|
|
7
|
-
*
|
|
8
|
-
* @param value - The value to type check
|
|
9
|
-
* @returns An indicator specifying if the value provided is of type `Object` and is not `null` or `undefined`
|
|
10
|
-
*/
|
|
11
|
-
const isNonNullObject = (value) => {
|
|
12
|
-
return isSet(value) && isObject(value);
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
//#endregion
|
|
16
|
-
export { isNonNullObject };
|
|
17
|
-
//# sourceMappingURL=is-non-null-object.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-non-null-object.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@stryke+type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-non-null-object.mjs"],"sourcesContent":["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"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;AAUA,MAAM,mBAAmB,UAAU;AAClC,QAAO,MAAM,MAAM,IAAI,SAAS,MAAM"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-null.mjs
|
|
3
|
-
const isNull = (value) => {
|
|
4
|
-
try {
|
|
5
|
-
return value === null;
|
|
6
|
-
} catch {
|
|
7
|
-
return false;
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
//#endregion
|
|
12
|
-
exports.isNull = isNull;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-null.mjs
|
|
2
|
-
const isNull = (value) => {
|
|
3
|
-
try {
|
|
4
|
-
return value === null;
|
|
5
|
-
} catch {
|
|
6
|
-
return false;
|
|
7
|
-
}
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
//#endregion
|
|
11
|
-
export { isNull };
|
|
12
|
-
//# sourceMappingURL=is-null.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-null.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@stryke+type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-null.mjs"],"sourcesContent":["//#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"],"x_google_ignoreList":[0],"mappings":";AACA,MAAM,UAAU,UAAU;AACzB,KAAI;AACH,SAAO,UAAU;SACV;AACP,SAAO"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
const require_is_plain_object = require('./is-plain-object.cjs');
|
|
2
|
-
|
|
3
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-object.mjs
|
|
4
|
-
/**
|
|
5
|
-
* Check if the provided value's type is `Object`
|
|
6
|
-
*
|
|
7
|
-
* @param value - The value to type check
|
|
8
|
-
* @returns An indicator specifying if the value provided is of type `Object`
|
|
9
|
-
*/
|
|
10
|
-
const isObject = (value) => {
|
|
11
|
-
try {
|
|
12
|
-
return typeof value === "object" || Boolean(value) && value?.constructor === Object || require_is_plain_object.isPlainObject(value);
|
|
13
|
-
} catch {
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
//#endregion
|
|
19
|
-
exports.isObject = isObject;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { isPlainObject } from "./is-plain-object.mjs";
|
|
2
|
-
|
|
3
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-object.mjs
|
|
4
|
-
/**
|
|
5
|
-
* Check if the provided value's type is `Object`
|
|
6
|
-
*
|
|
7
|
-
* @param value - The value to type check
|
|
8
|
-
* @returns An indicator specifying if the value provided is of type `Object`
|
|
9
|
-
*/
|
|
10
|
-
const isObject = (value) => {
|
|
11
|
-
try {
|
|
12
|
-
return typeof value === "object" || Boolean(value) && value?.constructor === Object || isPlainObject(value);
|
|
13
|
-
} catch {
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
//#endregion
|
|
19
|
-
export { isObject };
|
|
20
|
-
//# sourceMappingURL=is-object.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-object.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@stryke+type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-object.mjs"],"sourcesContent":["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"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;AAkCA,MAAM,YAAY,UAAU;AAC3B,KAAI;AACH,SAAO,OAAO,UAAU,YAAY,QAAQ,MAAM,IAAI,OAAO,gBAAgB,UAAU,cAAc,MAAM;SACpG;AACP,SAAO"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
const require_get_object_tag = require('./get-object-tag.cjs');
|
|
2
|
-
|
|
3
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-plain-object.mjs
|
|
4
|
-
/**
|
|
5
|
-
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
6
|
-
* and has a `typeof` result of "object".
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```typescript
|
|
10
|
-
* isObjectLike({})
|
|
11
|
-
* // => true
|
|
12
|
-
*
|
|
13
|
-
* isObjectLike([1, 2, 3])
|
|
14
|
-
* // => true
|
|
15
|
-
*
|
|
16
|
-
* isObjectLike(Function)
|
|
17
|
-
* // => false
|
|
18
|
-
*
|
|
19
|
-
* isObjectLike(null)
|
|
20
|
-
* // => false
|
|
21
|
-
* ```
|
|
22
|
-
*
|
|
23
|
-
* @param value - The value to check.
|
|
24
|
-
* @returns Returns `true` if `value` is object-like, else `false`.
|
|
25
|
-
*/
|
|
26
|
-
const isObjectLike = (obj) => {
|
|
27
|
-
return typeof obj === "object" && obj !== null;
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* Checks if `obj` is a plain object, that is, an object created by the `Object` constructor or one with a `[[Prototype]]` of `null`.
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* ```typescript
|
|
34
|
-
* function Foo() {
|
|
35
|
-
* this.a = 1
|
|
36
|
-
* }
|
|
37
|
-
*
|
|
38
|
-
* isPlainObject(new Foo)
|
|
39
|
-
* // => false
|
|
40
|
-
*
|
|
41
|
-
* isPlainObject([1, 2, 3])
|
|
42
|
-
* // => false
|
|
43
|
-
*
|
|
44
|
-
* isPlainObject({ 'x': 0, 'y': 0 })
|
|
45
|
-
* // => true
|
|
46
|
-
*
|
|
47
|
-
* isPlainObject(Object.create(null))
|
|
48
|
-
* // => true
|
|
49
|
-
* ```
|
|
50
|
-
*
|
|
51
|
-
* @param obj - The value to check.
|
|
52
|
-
* @returns Returns `true` if `obj` is a plain object, else `false`.
|
|
53
|
-
*/
|
|
54
|
-
const isPlainObject = (obj) => {
|
|
55
|
-
if (!isObjectLike(obj) || require_get_object_tag.getObjectTag(obj) !== "[object Object]") return false;
|
|
56
|
-
if (Object.getPrototypeOf(obj) === null) return true;
|
|
57
|
-
let proto = obj;
|
|
58
|
-
while (Object.getPrototypeOf(proto) !== null) proto = Object.getPrototypeOf(proto);
|
|
59
|
-
return Object.getPrototypeOf(obj) === proto;
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
//#endregion
|
|
63
|
-
exports.isPlainObject = isPlainObject;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { getObjectTag } from "./get-object-tag.mjs";
|
|
2
|
-
|
|
3
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-plain-object.mjs
|
|
4
|
-
/**
|
|
5
|
-
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
6
|
-
* and has a `typeof` result of "object".
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```typescript
|
|
10
|
-
* isObjectLike({})
|
|
11
|
-
* // => true
|
|
12
|
-
*
|
|
13
|
-
* isObjectLike([1, 2, 3])
|
|
14
|
-
* // => true
|
|
15
|
-
*
|
|
16
|
-
* isObjectLike(Function)
|
|
17
|
-
* // => false
|
|
18
|
-
*
|
|
19
|
-
* isObjectLike(null)
|
|
20
|
-
* // => false
|
|
21
|
-
* ```
|
|
22
|
-
*
|
|
23
|
-
* @param value - The value to check.
|
|
24
|
-
* @returns Returns `true` if `value` is object-like, else `false`.
|
|
25
|
-
*/
|
|
26
|
-
const isObjectLike = (obj) => {
|
|
27
|
-
return typeof obj === "object" && obj !== null;
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* Checks if `obj` is a plain object, that is, an object created by the `Object` constructor or one with a `[[Prototype]]` of `null`.
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* ```typescript
|
|
34
|
-
* function Foo() {
|
|
35
|
-
* this.a = 1
|
|
36
|
-
* }
|
|
37
|
-
*
|
|
38
|
-
* isPlainObject(new Foo)
|
|
39
|
-
* // => false
|
|
40
|
-
*
|
|
41
|
-
* isPlainObject([1, 2, 3])
|
|
42
|
-
* // => false
|
|
43
|
-
*
|
|
44
|
-
* isPlainObject({ 'x': 0, 'y': 0 })
|
|
45
|
-
* // => true
|
|
46
|
-
*
|
|
47
|
-
* isPlainObject(Object.create(null))
|
|
48
|
-
* // => true
|
|
49
|
-
* ```
|
|
50
|
-
*
|
|
51
|
-
* @param obj - The value to check.
|
|
52
|
-
* @returns Returns `true` if `obj` is a plain object, else `false`.
|
|
53
|
-
*/
|
|
54
|
-
const isPlainObject = (obj) => {
|
|
55
|
-
if (!isObjectLike(obj) || getObjectTag(obj) !== "[object Object]") return false;
|
|
56
|
-
if (Object.getPrototypeOf(obj) === null) return true;
|
|
57
|
-
let proto = obj;
|
|
58
|
-
while (Object.getPrototypeOf(proto) !== null) proto = Object.getPrototypeOf(proto);
|
|
59
|
-
return Object.getPrototypeOf(obj) === proto;
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
//#endregion
|
|
63
|
-
export { isPlainObject };
|
|
64
|
-
//# sourceMappingURL=is-plain-object.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-plain-object.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@stryke+type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-plain-object.mjs"],"sourcesContent":["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"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAM,gBAAgB,QAAQ;AAC7B,QAAO,OAAO,QAAQ,YAAY,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2B3C,MAAM,iBAAiB,QAAQ;AAC9B,KAAI,CAAC,aAAa,IAAI,IAAI,aAAa,IAAI,KAAK,kBAAmB,QAAO;AAC1E,KAAI,OAAO,eAAe,IAAI,KAAK,KAAM,QAAO;CAChD,IAAI,QAAQ;AACZ,QAAO,OAAO,eAAe,MAAM,KAAK,KAAM,SAAQ,OAAO,eAAe,MAAM;AAClF,QAAO,OAAO,eAAe,IAAI,KAAK"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
const require_is_non_null_object = require('./is-non-null-object.cjs');
|
|
2
|
-
|
|
3
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-set-object.mjs
|
|
4
|
-
/**
|
|
5
|
-
* Check if the provided value's type is an object with some fields set
|
|
6
|
-
*
|
|
7
|
-
* @param value - The value to type check
|
|
8
|
-
* @returns An indicator specifying if the value provided is an object with some fields se
|
|
9
|
-
*/
|
|
10
|
-
const isSetObject = (value) => {
|
|
11
|
-
try {
|
|
12
|
-
return require_is_non_null_object.isNonNullObject(value) && Object.keys(value).length > 0;
|
|
13
|
-
} catch {
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
//#endregion
|
|
19
|
-
exports.isSetObject = isSetObject;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { isNonNullObject } from "./is-non-null-object.mjs";
|
|
2
|
-
|
|
3
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-set-object.mjs
|
|
4
|
-
/**
|
|
5
|
-
* Check if the provided value's type is an object with some fields set
|
|
6
|
-
*
|
|
7
|
-
* @param value - The value to type check
|
|
8
|
-
* @returns An indicator specifying if the value provided is an object with some fields se
|
|
9
|
-
*/
|
|
10
|
-
const isSetObject = (value) => {
|
|
11
|
-
try {
|
|
12
|
-
return isNonNullObject(value) && Object.keys(value).length > 0;
|
|
13
|
-
} catch {
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
//#endregion
|
|
19
|
-
export { isSetObject };
|
|
20
|
-
//# sourceMappingURL=is-set-object.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-set-object.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@stryke+type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-set-object.mjs"],"sourcesContent":["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"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;AASA,MAAM,eAAe,UAAU;AAC9B,KAAI;AACH,SAAO,gBAAgB,MAAM,IAAI,OAAO,KAAK,MAAM,CAAC,SAAS;SACtD;AACP,SAAO"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
const require_is_empty = require('./is-empty.cjs');
|
|
2
|
-
|
|
3
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-set.mjs
|
|
4
|
-
/**
|
|
5
|
-
* The inverse of the `isEmpty` function
|
|
6
|
-
*
|
|
7
|
-
* @param value - The value to type check
|
|
8
|
-
* @returns An indicator specifying if the value provided is **NOT** of type `null` or `undefined`
|
|
9
|
-
*/
|
|
10
|
-
const isSet = (value) => {
|
|
11
|
-
try {
|
|
12
|
-
return !require_is_empty.isEmpty(value);
|
|
13
|
-
} catch {
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
//#endregion
|
|
19
|
-
exports.isSet = isSet;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { isEmpty } from "./is-empty.mjs";
|
|
2
|
-
|
|
3
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-set.mjs
|
|
4
|
-
/**
|
|
5
|
-
* The inverse of the `isEmpty` function
|
|
6
|
-
*
|
|
7
|
-
* @param value - The value to type check
|
|
8
|
-
* @returns An indicator specifying if the value provided is **NOT** of type `null` or `undefined`
|
|
9
|
-
*/
|
|
10
|
-
const isSet = (value) => {
|
|
11
|
-
try {
|
|
12
|
-
return !isEmpty(value);
|
|
13
|
-
} catch {
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
//#endregion
|
|
19
|
-
export { isSet };
|
|
20
|
-
//# sourceMappingURL=is-set.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-set.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@stryke+type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-set.mjs"],"sourcesContent":["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"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;AASA,MAAM,SAAS,UAAU;AACxB,KAAI;AACH,SAAO,CAAC,QAAQ,MAAM;SACf;AACP,SAAO"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-undefined.mjs
|
|
2
|
-
const isUndefined = (value) => {
|
|
3
|
-
return value === void 0;
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
//#endregion
|
|
7
|
-
export { isUndefined };
|
|
8
|
-
//# sourceMappingURL=is-undefined.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-undefined.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@stryke+type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-undefined.mjs"],"sourcesContent":["//#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"],"x_google_ignoreList":[0],"mappings":";AACA,MAAM,eAAe,UAAU;AAC9B,QAAO,UAAU,KAAK"}
|