@kitschpatrol/eslint-config 7.6.2 → 7.6.4
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/bin/cli.js +1 -1
- package/dist/index.d.ts +33 -0
- package/package.json +20 -20
package/bin/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{cosmiconfig as e}from"cosmiconfig";import{TypeScriptLoader as t}from"cosmiconfig-typescript-loader";import{execa as n}from"execa";import r from"fs-extra";import i from"node:fs";import a from"node:path";import{PassThrough as o,Transform as s}from"node:stream";import{fileURLToPath as c}from"node:url";import{packageUp as l,packageUpSync as u}from"package-up";import d from"picocolors";import f from"yargs";import{hideBin as p}from"yargs/helpers";import m from"@pinojs/json-colorizer";import h from"decircular";import g from"deepmerge";import _ from"json-stringify-pretty-compact";import{findWorkspacesRoot as v}from"find-workspaces";import y from"node:fs/promises";import{stripVTControlCharacters as b}from"node:util";var x=`7.6.
|
|
2
|
+
import{cosmiconfig as e}from"cosmiconfig";import{TypeScriptLoader as t}from"cosmiconfig-typescript-loader";import{execa as n}from"execa";import r from"fs-extra";import i from"node:fs";import a from"node:path";import{PassThrough as o,Transform as s}from"node:stream";import{fileURLToPath as c}from"node:url";import{packageUp as l,packageUpSync as u}from"package-up";import d from"picocolors";import f from"yargs";import{hideBin as p}from"yargs/helpers";import m from"@pinojs/json-colorizer";import h from"decircular";import g from"deepmerge";import _ from"json-stringify-pretty-compact";import{findWorkspacesRoot as v}from"find-workspaces";import y from"node:fs/promises";import{stripVTControlCharacters as b}from"node:util";var x=`7.6.4`;function S(e){return e instanceof Error&&`exitCode`in e&&typeof e.exitCode==`number`}function C(e){return m(_(h(e),{indent:2,replacer(e,t){return typeof t==`function`?t.name:t}}),{colors:{BRACKET:`gray`}})}const w=(e,t,n)=>{let r=[...e];for(let[i,a]of t.entries())r[i]===void 0?r[i]=n.cloneUnlessOtherwiseSpecified(a,n):n.isMergeableObject(a)?r[i]=T(e[i],a,n):e.includes(a)||r.push(a);return r};function T(e,t,n={arrayMerge:w}){return g(e,t,n)}function E(){let e=u();if(e===void 0)throw Error(`No package.json found.`);return a.dirname(e)}function D(){let e=v();return e===null?E():a.resolve(e.location)}function O(e){if(e===`workspace-root`)return D();if(e===`package-dir`)return E();if(typeof e==`string`){if(!r.pathExistsSync(e))throw Error(`Custom cwd directory does not exist: ${e}`);return e}return process.cwd()}async function k(e,t){try{let{default:n}=await import(`prettier`),r=await n.resolveConfig(e),i=await n.format(t,{filepath:e,...r});await y.writeFile(e,i,`utf8`)}catch{console.warn(`Skipped formatting ${e} since Prettier is not installed.`)}}async function A(e){try{await k(e,await y.readFile(e,`utf8`))}catch{}}const j=/\r?\n/;function M(e){return new s({transform(t,n,r){let i=t.toString().split(j).filter(t=>t.trim()!==``&&!e(b(t))).join(`
|
|
3
3
|
`);this.push(i+`
|
|
4
4
|
`),r()}})}function N(e,t){return new s({transform(n,r,i){let a=n.toString().split(j).filter(e=>e.trim().length>0).map(n=>`${e?t===void 0?e:d[t](e):``} ${n}\n`).join(``);this.push(a),i()}})}async function P(e){let t=[];return new Promise((n,r)=>{e.on(`data`,e=>t.push(e)),e.on(`error`,e=>{r(e)}),e.on(`end`,()=>{n(Buffer.concat(t).toString(`utf8`))})})}function F(e,t){return t===1?e:e+`s`}async function I(e,t,n,r,i){let a=1,o;if(r.logPrefix===void 0)o=e;else{let t=N(r.logPrefix,r.logColor);t.pipe(e),o=t}i&&o.write(d.bold(`Running: "${r.name}() with Positional arguments: ${String(t)} and Option flags: ${String(n)}"`));try{a=await r.execute(o,t,n)}catch(e){console.error(String(e)),a=1}return a}async function L(e,t,r,i,a){let s=1,c;if(i.logPrefix===void 0)c=e;else{let t=N(i.logPrefix,i.logColor);t.pipe(e),c=t}let l=i.subcommands??[],u=[...i.receivePositionalArguments?t:[],...i.positionalArguments??[]],d=[...i.receiveOptionFlags?r:[],...i.optionFlags??[]],f=[...l,...d,...u],p=O(i.cwdOverride);a&&c.write(`Running: "${i.name} ${f.join(` `)}"`);let m=i.prettyJsonOutput?new o:c;try{let e=n(i.name,f,{cwd:p,env:{...process.env.NO_COLOR===void 0?{FORCE_COLOR:`true`}:{}},preferLocal:!0,reject:!1,stdin:`inherit`});if(i.outputFilter){let t=M(i.outputFilter),n=M(i.outputFilter);e.stdout.pipe(t).pipe(m,{end:!1}),e.stderr.pipe(n).pipe(m,{end:!1})}else e.stdout.pipe(m,{end:!1}),e.stderr.pipe(m,{end:!1});if(await e,i.prettyJsonOutput){m.end();let e=await P(m),t=C(JSON.parse(e)).split(`
|
|
5
5
|
`);for(let e of t)c.write(`${e}\n`)}s=e.exitCode??1}catch(e){console.error(`${i.name} failed with error:`),console.error(e),S(e)&&(s=typeof e.exitCode==`number`?e.exitCode:1)}return s}function R(e){return`execute`in e}const z=/^ksc-/;function B(e){return e.replace(z,``)}function V(e){return e===void 0||e.length===0?[]:e.flatMap(e=>e.split(`,`)).map(e=>B(e.trim()))}function H(e){return e.option(`skip`,{array:!0,describe:`Tool names to skip (with or without "ksc-" prefix).`,type:`string`})}async function U(e,t,n,r,i,a,o){let s=o??[],c=[],l=[];for(let e of r)s.length>0&&s.includes(B(e.name))?l.push(e):c.push(e);if(s.length>0){let t=new Set(l.map(e=>B(e.name))),n=s.filter(e=>!t.has(e));if(n.length>0){let t=r.map(e=>B(e.name)).join(`, `);e.write(`⚠️ ${d.yellow(`Unrecognized --skip ${F(`value`,n.length)}: ${n.join(`, `)}. Available: ${t}`)}\n`)}}let u=[];for(let r of c){let a=await(R(r)?I(e,t,n,r,i):L(e,t,n,r,i));u.push({exitCode:a,name:r.name})}let f=r.length;if(l.length>0){let t=l.map(({name:e})=>e);e.write(`⏭️ ${d.dim(d.bold(`${t.length} / ${f} ${F(`Command`,t.length)} Skipped:`))} ${d.dim(t.join(`, `))}\n`)}if(a){let t=u.filter(({exitCode:e})=>e===0).map(({name:e})=>e),n=u.filter(({exitCode:e})=>e!==0).map(({name:e})=>e);t.length>0&&e.write(`✅ ${d.green(d.bold(`${t.length} / ${f} ${F(`Command`,t.length)} Succeeded:`))} ${d.green(t.join(`, `))}\n`),n.length>0&&e.write(`❌ ${d.red(d.bold(`${n.length} / ${f} ${F(`Command`,n.length)} Failed:`))} ${d.red(n.join(`, `))}\n`)}return+!u.every(({exitCode:e})=>e===0)}async function W(e,t,n,o){let s=await l();if(s===void 0)throw Error("The `init` command must be used in a directory with a package.json file");let u=await l({cwd:c(import.meta.url)});if(u===void 0)return e.write(`Error: The script being called was not in a package, weird.
|
package/dist/index.d.ts
CHANGED
|
@@ -2053,6 +2053,13 @@ interface RuleOptions {
|
|
|
2053
2053
|
* @see https://eslint-plugin-package-json.dev/rules/no-empty-fields
|
|
2054
2054
|
*/
|
|
2055
2055
|
'json-package/no-empty-fields'?: Linter.RuleEntry<JsonPackageNoEmptyFields>;
|
|
2056
|
+
/**
|
|
2057
|
+
* Requires that dependencies do not use local file paths, which will likely
|
|
2058
|
+
* result in errors when installing from a registry.
|
|
2059
|
+
*
|
|
2060
|
+
* @see https://eslint-plugin-package-json.dev/rules/no-local-dependencies
|
|
2061
|
+
*/
|
|
2062
|
+
'json-package/no-local-dependencies'?: Linter.RuleEntry<JsonPackageNoLocalDependencies>;
|
|
2056
2063
|
/**
|
|
2057
2064
|
* Prevents adding unnecessary / redundant files.
|
|
2058
2065
|
*
|
|
@@ -2265,6 +2272,12 @@ interface RuleOptions {
|
|
|
2265
2272
|
* @see https://eslint-plugin-package-json.dev/rules/require-properties/require-peerDependencies
|
|
2266
2273
|
*/
|
|
2267
2274
|
'json-package/require-peerDependencies'?: Linter.RuleEntry<JsonPackageRequirePeerDependencies>;
|
|
2275
|
+
/**
|
|
2276
|
+
* Requires the `peerDependenciesMeta` property to be present.
|
|
2277
|
+
*
|
|
2278
|
+
* @see https://eslint-plugin-package-json.dev/rules/require-properties/require-peerDependenciesMeta
|
|
2279
|
+
*/
|
|
2280
|
+
'json-package/require-peerDependenciesMeta'?: Linter.RuleEntry<JsonPackageRequirePeerDependenciesMeta>;
|
|
2268
2281
|
/**
|
|
2269
2282
|
* Requires the `private` property to be present.
|
|
2270
2283
|
*
|
|
@@ -7060,6 +7073,12 @@ interface RuleOptions {
|
|
|
7060
7073
|
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-navigation-without-resolve/
|
|
7061
7074
|
*/
|
|
7062
7075
|
'svelte/no-navigation-without-resolve'?: Linter.RuleEntry<SvelteNoNavigationWithoutResolve>;
|
|
7076
|
+
/**
|
|
7077
|
+
* Disallow `<style>` elements nested inside other elements or blocks
|
|
7078
|
+
*
|
|
7079
|
+
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-nested-style-tag/
|
|
7080
|
+
*/
|
|
7081
|
+
'svelte/no-nested-style-tag'?: Linter.RuleEntry<[]>;
|
|
7063
7082
|
/**
|
|
7064
7083
|
* Disallow use of not function in event handler
|
|
7065
7084
|
*
|
|
@@ -7201,6 +7220,12 @@ interface RuleOptions {
|
|
|
7201
7220
|
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/prefer-const/
|
|
7202
7221
|
*/
|
|
7203
7222
|
'svelte/prefer-const'?: Linter.RuleEntry<SveltePreferConst>;
|
|
7223
|
+
/**
|
|
7224
|
+
* Disallow unnecessary `$derived.by()` when `$derived()` is sufficient
|
|
7225
|
+
*
|
|
7226
|
+
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/prefer-derived-over-derived-by/
|
|
7227
|
+
*/
|
|
7228
|
+
'svelte/prefer-derived-over-derived-by'?: Linter.RuleEntry<[]>;
|
|
7204
7229
|
/**
|
|
7205
7230
|
* Destructure values from object stores for better change tracking & fewer
|
|
7206
7231
|
* redraws
|
|
@@ -10337,6 +10362,7 @@ type HandleCallbackErr = [] | [string]; // ----- html/attrs-newline -----
|
|
|
10337
10362
|
type HtmlAttrsNewline = [] | [{
|
|
10338
10363
|
closeStyle?: 'newline' | 'sameline';
|
|
10339
10364
|
ifAttrsMoreThan?: number;
|
|
10365
|
+
maxLen?: number;
|
|
10340
10366
|
skip?: string[];
|
|
10341
10367
|
inline?: string[];
|
|
10342
10368
|
}]; // ----- html/element-newline -----
|
|
@@ -10432,6 +10458,7 @@ type HtmlRequireOpenGraphProtocol = [] | [string[]]; // ----- html/sort-attrs --
|
|
|
10432
10458
|
type HtmlSortAttrs = [] | [{
|
|
10433
10459
|
priority?: (string | {
|
|
10434
10460
|
pattern: string;
|
|
10461
|
+
order?: 'preserve' | 'alphabetically';
|
|
10435
10462
|
})[];
|
|
10436
10463
|
}]; // ----- html/use-baseline -----
|
|
10437
10464
|
type HtmlUseBaseline = [] | [{
|
|
@@ -11227,6 +11254,9 @@ type JsonPackageExportsSubpathsStyle = [] | [{
|
|
|
11227
11254
|
}]; // ----- json-package/no-empty-fields -----
|
|
11228
11255
|
type JsonPackageNoEmptyFields = [] | [{
|
|
11229
11256
|
ignoreProperties?: string[];
|
|
11257
|
+
}]; // ----- json-package/no-local-dependencies -----
|
|
11258
|
+
type JsonPackageNoLocalDependencies = [] | [{
|
|
11259
|
+
ignorePrivate?: boolean;
|
|
11230
11260
|
}]; // ----- json-package/order-properties -----
|
|
11231
11261
|
type JsonPackageOrderProperties = [] | [{
|
|
11232
11262
|
order?: 'sort-package-json' | string[];
|
|
@@ -11327,6 +11357,9 @@ type JsonPackageRequirePackageManager = [] | [{
|
|
|
11327
11357
|
}]; // ----- json-package/require-peerDependencies -----
|
|
11328
11358
|
type JsonPackageRequirePeerDependencies = [] | [{
|
|
11329
11359
|
ignorePrivate?: boolean;
|
|
11360
|
+
}]; // ----- json-package/require-peerDependenciesMeta -----
|
|
11361
|
+
type JsonPackageRequirePeerDependenciesMeta = [] | [{
|
|
11362
|
+
ignorePrivate?: boolean;
|
|
11330
11363
|
}]; // ----- json-package/require-publishConfig -----
|
|
11331
11364
|
type JsonPackageRequirePublishConfig = [] | [{
|
|
11332
11365
|
ignorePrivate?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kitschpatrol/eslint-config",
|
|
3
|
-
"version": "7.6.
|
|
3
|
+
"version": "7.6.4",
|
|
4
4
|
"description": "ESLint configuration for @kitschpatrol/shared-config.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"shared-config",
|
|
@@ -43,15 +43,15 @@
|
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@e18e/eslint-plugin": "^0.5.0",
|
|
46
|
-
"@eslint-community/eslint-plugin-eslint-comments": "^4.7.
|
|
46
|
+
"@eslint-community/eslint-plugin-eslint-comments": "^4.7.2",
|
|
47
47
|
"@eslint-react/eslint-plugin": "2.1.1",
|
|
48
|
-
"@html-eslint/eslint-plugin": "^0.
|
|
49
|
-
"@html-eslint/parser": "^0.
|
|
48
|
+
"@html-eslint/eslint-plugin": "^0.61.0",
|
|
49
|
+
"@html-eslint/parser": "^0.61.0",
|
|
50
50
|
"@pinojs/json-colorizer": "^4.0.0",
|
|
51
51
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
52
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
53
|
-
"@typescript-eslint/parser": "^8.
|
|
54
|
-
"@vitest/eslint-plugin": "^1.6.
|
|
52
|
+
"@typescript-eslint/eslint-plugin": "^8.60.1",
|
|
53
|
+
"@typescript-eslint/parser": "^8.60.1",
|
|
54
|
+
"@vitest/eslint-plugin": "^1.6.19",
|
|
55
55
|
"astro-eslint-parser": "^1.4.0",
|
|
56
56
|
"cosmiconfig": "^9.0.1",
|
|
57
57
|
"cosmiconfig-typescript-loader": "^6.3.0",
|
|
@@ -60,39 +60,39 @@
|
|
|
60
60
|
"eslint": "^9.39.4",
|
|
61
61
|
"eslint-config-flat-gitignore": "^2.3.0",
|
|
62
62
|
"eslint-flat-config-utils": "^3.2.0",
|
|
63
|
-
"eslint-import-resolver-typescript": "^4.4.
|
|
64
|
-
"eslint-mdx": "^3.
|
|
63
|
+
"eslint-import-resolver-typescript": "^4.4.5",
|
|
64
|
+
"eslint-mdx": "^3.8.1",
|
|
65
65
|
"eslint-plugin-astro": "^1.7.0",
|
|
66
66
|
"eslint-plugin-de-morgan": "^2.1.2",
|
|
67
67
|
"eslint-plugin-depend": "^1.5.0",
|
|
68
68
|
"eslint-plugin-html": "^8.1.4",
|
|
69
69
|
"eslint-plugin-import-x": "^4.16.2",
|
|
70
|
-
"eslint-plugin-jsdoc": "^
|
|
71
|
-
"eslint-plugin-jsonc": "^3.
|
|
70
|
+
"eslint-plugin-jsdoc": "^63.0.1",
|
|
71
|
+
"eslint-plugin-jsonc": "^3.2.0",
|
|
72
72
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
73
73
|
"eslint-plugin-math": "^0.13.1",
|
|
74
|
-
"eslint-plugin-mdx": "^3.
|
|
74
|
+
"eslint-plugin-mdx": "^3.8.1",
|
|
75
75
|
"eslint-plugin-n": "^18.0.1",
|
|
76
76
|
"eslint-plugin-no-only-tests": "^3.4.0",
|
|
77
|
-
"eslint-plugin-package-json": "^1.
|
|
77
|
+
"eslint-plugin-package-json": "^1.3.0",
|
|
78
78
|
"eslint-plugin-perfectionist": "^5.9.0",
|
|
79
79
|
"eslint-plugin-regexp": "^3.1.0",
|
|
80
|
-
"eslint-plugin-svelte": "^3.
|
|
81
|
-
"eslint-plugin-toml": "^1.
|
|
80
|
+
"eslint-plugin-svelte": "^3.19.0",
|
|
81
|
+
"eslint-plugin-toml": "^1.4.0",
|
|
82
82
|
"eslint-plugin-unicorn": "^64.0.0",
|
|
83
|
-
"eslint-plugin-yml": "^3.
|
|
83
|
+
"eslint-plugin-yml": "^3.4.0",
|
|
84
84
|
"execa": "^9.6.1",
|
|
85
85
|
"find-workspaces": "^0.3.1",
|
|
86
86
|
"fs-extra": "^11.3.5",
|
|
87
87
|
"globals": "^17.6.0",
|
|
88
88
|
"json-stringify-pretty-compact": "^4.0.0",
|
|
89
89
|
"jsonc-eslint-parser": "^3.1.0",
|
|
90
|
-
"local-pkg": "^1.1
|
|
90
|
+
"local-pkg": "^1.2.1",
|
|
91
91
|
"package-up": "^5.0.0",
|
|
92
92
|
"picocolors": "^1.1.1",
|
|
93
93
|
"prettier": "^3.8.3",
|
|
94
|
-
"sort-package-json": "^
|
|
95
|
-
"svelte-eslint-parser": "^1.
|
|
94
|
+
"sort-package-json": "^4.0.0",
|
|
95
|
+
"svelte-eslint-parser": "^1.8.0",
|
|
96
96
|
"toml-eslint-parser": "^1.0.3",
|
|
97
97
|
"yaml-eslint-parser": "^2.0.0",
|
|
98
98
|
"yargs": "^18.0.0"
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
"eslint-config-xo-typescript": "^9.0.0",
|
|
106
106
|
"eslint-typegen": "^2.3.1",
|
|
107
107
|
"globby": "^16.2.0",
|
|
108
|
-
"svelte": "^5.
|
|
108
|
+
"svelte": "^5.56.1"
|
|
109
109
|
},
|
|
110
110
|
"engines": {
|
|
111
111
|
"node": "^22.22.2 || >=24.0.0"
|