@travetto/lint 8.0.0-alpha.24 → 8.0.0-alpha.26

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.24",
3
+ "version": "8.0.0-alpha.26",
4
4
  "type": "module",
5
5
  "description": "Linting and Formatting integration for Travetto",
6
6
  "keywords": [
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@travetto/runtime": "^8.0.0-alpha.22",
30
- "@biomejs/biome": "^2.5.5"
30
+ "@biomejs/biome": "^2.5.8"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@travetto/cli": "^8.0.0-alpha.31"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "root": false,
3
- "$schema": "https://biomejs.dev/schemas/2.5.4/schema.json",
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",
@@ -82,10 +82,11 @@
82
82
  }
83
83
  },
84
84
  "complexity": {
85
+ "noUselessSwitchCase": "off",
85
86
  "useArrowFunction": "off",
86
87
  "noStaticOnlyClass": "off",
87
88
  "noThisInStatic": "off",
88
- "noBannedTypes": "off",
89
+ "noBannedTypes": "off"
89
90
  },
90
91
  "suspicious": {
91
92
  "noVar": "error",
@@ -123,12 +124,11 @@
123
124
  "linter": {
124
125
  "rules": {
125
126
  "complexity": {
126
- "noUselessConstructor": "off",
127
- "noUselessSwitchCase": "off"
127
+ "noUselessConstructor": "off"
128
128
  },
129
129
  "correctness": {
130
130
  "noUnusedVariables": "off",
131
- "noUnusedFunctionParameters": "off",
131
+ "noUnusedFunctionParameters": "off"
132
132
  },
133
133
  "security": {
134
134
  "noBlankTarget": "off"
@@ -143,4 +143,4 @@
143
143
  }
144
144
  }
145
145
  ]
146
- }
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.jsonc` to extend the framework-provided rules configuration.
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 content = `{
15
- "$schema": "https://biomejs.dev/schemas/2.5.4/schema.json",
16
- "extends": ["./node_modules/@travetto/lint/resources/biome.jsonc"]
17
- }
18
- `;
19
- const output = Runtime.workspaceRelative('biome.jsonc');
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}`);