@adamhl8/configs 0.9.0 → 0.9.1

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.
@@ -0,0 +1,13 @@
1
+ predicate is_relative_import($source) { $source <: r"^\"\.\.?.*" }
2
+ predicate register_diagnostic($span, $message) {}
3
+ predicate register_import_diagnostic($source) {
4
+ register_diagnostic(span=$source, message="This relative import should use a path alias")
5
+ }
6
+
7
+ any {
8
+ `import $_ from $source` where { is_relative_import($source), register_import_diagnostic($source) },
9
+ `import type $_ from $source` where { is_relative_import($source), register_import_diagnostic($source) },
10
+ // https://github.com/honeycombio/gritql/issues/653
11
+ `export $_ from $source` as $exportStatement where { log(message="This is a debug log", variable=$exportStatement) },
12
+ `export type $_ from $source` where { is_relative_import($source), register_import_diagnostic($source) }
13
+ }
@@ -2,7 +2,9 @@
2
2
  "$schema": "https://biomejs.dev/schemas/latest/schema.json",
3
3
  "root": false,
4
4
  // https://github.com/biomejs/biome/issues/6676
5
- // "plugins": ["./biome-plugins/import-paths.grit"],
5
+ // Extending this config from the root config of this project causes an error because the plugin files do not exist in 'node_modules'. i.e. the whole 'node_modules/@adamhl8/configs' directory does not exist
6
+ // As a workaround, we use the prepare script to manually copy the './configs/biome-plugins/' directory to the correct location in 'node_modules'.
7
+ "plugins": ["./node_modules/@adamhl8/configs/dist/biome-plugins/import-paths.grit"],
6
8
  "vcs": {
7
9
  "enabled": true,
8
10
  "clientKind": "git",
@@ -37,6 +39,7 @@
37
39
  "noGlobalDirnameFilename": "on",
38
40
  "noImplicitCoercion": "on",
39
41
  "noImportCycles": "on",
42
+ "noMisusedPromises": "on",
40
43
  "noNestedComponentDefinitions": "on",
41
44
  "noNoninteractiveElementInteractions": "on",
42
45
  "noProcessGlobal": "on",
package/dist/prettier.js CHANGED
@@ -2,7 +2,7 @@ const config = {
2
2
  printWidth: 120,
3
3
  semi: false,
4
4
  plugins: [
5
- // "@prettier/plugin-xml", currently broken
5
+ "@prettier/plugin-xml",
6
6
  "prettier-plugin-sh",
7
7
  "prettier-plugin-toml",
8
8
  "prettier-plugin-astro",
@@ -1 +1 @@
1
- {"version":3,"file":"prettier.js","sourceRoot":"","sources":["../configs/prettier.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,GAAW;IACrB,UAAU,EAAE,GAAG;IACf,IAAI,EAAE,KAAK;IACX,OAAO,EAAE;QACP,2CAA2C;QAC3C,oBAAoB;QACpB,sBAAsB;QACtB,uBAAuB;QACvB,6BAA6B;KAC9B;IACD,kBAAkB,EAAE,kBAAkB;IACtC,SAAS,EAAE;QACT;YACE,oDAAoD;YACpD,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE;gBACP,aAAa,EAAE,MAAM;aACtB;SACF;QACD;YACE,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE;gBACP,MAAM,EAAE,OAAO;aAChB;SACF;KACF;CACF,CAAA;AAED,eAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"prettier.js","sourceRoot":"","sources":["../configs/prettier.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,GAAW;IACrB,UAAU,EAAE,GAAG;IACf,IAAI,EAAE,KAAK;IACX,OAAO,EAAE;QACP,sBAAsB;QACtB,oBAAoB;QACpB,sBAAsB;QACtB,uBAAuB;QACvB,6BAA6B;KAC9B;IACD,kBAAkB,EAAE,kBAAkB;IACtC,SAAS,EAAE;QACT;YACE,oDAAoD;YACpD,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE;gBACP,aAAa,EAAE,MAAM;aACtB;SACF;QACD;YACE,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE;gBACP,MAAM,EAAE,OAAO;aAChB;SACF;KACF;CACF,CAAA;AAED,eAAe,MAAM,CAAA"}
@@ -10,8 +10,8 @@
10
10
  "verbatimModuleSyntax": true,
11
11
  "esModuleInterop": false,
12
12
  "allowSyntheticDefaultImports": false,
13
- // Need to use '.js' extensions in packages until the following issue is resolved: https://github.com/microsoft/TypeScript/issues/61991
14
- // For non-packages, we need to set 'rewriteRelativeImportExtensions' to false and 'noEmit' to true
13
+ // Need to use '.js' extensions in packages. See: https://github.com/microsoft/TypeScript/issues/61991
14
+ // For non-packages (or anything we don't compile with tsc), we need to set 'rewriteRelativeImportExtensions' to false and 'noEmit' to true
15
15
  "allowImportingTsExtensions": true,
16
16
  "rewriteRelativeImportExtensions": true,
17
17
  "resolveJsonModule": true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adamhl8/configs",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -18,7 +18,7 @@
18
18
  "license": "MIT",
19
19
  "exports": {
20
20
  "./tsconfig": "./dist/tsconfig.json",
21
- "./biome": "./dist/biome.jsonc",
21
+ "./biome": "./dist/biome.base.jsonc",
22
22
  "./prettier": {
23
23
  "import": "./dist/prettier.js",
24
24
  "types": "./dist/types/prettier.d.ts"
@@ -26,20 +26,21 @@
26
26
  },
27
27
  "files": ["dist/"],
28
28
  "scripts": {
29
- "bundle": "rm -rf ./dist && bun lint && tsc && tsc-alias && cp ./configs/*.{json,jsonc} ./dist/",
29
+ "bundle": "rm -rf ./dist && bun lint && tsc && tsc-alias && cp -r ./configs/*.{json,jsonc} ./configs/biome-plugins/ ./dist/",
30
+ "copy-biome-plugins": "mkdir -p ./node_modules/@adamhl8/configs/dist/ && cp -r ./configs/biome-plugins/ ./node_modules/@adamhl8/configs/dist/",
30
31
  "lint": "tsc --noEmit && biome check --write",
31
- "prepare": "find .githooks -type f -exec ln -srf {} .git/hooks/ \\; || true",
32
+ "prepare": "bun copy-biome-plugins && find .githooks -type f -exec ln -srf {} .git/hooks/ \\; || true",
32
33
  "prepublishOnly": "bun bundle"
33
34
  },
34
35
  "dependencies": {
35
- "@prettier/plugin-xml": "^3.4.1",
36
+ "@prettier/plugin-xml": "^3.4.2",
36
37
  "prettier-plugin-astro": "^0.14.1",
37
38
  "prettier-plugin-sh": "^0.18.0",
38
39
  "prettier-plugin-tailwindcss": "^0.6.13",
39
40
  "prettier-plugin-toml": "^2.0.5"
40
41
  },
41
42
  "devDependencies": {
42
- "@biomejs/biome": "^2.0.6",
43
+ "@biomejs/biome": "^2.1.1",
43
44
  "@types/bun": "^1.2.18",
44
45
  "prettier": "^3.6.2",
45
46
  "tsc-alias": "^1.8.16",