@travetto/lint 8.0.0-alpha.23 → 8.0.0-alpha.25
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/lint",
|
|
3
|
-
"version": "8.0.0-alpha.
|
|
3
|
+
"version": "8.0.0-alpha.25",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Linting and Formatting integration for Travetto",
|
|
6
6
|
"keywords": [
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@travetto/runtime": "^8.0.0-alpha.22",
|
|
30
|
-
"@biomejs/biome": "^2.5.
|
|
30
|
+
"@biomejs/biome": "^2.5.8"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@travetto/cli": "^8.0.0-alpha.
|
|
33
|
+
"@travetto/cli": "^8.0.0-alpha.31"
|
|
34
34
|
},
|
|
35
35
|
"peerDependenciesMeta": {
|
|
36
36
|
"@travetto/cli": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"root": false,
|
|
3
|
-
"$schema": "https://biomejs.dev/schemas/2.5.
|
|
3
|
+
"$schema": "https://biomejs.dev/schemas/2.5.8/schema.json",
|
|
4
4
|
"vcs": {
|
|
5
5
|
"enabled": true,
|
|
6
6
|
"clientKind": "git",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"!**/fixtures",
|
|
15
15
|
"!**/resources",
|
|
16
16
|
"!**/DOC.html",
|
|
17
|
-
"!**/.vscode"
|
|
17
|
+
"!**/.vscode"
|
|
18
18
|
]
|
|
19
19
|
},
|
|
20
20
|
"formatter": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"formatWithErrors": false,
|
|
23
23
|
"indentStyle": "space",
|
|
24
24
|
"indentWidth": 2,
|
|
25
|
-
"lineWidth": 140
|
|
25
|
+
"lineWidth": 140
|
|
26
26
|
},
|
|
27
27
|
"assist": {
|
|
28
28
|
"actions": {
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"style": {
|
|
63
63
|
"useImportType": "error",
|
|
64
64
|
"noNonNullAssertion": "off",
|
|
65
|
-
"useConst": "error"
|
|
65
|
+
"useConst": "error"
|
|
66
66
|
},
|
|
67
67
|
"correctness": {
|
|
68
68
|
"noUnusedFunctionParameters": "off",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"useArrowFunction": "off",
|
|
86
86
|
"noStaticOnlyClass": "off",
|
|
87
87
|
"noThisInStatic": "off",
|
|
88
|
-
"noBannedTypes": "off"
|
|
88
|
+
"noBannedTypes": "off"
|
|
89
89
|
},
|
|
90
90
|
"suspicious": {
|
|
91
91
|
"noVar": "error",
|
|
@@ -123,11 +123,12 @@
|
|
|
123
123
|
"linter": {
|
|
124
124
|
"rules": {
|
|
125
125
|
"complexity": {
|
|
126
|
-
"noUselessConstructor": "off"
|
|
126
|
+
"noUselessConstructor": "off",
|
|
127
|
+
"noUselessSwitchCase": "off"
|
|
127
128
|
},
|
|
128
129
|
"correctness": {
|
|
129
130
|
"noUnusedVariables": "off",
|
|
130
|
-
"noUnusedFunctionParameters": "off"
|
|
131
|
+
"noUnusedFunctionParameters": "off"
|
|
131
132
|
},
|
|
132
133
|
"security": {
|
|
133
134
|
"noBlankTarget": "off"
|
|
@@ -142,4 +143,4 @@
|
|
|
142
143
|
}
|
|
143
144
|
}
|
|
144
145
|
]
|
|
145
|
-
}
|
|
146
|
+
}
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import fs from 'node:fs/promises';
|
|
2
2
|
|
|
3
3
|
import { CliCommand, type CliCommandShape } from '@travetto/cli';
|
|
4
|
-
import { Runtime } from '@travetto/runtime';
|
|
4
|
+
import { FileLoader, JSONUtil, Runtime } from '@travetto/runtime';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Generate the workspace Biome configuration entry file.
|
|
8
8
|
*
|
|
9
|
-
* This bootstraps `biome.
|
|
9
|
+
* This bootstraps `biome.json` to extend the framework-provided rules configuration.
|
|
10
10
|
*/
|
|
11
11
|
@CliCommand({})
|
|
12
12
|
export class LintRegisterCommand implements CliCommandShape {
|
|
13
13
|
async main(): Promise<void> {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
const resource = new FileLoader([Runtime.modulePath('@travetto/lint#resources')]);
|
|
15
|
+
const config: { $schema: string } = JSONUtil.fromUTF8(await resource.readUTF8('biome.json'));
|
|
16
|
+
const content = {
|
|
17
|
+
$schema: config.$schema,
|
|
18
|
+
extends: ['./node_modules/@travetto/lint/resources/biome.json']
|
|
19
|
+
};
|
|
20
|
+
const output = Runtime.workspaceRelative('biome.json');
|
|
20
21
|
if (!(await fs.stat(output, { throwIfNoEntry: false }))) {
|
|
21
|
-
await fs.writeFile(output, content);
|
|
22
|
+
await fs.writeFile(output, JSONUtil.toUTF8Pretty(content));
|
|
22
23
|
console.log(`Wrote lint config to ${output}`);
|
|
23
24
|
} else {
|
|
24
25
|
console.log(`Lint config already present ${output}`);
|