@powerlines/plugin-oxlint 0.7.51 → 0.7.52
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/generate-config-Bv04QRI-.d.mts +14 -0
- package/dist/generate-config-Bv04QRI-.d.mts.map +1 -0
- package/dist/{helpers/generate-config.js → generate-config-C-r5Jx4F.mjs} +6 -11
- package/dist/generate-config-C-r5Jx4F.mjs.map +1 -0
- package/dist/generate-config-ClmGm8Rq.cjs +45 -0
- package/dist/generate-config-DLpLmgFp.d.cts +14 -0
- package/dist/generate-config-DLpLmgFp.d.cts.map +1 -0
- package/dist/helpers/generate-config.cjs +1 -51
- package/dist/helpers/generate-config.d.cts +3 -32
- package/dist/helpers/generate-config.d.mts +3 -0
- package/dist/helpers/generate-config.mjs +1 -0
- package/dist/helpers/index.cjs +1 -1
- package/dist/helpers/index.d.cts +3 -23
- package/dist/helpers/index.d.mts +3 -0
- package/dist/helpers/index.mjs +1 -0
- package/dist/index-D-CYNcT9.d.mts +1 -0
- package/dist/index-D6CnpA_r.d.cts +1 -0
- package/dist/index.cjs +1 -7
- package/dist/index.d.cts +7 -25
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +12 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -0
- package/dist/plugin-C8gl34-_.d.mts +1718 -0
- package/dist/plugin-C8gl34-_.d.mts.map +1 -0
- package/dist/plugin-DzeYlbKJ.mjs +1 -0
- package/dist/plugin-_GgXchca.d.cts +1718 -0
- package/dist/plugin-_GgXchca.d.cts.map +1 -0
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.d.cts +3 -22
- package/dist/types/index.d.mts +3 -0
- package/dist/types/index.mjs +1 -0
- package/dist/types/plugin.cjs +1 -1
- package/dist/types/plugin.d.cts +2 -22
- package/dist/types/plugin.d.mts +2 -0
- package/dist/types/plugin.mjs +1 -0
- package/dist/types-BKeuN6sy.mjs +1 -0
- package/dist/types-DHkg7xmX.cjs +0 -0
- package/package.json +33 -21
- package/dist/chunk-FBBMZ4NC.cjs +0 -7
- package/dist/chunk-UCUR73HG.js +0 -7
- package/dist/helpers/generate-config.d.ts +0 -32
- package/dist/helpers/index.d.ts +0 -23
- package/dist/helpers/index.js +0 -1
- package/dist/index-DSURnvnc.d.cts +0 -1629
- package/dist/index-DSURnvnc.d.ts +0 -1629
- package/dist/index.d.ts +0 -30
- package/dist/index.js +0 -7
- package/dist/types/index.d.ts +0 -22
- package/dist/types/index.js +0 -1
- package/dist/types/plugin.d.ts +0 -22
- /package/dist/{types/plugin.js → plugin-DHXHjv16.cjs} +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { n as OxlintPluginOptions } from "./plugin-C8gl34-_.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/helpers/generate-config.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Generates an Oxlint configuration file content based on the provided options.
|
|
7
|
+
*
|
|
8
|
+
* @param options - The options for the Oxlint plugin.
|
|
9
|
+
* @returns The generated configuration as a string.
|
|
10
|
+
*/
|
|
11
|
+
declare function generateConfig(options?: OxlintPluginOptions): string;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { generateConfig as t };
|
|
14
|
+
//# sourceMappingURL=generate-config-Bv04QRI-.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-config-Bv04QRI-.d.mts","names":[],"sources":["../src/helpers/generate-config.ts"],"sourcesContent":[],"mappings":";;;;;;AA2BA;;;;iBAAgB,cAAA,WAAwB"}
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
*
|
|
3
|
-
* ⚡ Built by Storm Software
|
|
4
|
-
*
|
|
5
|
-
*****************************************/
|
|
6
|
-
|
|
7
|
-
function l(r={}){return `{
|
|
1
|
+
import{toArray as e}from"@stryke/convert/neutral";function t(t={}){return`{
|
|
8
2
|
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
|
9
3
|
"plugins": [
|
|
10
4
|
"import",
|
|
@@ -20,9 +14,9 @@ function l(r={}){return `{
|
|
|
20
14
|
"coverage/**",
|
|
21
15
|
"node_modules/**",
|
|
22
16
|
"temp/**",
|
|
23
|
-
"tests/fixtures/**"${
|
|
24
|
-
${
|
|
25
|
-
`)}
|
|
17
|
+
"tests/fixtures/**"${t.ignorePatterns?`,
|
|
18
|
+
${e(t.ignorePatterns).map(e=>`"${e}"`).join(`,
|
|
19
|
+
`)}`:``}
|
|
26
20
|
],
|
|
27
21
|
"rules": {
|
|
28
22
|
"import/named": "error",
|
|
@@ -48,4 +42,5 @@ function l(r={}){return `{
|
|
|
48
42
|
],
|
|
49
43
|
"unicorn/prefer-node-protocol": "error"
|
|
50
44
|
}
|
|
51
|
-
}`}
|
|
45
|
+
}`}export{t};
|
|
46
|
+
//# sourceMappingURL=generate-config-C-r5Jx4F.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-config-C-r5Jx4F.mjs","names":[],"sources":["../src/helpers/generate-config.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 { toArray } from \"@stryke/convert/neutral\";\nimport { OxlintPluginOptions } from \"../types/plugin\";\n\n/**\n * Generates an Oxlint configuration file content based on the provided options.\n *\n * @param options - The options for the Oxlint plugin.\n * @returns The generated configuration as a string.\n */\nexport function generateConfig(options: OxlintPluginOptions = {}): string {\n return `{\n \"$schema\": \"./node_modules/oxlint/configuration_schema.json\",\n \"plugins\": [\n \"import\",\n \"jsdoc\",\n \"unicorn\",\n \"typescript\",\n \"oxc\"\n ],\n \"ignorePatterns\": [\n \"crates/**\",\n \"dist/**\",\n \"build/**\",\n \"coverage/**\",\n \"node_modules/**\",\n \"temp/**\",\n \"tests/fixtures/**\"${\n options.ignorePatterns\n ? `,\n ${toArray(options.ignorePatterns)\n .map(pattern => `\"${pattern}\"`)\n .join(\",\\n \")}`\n : \"\"\n }\n ],\n \"rules\": {\n \"import/named\": \"error\",\n \"import/namespace\": [\n \"error\",\n {\n \"allowComputed\": true\n }\n ],\n \"no-unused-expressions\": [\n \"warn\",\n {\n \"allowShortCircuit\": true,\n \"allowTaggedTemplates\": true\n }\n ],\n \"no-unused-vars\": [\n \"warn\",\n {\n \"varsIgnorePattern\": \"^_\",\n \"argsIgnorePattern\": \"^_\"\n }\n ],\n \"unicorn/prefer-node-protocol\": \"error\"\n }\n}`;\n}\n"],"mappings":"kDA2BA,SAAgB,EAAe,EAA+B,EAAE,CAAU,CACxE,MAAO;;;;;;;;;;;;;;;;yBAiBH,EAAQ,eACJ;MACJ,EAAQ,EAAQ,eAAe,CAC9B,IAAI,GAAW,IAAI,EAAQ,GAAG,CAC9B,KAAK;MAAU,GACZ,GACL"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
let e=require(`@stryke/convert/neutral`);function t(t={}){return`{
|
|
2
|
+
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
|
3
|
+
"plugins": [
|
|
4
|
+
"import",
|
|
5
|
+
"jsdoc",
|
|
6
|
+
"unicorn",
|
|
7
|
+
"typescript",
|
|
8
|
+
"oxc"
|
|
9
|
+
],
|
|
10
|
+
"ignorePatterns": [
|
|
11
|
+
"crates/**",
|
|
12
|
+
"dist/**",
|
|
13
|
+
"build/**",
|
|
14
|
+
"coverage/**",
|
|
15
|
+
"node_modules/**",
|
|
16
|
+
"temp/**",
|
|
17
|
+
"tests/fixtures/**"${t.ignorePatterns?`,
|
|
18
|
+
${(0,e.toArray)(t.ignorePatterns).map(e=>`"${e}"`).join(`,
|
|
19
|
+
`)}`:``}
|
|
20
|
+
],
|
|
21
|
+
"rules": {
|
|
22
|
+
"import/named": "error",
|
|
23
|
+
"import/namespace": [
|
|
24
|
+
"error",
|
|
25
|
+
{
|
|
26
|
+
"allowComputed": true
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"no-unused-expressions": [
|
|
30
|
+
"warn",
|
|
31
|
+
{
|
|
32
|
+
"allowShortCircuit": true,
|
|
33
|
+
"allowTaggedTemplates": true
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"no-unused-vars": [
|
|
37
|
+
"warn",
|
|
38
|
+
{
|
|
39
|
+
"varsIgnorePattern": "^_",
|
|
40
|
+
"argsIgnorePattern": "^_"
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"unicorn/prefer-node-protocol": "error"
|
|
44
|
+
}
|
|
45
|
+
}`}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return t}});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { n as OxlintPluginOptions } from "./plugin-_GgXchca.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/helpers/generate-config.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Generates an Oxlint configuration file content based on the provided options.
|
|
7
|
+
*
|
|
8
|
+
* @param options - The options for the Oxlint plugin.
|
|
9
|
+
* @returns The generated configuration as a string.
|
|
10
|
+
*/
|
|
11
|
+
declare function generateConfig(options?: OxlintPluginOptions): string;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { generateConfig as t };
|
|
14
|
+
//# sourceMappingURL=generate-config-DLpLmgFp.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-config-DLpLmgFp.d.cts","names":[],"sources":["../src/helpers/generate-config.ts"],"sourcesContent":[],"mappings":";;;;;;AA2BA;;;;iBAAgB,cAAA,WAAwB"}
|
|
@@ -1,51 +1 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
* ⚡ Built by Storm Software
|
|
4
|
-
*
|
|
5
|
-
*****************************************/
|
|
6
|
-
|
|
7
|
-
function u(r={}){return `{
|
|
8
|
-
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
|
9
|
-
"plugins": [
|
|
10
|
-
"import",
|
|
11
|
-
"jsdoc",
|
|
12
|
-
"unicorn",
|
|
13
|
-
"typescript",
|
|
14
|
-
"oxc"
|
|
15
|
-
],
|
|
16
|
-
"ignorePatterns": [
|
|
17
|
-
"crates/**",
|
|
18
|
-
"dist/**",
|
|
19
|
-
"build/**",
|
|
20
|
-
"coverage/**",
|
|
21
|
-
"node_modules/**",
|
|
22
|
-
"temp/**",
|
|
23
|
-
"tests/fixtures/**"${r.ignorePatterns?`,
|
|
24
|
-
${neutral.toArray(r.ignorePatterns).map(o=>`"${o}"`).join(`,
|
|
25
|
-
`)}`:""}
|
|
26
|
-
],
|
|
27
|
-
"rules": {
|
|
28
|
-
"import/named": "error",
|
|
29
|
-
"import/namespace": [
|
|
30
|
-
"error",
|
|
31
|
-
{
|
|
32
|
-
"allowComputed": true
|
|
33
|
-
}
|
|
34
|
-
],
|
|
35
|
-
"no-unused-expressions": [
|
|
36
|
-
"warn",
|
|
37
|
-
{
|
|
38
|
-
"allowShortCircuit": true,
|
|
39
|
-
"allowTaggedTemplates": true
|
|
40
|
-
}
|
|
41
|
-
],
|
|
42
|
-
"no-unused-vars": [
|
|
43
|
-
"warn",
|
|
44
|
-
{
|
|
45
|
-
"varsIgnorePattern": "^_",
|
|
46
|
-
"argsIgnorePattern": "^_"
|
|
47
|
-
}
|
|
48
|
-
],
|
|
49
|
-
"unicorn/prefer-node-protocol": "error"
|
|
50
|
-
}
|
|
51
|
-
}`}chunkFBBMZ4NC_cjs.a(u,"generateConfig");exports.generateConfig=u;
|
|
1
|
+
const e=require(`../generate-config-ClmGm8Rq.cjs`);exports.generateConfig=e.t;
|
|
@@ -1,32 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
import '@storm-software/config/types';
|
|
5
|
-
import '@stryke/types/base';
|
|
6
|
-
import '@stryke/types/configuration';
|
|
7
|
-
import '@stryke/types/file';
|
|
8
|
-
import 'vite';
|
|
9
|
-
import '@stryke/env/get-env-paths';
|
|
10
|
-
import '@stryke/http/fetch';
|
|
11
|
-
import '@stryke/types/package-json';
|
|
12
|
-
import 'jiti';
|
|
13
|
-
import 'magic-string';
|
|
14
|
-
import 'oxc-parser';
|
|
15
|
-
import 'semver';
|
|
16
|
-
import 'ts-morph';
|
|
17
|
-
import 'undici';
|
|
18
|
-
import 'unplugin';
|
|
19
|
-
import '@stryke/fs/resolve';
|
|
20
|
-
import '@stryke/types/tsconfig';
|
|
21
|
-
import 'typescript';
|
|
22
|
-
import '@stryke/types/array';
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Generates an Oxlint configuration file content based on the provided options.
|
|
26
|
-
*
|
|
27
|
-
* @param options - The options for the Oxlint plugin.
|
|
28
|
-
* @returns The generated configuration as a string.
|
|
29
|
-
*/
|
|
30
|
-
declare function generateConfig(options?: OxlintPluginOptions): string;
|
|
31
|
-
|
|
32
|
-
export { generateConfig };
|
|
1
|
+
import "../plugin-_GgXchca.cjs";
|
|
2
|
+
import { t as generateConfig } from "../generate-config-DLpLmgFp.cjs";
|
|
3
|
+
export { generateConfig };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"../generate-config-C-r5Jx4F.mjs";export{e as generateConfig};
|
package/dist/helpers/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const e=require(`../generate-config-ClmGm8Rq.cjs`);exports.generateConfig=e.t;
|
package/dist/helpers/index.d.cts
CHANGED
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
import '@storm-software/config-tools/types';
|
|
5
|
-
import '@storm-software/config/types';
|
|
6
|
-
import '@stryke/types/base';
|
|
7
|
-
import '@stryke/types/configuration';
|
|
8
|
-
import '@stryke/types/file';
|
|
9
|
-
import 'vite';
|
|
10
|
-
import '@stryke/env/get-env-paths';
|
|
11
|
-
import '@stryke/http/fetch';
|
|
12
|
-
import '@stryke/types/package-json';
|
|
13
|
-
import 'jiti';
|
|
14
|
-
import 'magic-string';
|
|
15
|
-
import 'oxc-parser';
|
|
16
|
-
import 'semver';
|
|
17
|
-
import 'ts-morph';
|
|
18
|
-
import 'undici';
|
|
19
|
-
import 'unplugin';
|
|
20
|
-
import '@stryke/fs/resolve';
|
|
21
|
-
import '@stryke/types/tsconfig';
|
|
22
|
-
import 'typescript';
|
|
23
|
-
import '@stryke/types/array';
|
|
1
|
+
import "../plugin-_GgXchca.cjs";
|
|
2
|
+
import { t as generateConfig } from "../generate-config-DLpLmgFp.cjs";
|
|
3
|
+
export { generateConfig };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"../generate-config-C-r5Jx4F.mjs";export{e as generateConfig};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
* ⚡ Built by Storm Software
|
|
4
|
-
*
|
|
5
|
-
*****************************************/
|
|
6
|
-
|
|
7
|
-
function u(r={}){return {name:"oxlint",async config(){return this.log(types$1.LogLevelLabel.TRACE,"Providing default configuration for the Powerlines `oxlint` linting plugin."),{lint:{oxlint:{configFile:".oxlintrc.json",deny:[],allow:[],warn:[],typeAware:true,fix:true,format:"stylish",...r}}}},configResolved(){this.devDependencies.oxlint="^1.24.0",this.config.lint.oxlint.typeAware&&(this.devDependencies["oxlint-tsgolint"]="^0.2.1");},async lint(){this.log(types$1.LogLevelLabel.TRACE,"Linting project files with Oxlint.");const i=[];if(this.config.lint.oxlint.params&&i.push(...this.config.lint.oxlint.params.split(" ").filter(Boolean)),!i.includes("--ignore-pattern")&&this.config.lint.oxlint.ignorePatterns&&i.push(`--ignore-pattern=${this.config.lint.oxlint.ignorePatterns}`),this.config.lint.oxlint.deny.forEach(t=>i.push("-D",t)),this.config.lint.oxlint.allow.forEach(t=>i.push("-A",t)),this.config.lint.oxlint.warn.forEach(t=>i.push("-W",t)),!i.includes("-c")&&!i.includes("--config")){let t=getParentPath.getParentPath(this.config.lint.oxlint.configFile,this.config.projectRoot,{ignoreCase:true,skipCwd:false,includeNameInResults:true});t&&!exists.existsSync(t)&&this.config.lint.oxlint.configFile!==".oxlintrc.json"&&(t=getParentPath.getParentPath(".oxlintrc.json",this.config.projectRoot,{ignoreCase:true,skipCwd:false,includeNameInResults:true})),t&&exists.existsSync(t)&&i.push("-c",t);}if(!i.includes("--type-aware")&&this.config.lint.oxlint.typeAware&&i.push("--type-aware"),i.includes("--tsconfig")||i.push("--tsconfig",this.tsconfig.tsconfigFilePath),!i.includes("-f")&&!i.includes("--format")&&i.push("-f",this.config.lint.oxlint.format||"stylish"),this.config.lint.oxlint.fix!==false&&!i.includes("--fix")&&!i.includes("--fix-suggestions")&&!i.includes("--fix-dangerously")&&(this.config.lint.oxlint.fix===true?i.push("--fix"):this.config.lint.oxlint.fix==="suggestions"?i.push("--fix-suggestions"):this.config.lint.oxlint.fix==="dangerously"&&i.push("--fix-dangerously")),this.config.lint.oxlint.oxlintPath){i.unshift(this.config.lint.oxlint.oxlintPath,this.config.sourceRoot);const t=await execute.execute(i.join(" "),this.workspaceConfig.workspaceRoot);if(t.failed)throw new Error(`Oxlint process exited with code ${t.exitCode}.`)}else {const t=await packageFns.isPackageListed("oxlint",this.config.projectRoot);i.unshift(t?replace.replacePath(this.config.sourceRoot,this.config.projectRoot):this.config.sourceRoot);const o=await execute.executePackage("oxlint",i,t?join.joinPaths(this.workspaceConfig.workspaceRoot,this.config.projectRoot):this.workspaceConfig.workspaceRoot);if(o.failed)throw new Error(`Oxlint process exited with code ${o.exitCode}.`)}}}}chunkFBBMZ4NC_cjs.a(u,"plugin");var A=u;exports.default=A;exports.plugin=u;Object.keys(types).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return types[k]}})});
|
|
1
|
+
Object.defineProperty(exports,`__esModule`,{value:!0}),require(`./plugin-DHXHjv16.cjs`),require(`./types-DHkg7xmX.cjs`);let e=require(`@storm-software/config-tools/types`),t=require(`@stryke/cli/execute`),n=require(`@stryke/convert/to-array`),r=require(`@stryke/fs/exists`),i=require(`@stryke/fs/get-parent-path`),a=require(`@stryke/fs/package-fns`),o=require(`@stryke/path/join`),s=require(`@stryke/path/replace`);function c(c={}){return{name:`oxlint`,async config(){return this.log(e.LogLevelLabel.TRACE,"Providing default configuration for the Powerlines `oxlint` linting plugin."),{lint:{oxlint:{configFile:`.oxlintrc.json`,deny:[],allow:[],warn:[],typeAware:!0,fix:!0,format:`stylish`,...c}}}},configResolved(){this.devDependencies.oxlint=`^1.24.0`,this.config.lint.oxlint.typeAware&&(this.devDependencies[`oxlint-tsgolint`]=`^0.2.1`)},async lint(){this.log(e.LogLevelLabel.TRACE,`Linting project files with Oxlint.`);let c=[];if(this.config.lint.oxlint.params&&c.push(...this.config.lint.oxlint.params.split(` `).filter(Boolean)),!c.includes(`--ignore-pattern`)&&this.config.lint.oxlint.ignorePatterns&&c.push(`--ignore-pattern=${(0,n.toArray)(this.config.lint.oxlint.ignorePatterns).join(`,`)}`),this.config.lint.oxlint.deny.forEach(e=>c.push(`-D`,e)),this.config.lint.oxlint.allow.forEach(e=>c.push(`-A`,e)),this.config.lint.oxlint.warn.forEach(e=>c.push(`-W`,e)),!c.includes(`-c`)&&!c.includes(`--config`)){let e=(0,i.getParentPath)(this.config.lint.oxlint.configFile,this.config.projectRoot,{ignoreCase:!0,skipCwd:!1,includeNameInResults:!0});e&&!(0,r.existsSync)(e)&&this.config.lint.oxlint.configFile!==`.oxlintrc.json`&&(e=(0,i.getParentPath)(`.oxlintrc.json`,this.config.projectRoot,{ignoreCase:!0,skipCwd:!1,includeNameInResults:!0})),e&&(0,r.existsSync)(e)&&c.push(`-c`,e)}if(!c.includes(`--type-aware`)&&this.config.lint.oxlint.typeAware&&c.push(`--type-aware`),c.includes(`--tsconfig`)||c.push(`--tsconfig`,this.tsconfig.tsconfigFilePath),!c.includes(`-f`)&&!c.includes(`--format`)&&c.push(`-f`,this.config.lint.oxlint.format||`stylish`),this.config.lint.oxlint.fix!==!1&&!c.includes(`--fix`)&&!c.includes(`--fix-suggestions`)&&!c.includes(`--fix-dangerously`)&&(this.config.lint.oxlint.fix===!0?c.push(`--fix`):this.config.lint.oxlint.fix===`suggestions`?c.push(`--fix-suggestions`):this.config.lint.oxlint.fix===`dangerously`&&c.push(`--fix-dangerously`)),this.config.lint.oxlint.oxlintPath){c.unshift(this.config.lint.oxlint.oxlintPath,this.config.sourceRoot);let e=await(0,t.execute)(c.join(` `),this.workspaceConfig.workspaceRoot);if(e.failed)throw Error(`Oxlint process exited with code ${e.exitCode}.`)}else{let e=await(0,a.isPackageListed)(`oxlint`,this.config.projectRoot);c.unshift(e?(0,s.replacePath)(this.config.sourceRoot,this.config.projectRoot):this.config.sourceRoot);let n=await(0,t.executePackage)(`oxlint`,c,e?(0,o.joinPaths)(this.workspaceConfig.workspaceRoot,this.config.projectRoot):this.workspaceConfig.workspaceRoot);if(n.failed)throw Error(`Oxlint process exited with code ${n.exitCode}.`)}}}}var l=c;exports.default=l,exports.plugin=c;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,30 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import '@storm-software/config/types';
|
|
6
|
-
import '@stryke/types/base';
|
|
7
|
-
import '@stryke/types/configuration';
|
|
8
|
-
import '@stryke/types/file';
|
|
9
|
-
import 'vite';
|
|
10
|
-
import '@stryke/env/get-env-paths';
|
|
11
|
-
import '@stryke/http/fetch';
|
|
12
|
-
import '@stryke/types/package-json';
|
|
13
|
-
import 'jiti';
|
|
14
|
-
import 'magic-string';
|
|
15
|
-
import 'oxc-parser';
|
|
16
|
-
import 'semver';
|
|
17
|
-
import 'ts-morph';
|
|
18
|
-
import 'undici';
|
|
19
|
-
import 'unplugin';
|
|
20
|
-
import '@stryke/fs/resolve';
|
|
21
|
-
import '@stryke/types/tsconfig';
|
|
22
|
-
import 'typescript';
|
|
23
|
-
import '@stryke/types/array';
|
|
1
|
+
import { a as __ΩOxlintPluginContext, c as __ΩOxlintPluginUserConfig, i as OxlintPluginUserConfig, l as Plugin, n as OxlintPluginOptions, o as __ΩOxlintPluginOptions, r as OxlintPluginResolvedConfig, s as __ΩOxlintPluginResolvedConfig, t as OxlintPluginContext } from "./plugin-_GgXchca.cjs";
|
|
2
|
+
import "./index-D6CnpA_r.cjs";
|
|
3
|
+
|
|
4
|
+
//#region src/index.d.ts
|
|
24
5
|
|
|
25
6
|
/**
|
|
26
7
|
* A Powerlines plugin to assist in linting a project with Biome.
|
|
27
8
|
*/
|
|
28
9
|
declare function plugin(options?: OxlintPluginOptions): Plugin<OxlintPluginContext>;
|
|
29
|
-
|
|
30
|
-
export { OxlintPluginContext, OxlintPluginOptions, plugin as default, plugin };
|
|
10
|
+
//#endregion
|
|
11
|
+
export { OxlintPluginContext, OxlintPluginOptions, OxlintPluginResolvedConfig, OxlintPluginUserConfig, __ΩOxlintPluginContext, __ΩOxlintPluginOptions, __ΩOxlintPluginResolvedConfig, __ΩOxlintPluginUserConfig, plugin as default, plugin };
|
|
12
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;AAkCA;;AAEU,iBAFM,MAAA,CAEN,OAAA,CAAA,EADC,mBACD,CAAA,EAAP,MAAO,CAAA,mBAAA,CAAA"}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { a as __ΩOxlintPluginContext, c as __ΩOxlintPluginUserConfig, i as OxlintPluginUserConfig, l as Plugin, n as OxlintPluginOptions, o as __ΩOxlintPluginOptions, r as OxlintPluginResolvedConfig, s as __ΩOxlintPluginResolvedConfig, t as OxlintPluginContext } from "./plugin-C8gl34-_.mjs";
|
|
2
|
+
import "./index-D-CYNcT9.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/index.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A Powerlines plugin to assist in linting a project with Biome.
|
|
8
|
+
*/
|
|
9
|
+
declare function plugin(options?: OxlintPluginOptions): Plugin<OxlintPluginContext>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { OxlintPluginContext, OxlintPluginOptions, OxlintPluginResolvedConfig, OxlintPluginUserConfig, __ΩOxlintPluginContext, __ΩOxlintPluginOptions, __ΩOxlintPluginResolvedConfig, __ΩOxlintPluginUserConfig, plugin as default, plugin };
|
|
12
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;AAkCA;;AAEU,iBAFM,MAAA,CAEN,OAAA,CAAA,EADC,mBACD,CAAA,EAAP,MAAO,CAAA,mBAAA,CAAA"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./plugin-DzeYlbKJ.mjs";import"./types-BKeuN6sy.mjs";import{LogLevelLabel as e}from"@storm-software/config-tools/types";import{execute as t,executePackage as n}from"@stryke/cli/execute";import{toArray as r}from"@stryke/convert/to-array";import{existsSync as i}from"@stryke/fs/exists";import{getParentPath as a}from"@stryke/fs/get-parent-path";import{isPackageListed as o}from"@stryke/fs/package-fns";import{joinPaths as s}from"@stryke/path/join";import{replacePath as c}from"@stryke/path/replace";function l(l={}){return{name:`oxlint`,async config(){return this.log(e.TRACE,"Providing default configuration for the Powerlines `oxlint` linting plugin."),{lint:{oxlint:{configFile:`.oxlintrc.json`,deny:[],allow:[],warn:[],typeAware:!0,fix:!0,format:`stylish`,...l}}}},configResolved(){this.devDependencies.oxlint=`^1.24.0`,this.config.lint.oxlint.typeAware&&(this.devDependencies[`oxlint-tsgolint`]=`^0.2.1`)},async lint(){this.log(e.TRACE,`Linting project files with Oxlint.`);let l=[];if(this.config.lint.oxlint.params&&l.push(...this.config.lint.oxlint.params.split(` `).filter(Boolean)),!l.includes(`--ignore-pattern`)&&this.config.lint.oxlint.ignorePatterns&&l.push(`--ignore-pattern=${r(this.config.lint.oxlint.ignorePatterns).join(`,`)}`),this.config.lint.oxlint.deny.forEach(e=>l.push(`-D`,e)),this.config.lint.oxlint.allow.forEach(e=>l.push(`-A`,e)),this.config.lint.oxlint.warn.forEach(e=>l.push(`-W`,e)),!l.includes(`-c`)&&!l.includes(`--config`)){let e=a(this.config.lint.oxlint.configFile,this.config.projectRoot,{ignoreCase:!0,skipCwd:!1,includeNameInResults:!0});e&&!i(e)&&this.config.lint.oxlint.configFile!==`.oxlintrc.json`&&(e=a(`.oxlintrc.json`,this.config.projectRoot,{ignoreCase:!0,skipCwd:!1,includeNameInResults:!0})),e&&i(e)&&l.push(`-c`,e)}if(!l.includes(`--type-aware`)&&this.config.lint.oxlint.typeAware&&l.push(`--type-aware`),l.includes(`--tsconfig`)||l.push(`--tsconfig`,this.tsconfig.tsconfigFilePath),!l.includes(`-f`)&&!l.includes(`--format`)&&l.push(`-f`,this.config.lint.oxlint.format||`stylish`),this.config.lint.oxlint.fix!==!1&&!l.includes(`--fix`)&&!l.includes(`--fix-suggestions`)&&!l.includes(`--fix-dangerously`)&&(this.config.lint.oxlint.fix===!0?l.push(`--fix`):this.config.lint.oxlint.fix===`suggestions`?l.push(`--fix-suggestions`):this.config.lint.oxlint.fix===`dangerously`&&l.push(`--fix-dangerously`)),this.config.lint.oxlint.oxlintPath){l.unshift(this.config.lint.oxlint.oxlintPath,this.config.sourceRoot);let e=await t(l.join(` `),this.workspaceConfig.workspaceRoot);if(e.failed)throw Error(`Oxlint process exited with code ${e.exitCode}.`)}else{let e=await o(`oxlint`,this.config.projectRoot);l.unshift(e?c(this.config.sourceRoot,this.config.projectRoot):this.config.sourceRoot);let t=await n(`oxlint`,l,e?s(this.workspaceConfig.workspaceRoot,this.config.projectRoot):this.workspaceConfig.workspaceRoot);if(t.failed)throw Error(`Oxlint process exited with code ${t.exitCode}.`)}}}}var u=l;export{u as default,l as plugin};
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["args: string[]"],"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 { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport { execute, executePackage } from \"@stryke/cli/execute\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { existsSync } from \"@stryke/fs/exists\";\nimport { getParentPath } from \"@stryke/fs/get-parent-path\";\nimport { isPackageListed } from \"@stryke/fs/package-fns\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport { Plugin } from \"powerlines/types/plugin\";\nimport { OxlintPluginContext, OxlintPluginOptions } from \"./types/plugin\";\n\nexport * from \"./types\";\n\n/**\n * A Powerlines plugin to assist in linting a project with Biome.\n */\nexport function plugin(\n options: OxlintPluginOptions = {}\n): Plugin<OxlintPluginContext> {\n return {\n name: \"oxlint\",\n async config() {\n this.log(\n LogLevelLabel.TRACE,\n \"Providing default configuration for the Powerlines `oxlint` linting plugin.\"\n );\n\n return {\n lint: {\n oxlint: {\n configFile: \".oxlintrc.json\",\n deny: [],\n allow: [],\n warn: [],\n typeAware: true,\n fix: true,\n format: \"stylish\",\n ...options\n }\n }\n };\n },\n configResolved() {\n this.devDependencies.oxlint = \"^1.24.0\";\n if (this.config.lint.oxlint.typeAware) {\n this.devDependencies[\"oxlint-tsgolint\"] = \"^0.2.1\";\n }\n },\n async lint() {\n this.log(LogLevelLabel.TRACE, `Linting project files with Oxlint.`);\n\n const args: string[] = [];\n\n if (this.config.lint.oxlint.params) {\n args.push(...this.config.lint.oxlint.params.split(\" \").filter(Boolean));\n }\n\n if (\n !args.includes(\"--ignore-pattern\") &&\n this.config.lint.oxlint.ignorePatterns\n ) {\n args.push(\n `--ignore-pattern=${toArray(this.config.lint.oxlint.ignorePatterns).join(\",\")}`\n );\n }\n\n this.config.lint.oxlint.deny.forEach(d => args.push(\"-D\", d));\n this.config.lint.oxlint.allow.forEach(a => args.push(\"-A\", a));\n this.config.lint.oxlint.warn.forEach(w => args.push(\"-W\", w));\n\n if (!args.includes(\"-c\") && !args.includes(\"--config\")) {\n let configFile = getParentPath(\n this.config.lint.oxlint.configFile,\n this.config.projectRoot,\n {\n ignoreCase: true,\n skipCwd: false,\n includeNameInResults: true\n }\n );\n if (\n configFile &&\n !existsSync(configFile) &&\n this.config.lint.oxlint.configFile !== \".oxlintrc.json\"\n ) {\n configFile = getParentPath(\n \".oxlintrc.json\",\n this.config.projectRoot,\n {\n ignoreCase: true,\n skipCwd: false,\n includeNameInResults: true\n }\n );\n }\n\n if (configFile && existsSync(configFile)) {\n args.push(\"-c\", configFile);\n }\n }\n\n if (!args.includes(\"--type-aware\") && this.config.lint.oxlint.typeAware) {\n args.push(\"--type-aware\");\n }\n\n if (!args.includes(\"--tsconfig\")) {\n args.push(\"--tsconfig\", this.tsconfig.tsconfigFilePath);\n }\n\n if (!args.includes(\"-f\") && !args.includes(\"--format\")) {\n args.push(\"-f\", this.config.lint.oxlint.format || \"stylish\");\n }\n\n if (\n this.config.lint.oxlint.fix !== false &&\n !args.includes(\"--fix\") &&\n !args.includes(\"--fix-suggestions\") &&\n !args.includes(\"--fix-dangerously\")\n ) {\n if (this.config.lint.oxlint.fix === true) {\n args.push(\"--fix\");\n } else if (this.config.lint.oxlint.fix === \"suggestions\") {\n args.push(\"--fix-suggestions\");\n } else if (this.config.lint.oxlint.fix === \"dangerously\") {\n args.push(\"--fix-dangerously\");\n }\n }\n\n if (!this.config.lint.oxlint.oxlintPath) {\n const isOxlintListed = await isPackageListed(\n \"oxlint\",\n this.config.projectRoot\n );\n\n args.unshift(\n isOxlintListed\n ? replacePath(this.config.sourceRoot, this.config.projectRoot)\n : this.config.sourceRoot\n );\n\n const result = await executePackage(\n \"oxlint\",\n args,\n isOxlintListed\n ? joinPaths(\n this.workspaceConfig.workspaceRoot,\n this.config.projectRoot\n )\n : this.workspaceConfig.workspaceRoot\n );\n if (result.failed) {\n throw new Error(\n `Oxlint process exited with code ${result.exitCode}.`\n );\n }\n } else {\n args.unshift(\n this.config.lint.oxlint.oxlintPath,\n this.config.sourceRoot\n );\n\n const result = await execute(\n args.join(\" \"),\n this.workspaceConfig.workspaceRoot\n );\n if (result.failed) {\n throw new Error(\n `Oxlint process exited with code ${result.exitCode}.`\n );\n }\n }\n }\n };\n}\n\nexport default plugin;\n"],"mappings":"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"}
|