@powerlines/plugin-eslint 0.8.201 → 0.8.203
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/index.cjs +3 -4
- package/dist/index.d.mts +0 -1
- package/dist/index.mjs +3 -4
- package/dist/packages/powerlines/src/internal/helpers/hooks.d.mts +0 -2
- package/dist/packages/powerlines/src/types/commands.d.mts +0 -1
- package/dist/packages/powerlines/src/types/config.d.mts +6 -14
- package/dist/packages/powerlines/src/types/context.d.mts +7 -0
- package/dist/packages/powerlines/src/types/resolved.d.mts +2 -2
- package/dist/packages/powerlines/src/types/unplugin.d.mts +0 -1
- package/dist/powerlines/src/types/config.d.cts +4 -12
- package/dist/powerlines/src/types/context.d.cts +7 -0
- package/dist/powerlines/src/types/resolved.d.cts +2 -2
- package/package.json +3 -3
- package/dist/packages/powerlines/src/types/babel.d.mts +0 -2
package/dist/index.cjs
CHANGED
|
@@ -2,7 +2,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
2
2
|
const require_is_set_object = require('./node_modules/.pnpm/@stryke_type-checks@0.5.20/node_modules/@stryke/type-checks/dist/is-set-object.cjs');
|
|
3
3
|
const require_helpers_format_message = require('./helpers/format-message.cjs');
|
|
4
4
|
require('./helpers/index.cjs');
|
|
5
|
-
let __storm_software_config_tools_types = require("@storm-software/config-tools/types");
|
|
6
5
|
let __stryke_fs_exists = require("@stryke/fs/exists");
|
|
7
6
|
let __stryke_fs_get_parent_path = require("@stryke/fs/get-parent-path");
|
|
8
7
|
let __stryke_fs_package_fns = require("@stryke/fs/package-fns");
|
|
@@ -19,7 +18,7 @@ function plugin(options = {}) {
|
|
|
19
18
|
return {
|
|
20
19
|
name: "eslint",
|
|
21
20
|
async config() {
|
|
22
|
-
this.
|
|
21
|
+
this.debug("Providing default configuration for the Powerlines `eslint` build plugin.");
|
|
23
22
|
return { lint: { eslint: (0, defu.defu)(options, {
|
|
24
23
|
configFile: (0, __stryke_fs_get_parent_path.getParentPath)([
|
|
25
24
|
"eslint.config.js",
|
|
@@ -86,7 +85,7 @@ function plugin(options = {}) {
|
|
|
86
85
|
this.eslint = new ESLint(options$1);
|
|
87
86
|
},
|
|
88
87
|
async lint() {
|
|
89
|
-
this.
|
|
88
|
+
this.debug("Linting project files with ESLint.");
|
|
90
89
|
let results = await this.eslint.lintFiles(this.tsconfig.fileNames.filter((fileName) => !fileName.includes(this.artifactsPath) && !fileName.includes("node_modules")));
|
|
91
90
|
const module$1 = await this.resolver.import(this.resolver.esmResolve("eslint"));
|
|
92
91
|
let ESLint;
|
|
@@ -95,7 +94,7 @@ function plugin(options = {}) {
|
|
|
95
94
|
if (this.config.lint.eslint.reportErrorsOnly) results = ESLint.getErrorResults(results);
|
|
96
95
|
const output = results.filter(({ messages }) => messages?.length).map(({ messages, filePath }) => require_helpers_format_message.formatMessage(this.config.projectRoot, messages, filePath)).join("\n");
|
|
97
96
|
if (this.config.lint.eslint.outputFile) await this.fs.write(this.config.lint.eslint.outputFile, output);
|
|
98
|
-
else this.
|
|
97
|
+
else this.info(output);
|
|
99
98
|
}
|
|
100
99
|
};
|
|
101
100
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { LintMessage, MessageSeverity, __ΩLintMessage, __ΩMessageSeverity, formatMessage } from "./helpers/format-message.mjs";
|
|
2
2
|
import { Plugin } from "./packages/powerlines/src/types/plugin.mjs";
|
|
3
3
|
import { ESLintPluginContext, ESLintPluginOptions, ESLintPluginResolvedConfig, ESLintPluginUserConfig, __ΩESLintPluginContext, __ΩESLintPluginOptions, __ΩESLintPluginResolvedConfig, __ΩESLintPluginUserConfig } from "./types/plugin.mjs";
|
|
4
|
-
import "./types/index.mjs";
|
|
5
4
|
|
|
6
5
|
//#region src/index.d.ts
|
|
7
6
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { isSetObject } from "./node_modules/.pnpm/@stryke_type-checks@0.5.20/node_modules/@stryke/type-checks/dist/is-set-object.mjs";
|
|
2
2
|
import { MessageSeverity, formatMessage } from "./helpers/format-message.mjs";
|
|
3
3
|
import "./helpers/index.mjs";
|
|
4
|
-
import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
5
4
|
import { existsSync } from "@stryke/fs/exists";
|
|
6
5
|
import { getParentPath } from "@stryke/fs/get-parent-path";
|
|
7
6
|
import { isPackageExists } from "@stryke/fs/package-fns";
|
|
@@ -18,7 +17,7 @@ function plugin(options = {}) {
|
|
|
18
17
|
return {
|
|
19
18
|
name: "eslint",
|
|
20
19
|
async config() {
|
|
21
|
-
this.
|
|
20
|
+
this.debug("Providing default configuration for the Powerlines `eslint` build plugin.");
|
|
22
21
|
return { lint: { eslint: defu(options, {
|
|
23
22
|
configFile: getParentPath([
|
|
24
23
|
"eslint.config.js",
|
|
@@ -85,7 +84,7 @@ function plugin(options = {}) {
|
|
|
85
84
|
this.eslint = new ESLint(options$1);
|
|
86
85
|
},
|
|
87
86
|
async lint() {
|
|
88
|
-
this.
|
|
87
|
+
this.debug("Linting project files with ESLint.");
|
|
89
88
|
let results = await this.eslint.lintFiles(this.tsconfig.fileNames.filter((fileName) => !fileName.includes(this.artifactsPath) && !fileName.includes("node_modules")));
|
|
90
89
|
const module = await this.resolver.import(this.resolver.esmResolve("eslint"));
|
|
91
90
|
let ESLint;
|
|
@@ -94,7 +93,7 @@ function plugin(options = {}) {
|
|
|
94
93
|
if (this.config.lint.eslint.reportErrorsOnly) results = ESLint.getErrorResults(results);
|
|
95
94
|
const output = results.filter(({ messages }) => messages?.length).map(({ messages, filePath }) => formatMessage(this.config.projectRoot, messages, filePath)).join("\n");
|
|
96
95
|
if (this.config.lint.eslint.outputFile) await this.fs.write(this.config.lint.eslint.outputFile, output);
|
|
97
|
-
else this.
|
|
96
|
+
else this.info(output);
|
|
98
97
|
}
|
|
99
98
|
};
|
|
100
99
|
}
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { BuildConfig, BuildResolvedConfig, ESBuildBuildConfig, ESBuildResolvedBuildConfig, FarmBuildConfig, FarmResolvedBuildConfig, RolldownBuildConfig, RolldownResolvedBuildConfig, RollupBuildConfig, RollupResolvedBuildConfig, RspackBuildConfig, RspackResolvedBuildConfig, TsdownBuildConfig, TsdownResolvedBuildConfig, TsupBuildConfig, TsupResolvedBuildConfig, UnbuildBuildConfig, UnbuildResolvedBuildConfig, ViteBuildConfig, ViteResolvedBuildConfig, WebpackBuildConfig, WebpackResolvedBuildConfig } from "./build.mjs";
|
|
2
|
-
import "./babel.mjs";
|
|
3
2
|
import { StoragePort, StoragePreset } from "./fs.mjs";
|
|
4
3
|
import { TSConfig } from "./tsconfig.mjs";
|
|
5
4
|
import { PluginContext } from "./context.mjs";
|
|
6
5
|
import { Plugin } from "./plugin.mjs";
|
|
7
|
-
import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
8
6
|
import { MaybePromise } from "@stryke/types/base";
|
|
9
7
|
import { PreviewOptions } from "vite";
|
|
10
8
|
import { Format } from "@storm-software/build-tools/types";
|
|
9
|
+
import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
11
10
|
import { StormWorkspaceConfig } from "@storm-software/config/types";
|
|
12
11
|
import { TypeDefinitionParameter } from "@stryke/types/configuration";
|
|
13
12
|
import { AssetGlob } from "@stryke/types/file";
|
|
14
13
|
import { DateString } from "compatx";
|
|
15
14
|
|
|
16
15
|
//#region ../powerlines/src/types/config.d.ts
|
|
16
|
+
|
|
17
|
+
type LogLevel = "error" | "warn" | "info" | "debug" | "trace";
|
|
17
18
|
type LogFn = (type: LogLevelLabel, ...args: string[]) => void;
|
|
18
19
|
/**
|
|
19
20
|
* The {@link StormWorkspaceConfig | configuration} object for an entire Powerlines workspace
|
|
@@ -91,15 +92,6 @@ interface OutputConfig {
|
|
|
91
92
|
* @defaultValue "\{projectRoot\}/powerlines.d.ts"
|
|
92
93
|
*/
|
|
93
94
|
dts?: string | false;
|
|
94
|
-
/**
|
|
95
|
-
* A prefix to use for identifying builtin modules
|
|
96
|
-
*
|
|
97
|
-
* @remarks
|
|
98
|
-
* This prefix will be used to identify all builtin modules generated during the "prepare" phase. An example builtin ID for a module called `"utils"` would be `"{builtinPrefix}:utils"`.
|
|
99
|
-
*
|
|
100
|
-
* @defaultValue "powerlines"
|
|
101
|
-
*/
|
|
102
|
-
builtinPrefix?: string;
|
|
103
95
|
/**
|
|
104
96
|
* The module format of the output files
|
|
105
97
|
*
|
|
@@ -262,7 +254,7 @@ interface CommonUserConfig extends BaseConfig {
|
|
|
262
254
|
*
|
|
263
255
|
* @defaultValue "info"
|
|
264
256
|
*/
|
|
265
|
-
logLevel?:
|
|
257
|
+
logLevel?: LogLevel | null;
|
|
266
258
|
/**
|
|
267
259
|
* A custom logger function to use for logging messages
|
|
268
260
|
*/
|
|
@@ -335,7 +327,7 @@ interface CommonUserConfig extends BaseConfig {
|
|
|
335
327
|
* A string identifier that allows a child framework or tool to identify itself when using Powerlines.
|
|
336
328
|
*
|
|
337
329
|
* @remarks
|
|
338
|
-
* If no values are provided for {@link OutputConfig.dts | output.dts}
|
|
330
|
+
* If no values are provided for {@link OutputConfig.dts | output.dts} or {@link OutputConfig.artifactsPath | output.artifactsFolder}, this value will be used as the default.
|
|
339
331
|
*
|
|
340
332
|
* @defaultValue "powerlines"
|
|
341
333
|
*/
|
|
@@ -429,4 +421,4 @@ type DeployInlineConfig<TUserConfig extends UserConfig$1 = UserConfig$1> = Inlin
|
|
|
429
421
|
command: "deploy";
|
|
430
422
|
};
|
|
431
423
|
//#endregion
|
|
432
|
-
export { BuildInlineConfig, CleanInlineConfig, DeployInlineConfig, DocsInlineConfig, ESBuildUserConfig, EnvironmentConfig, FarmUserConfig, InlineConfig, LintInlineConfig, LogFn, NewInlineConfig, OutputConfig, PluginConfig, PrepareInlineConfig, RolldownUserConfig, RollupUserConfig, RspackUserConfig, TsdownUserConfig, TsupUserConfig, UnbuildUserConfig, UserConfig$1 as UserConfig, ViteUserConfig, WebpackUserConfig, WorkspaceConfig };
|
|
424
|
+
export { BuildInlineConfig, CleanInlineConfig, DeployInlineConfig, DocsInlineConfig, ESBuildUserConfig, EnvironmentConfig, FarmUserConfig, InlineConfig, LintInlineConfig, LogFn, LogLevel, NewInlineConfig, OutputConfig, PluginConfig, PrepareInlineConfig, RolldownUserConfig, RollupUserConfig, RspackUserConfig, TsdownUserConfig, TsupUserConfig, UnbuildUserConfig, UserConfig$1 as UserConfig, ViteUserConfig, WebpackUserConfig, WorkspaceConfig };
|
|
@@ -226,6 +226,13 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
|
|
|
226
226
|
* The builtin module id that exist in the Powerlines virtual file system
|
|
227
227
|
*/
|
|
228
228
|
builtins: string[];
|
|
229
|
+
/**
|
|
230
|
+
* The alias mappings for the project used during module resolution
|
|
231
|
+
*
|
|
232
|
+
* @remarks
|
|
233
|
+
* This includes both the built-in module aliases as well as any custom aliases defined in the build configuration.
|
|
234
|
+
*/
|
|
235
|
+
alias: Record<string, string>;
|
|
229
236
|
/**
|
|
230
237
|
* The {@link Project} instance used for type reflection and module manipulation
|
|
231
238
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BuilderVariant } from "./build.mjs";
|
|
2
|
-
import { ESBuildUserConfig, EnvironmentConfig, FarmUserConfig, InlineConfig, OutputConfig, RolldownUserConfig, RollupUserConfig, RspackUserConfig, TsdownUserConfig, TsupUserConfig, UnbuildUserConfig, UserConfig as UserConfig$1, ViteUserConfig, WebpackUserConfig } from "./config.mjs";
|
|
2
|
+
import { ESBuildUserConfig, EnvironmentConfig, FarmUserConfig, InlineConfig, LogLevel, OutputConfig, RolldownUserConfig, RollupUserConfig, RspackUserConfig, TsdownUserConfig, TsupUserConfig, UnbuildUserConfig, UserConfig as UserConfig$1, ViteUserConfig, WebpackUserConfig } from "./config.mjs";
|
|
3
3
|
import { NonUndefined } from "@stryke/types/base";
|
|
4
4
|
import { ResolvedPreviewOptions } from "vite";
|
|
5
5
|
import { TypeDefinition } from "@stryke/types/configuration";
|
|
@@ -76,7 +76,7 @@ type ResolvedConfig<TUserConfig extends UserConfig$1 = UserConfig$1> = Omit<TUse
|
|
|
76
76
|
*
|
|
77
77
|
* @defaultValue "info"
|
|
78
78
|
*/
|
|
79
|
-
logLevel:
|
|
79
|
+
logLevel: LogLevel | null;
|
|
80
80
|
};
|
|
81
81
|
type ViteResolvedConfig = ResolvedConfig<ViteUserConfig>;
|
|
82
82
|
type WebpackResolvedConfig = ResolvedConfig<WebpackUserConfig>;
|
|
@@ -14,6 +14,7 @@ import { DateString } from "compatx";
|
|
|
14
14
|
|
|
15
15
|
//#region ../powerlines/src/types/config.d.ts
|
|
16
16
|
|
|
17
|
+
type LogLevel = "error" | "warn" | "info" | "debug" | "trace";
|
|
17
18
|
type LogFn = (type: LogLevelLabel, ...args: string[]) => void;
|
|
18
19
|
/**
|
|
19
20
|
* The {@link StormWorkspaceConfig | configuration} object for an entire Powerlines workspace
|
|
@@ -91,15 +92,6 @@ interface OutputConfig {
|
|
|
91
92
|
* @defaultValue "\{projectRoot\}/powerlines.d.ts"
|
|
92
93
|
*/
|
|
93
94
|
dts?: string | false;
|
|
94
|
-
/**
|
|
95
|
-
* A prefix to use for identifying builtin modules
|
|
96
|
-
*
|
|
97
|
-
* @remarks
|
|
98
|
-
* This prefix will be used to identify all builtin modules generated during the "prepare" phase. An example builtin ID for a module called `"utils"` would be `"{builtinPrefix}:utils"`.
|
|
99
|
-
*
|
|
100
|
-
* @defaultValue "powerlines"
|
|
101
|
-
*/
|
|
102
|
-
builtinPrefix?: string;
|
|
103
95
|
/**
|
|
104
96
|
* The module format of the output files
|
|
105
97
|
*
|
|
@@ -262,7 +254,7 @@ interface CommonUserConfig extends BaseConfig {
|
|
|
262
254
|
*
|
|
263
255
|
* @defaultValue "info"
|
|
264
256
|
*/
|
|
265
|
-
logLevel?:
|
|
257
|
+
logLevel?: LogLevel | null;
|
|
266
258
|
/**
|
|
267
259
|
* A custom logger function to use for logging messages
|
|
268
260
|
*/
|
|
@@ -335,7 +327,7 @@ interface CommonUserConfig extends BaseConfig {
|
|
|
335
327
|
* A string identifier that allows a child framework or tool to identify itself when using Powerlines.
|
|
336
328
|
*
|
|
337
329
|
* @remarks
|
|
338
|
-
* If no values are provided for {@link OutputConfig.dts | output.dts}
|
|
330
|
+
* If no values are provided for {@link OutputConfig.dts | output.dts} or {@link OutputConfig.artifactsPath | output.artifactsFolder}, this value will be used as the default.
|
|
339
331
|
*
|
|
340
332
|
* @defaultValue "powerlines"
|
|
341
333
|
*/
|
|
@@ -429,4 +421,4 @@ type DeployInlineConfig<TUserConfig extends UserConfig$1 = UserConfig$1> = Inlin
|
|
|
429
421
|
command: "deploy";
|
|
430
422
|
};
|
|
431
423
|
//#endregion
|
|
432
|
-
export { BuildInlineConfig, CleanInlineConfig, DeployInlineConfig, DocsInlineConfig, ESBuildUserConfig, EnvironmentConfig, FarmUserConfig, InlineConfig, LintInlineConfig, LogFn, NewInlineConfig, OutputConfig, PluginConfig, PrepareInlineConfig, RolldownUserConfig, RollupUserConfig, RspackUserConfig, TsdownUserConfig, TsupUserConfig, UnbuildUserConfig, UserConfig$1 as UserConfig, ViteUserConfig, WebpackUserConfig, WorkspaceConfig };
|
|
424
|
+
export { BuildInlineConfig, CleanInlineConfig, DeployInlineConfig, DocsInlineConfig, ESBuildUserConfig, EnvironmentConfig, FarmUserConfig, InlineConfig, LintInlineConfig, LogFn, LogLevel, NewInlineConfig, OutputConfig, PluginConfig, PrepareInlineConfig, RolldownUserConfig, RollupUserConfig, RspackUserConfig, TsdownUserConfig, TsupUserConfig, UnbuildUserConfig, UserConfig$1 as UserConfig, ViteUserConfig, WebpackUserConfig, WorkspaceConfig };
|
|
@@ -226,6 +226,13 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
|
|
|
226
226
|
* The builtin module id that exist in the Powerlines virtual file system
|
|
227
227
|
*/
|
|
228
228
|
builtins: string[];
|
|
229
|
+
/**
|
|
230
|
+
* The alias mappings for the project used during module resolution
|
|
231
|
+
*
|
|
232
|
+
* @remarks
|
|
233
|
+
* This includes both the built-in module aliases as well as any custom aliases defined in the build configuration.
|
|
234
|
+
*/
|
|
235
|
+
alias: Record<string, string>;
|
|
229
236
|
/**
|
|
230
237
|
* The {@link Project} instance used for type reflection and module manipulation
|
|
231
238
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BuilderVariant } from "./build.cjs";
|
|
2
|
-
import { ESBuildUserConfig, EnvironmentConfig, FarmUserConfig, InlineConfig, OutputConfig, RolldownUserConfig, RollupUserConfig, RspackUserConfig, TsdownUserConfig, TsupUserConfig, UnbuildUserConfig, UserConfig as UserConfig$1, ViteUserConfig, WebpackUserConfig } from "./config.cjs";
|
|
2
|
+
import { ESBuildUserConfig, EnvironmentConfig, FarmUserConfig, InlineConfig, LogLevel, OutputConfig, RolldownUserConfig, RollupUserConfig, RspackUserConfig, TsdownUserConfig, TsupUserConfig, UnbuildUserConfig, UserConfig as UserConfig$1, ViteUserConfig, WebpackUserConfig } from "./config.cjs";
|
|
3
3
|
import { NonUndefined } from "@stryke/types/base";
|
|
4
4
|
import { ResolvedPreviewOptions } from "vite";
|
|
5
5
|
import { TypeDefinition } from "@stryke/types/configuration";
|
|
@@ -76,7 +76,7 @@ type ResolvedConfig<TUserConfig extends UserConfig$1 = UserConfig$1> = Omit<TUse
|
|
|
76
76
|
*
|
|
77
77
|
* @defaultValue "info"
|
|
78
78
|
*/
|
|
79
|
-
logLevel:
|
|
79
|
+
logLevel: LogLevel | null;
|
|
80
80
|
};
|
|
81
81
|
type ViteResolvedConfig = ResolvedConfig<ViteUserConfig>;
|
|
82
82
|
type WebpackResolvedConfig = ResolvedConfig<WebpackUserConfig>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-eslint",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.203",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing a Powerlines plugin for running ESLint on the codebase.",
|
|
6
6
|
"repository": {
|
|
@@ -105,9 +105,9 @@
|
|
|
105
105
|
"@stryke/path": "^0.26.0",
|
|
106
106
|
"defu": "^6.1.4",
|
|
107
107
|
"eslint": "^9.39.2",
|
|
108
|
-
"powerlines": "^0.37.
|
|
108
|
+
"powerlines": "^0.37.73"
|
|
109
109
|
},
|
|
110
110
|
"devDependencies": { "@types/node": "^24.10.9" },
|
|
111
111
|
"publishConfig": { "access": "public" },
|
|
112
|
-
"gitHead": "
|
|
112
|
+
"gitHead": "df743ef7ebac849eb4ce90899884df4758b61172"
|
|
113
113
|
}
|