biome-plugin-suitescript 0.0.0-stage → 0.1.0

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,14 @@
1
+ import { ast, defineRule, registerDiagnostic } from "@biomejs/runtime/plugin";
2
+ import { dependencies } from "../lib/biome-modules.js";
3
+ // Use the global `log` instead of loading N/log. The global is not available in
4
+ // client scripts, so scope this rule away from them with the plugin `includes`.
5
+ export const noLogModule = defineRule({
6
+ query: ast("JS_CALL_EXPRESSION", "JS_IMPORT"),
7
+ run(node) {
8
+ for (const { nameNode, name } of dependencies(node)) {
9
+ if (nameNode && name === "N/log") {
10
+ registerDiagnostic(nameNode, "warning", "Use global log instead of the N/log module.");
11
+ }
12
+ }
13
+ },
14
+ });
@@ -0,0 +1,12 @@
1
+ engine biome(1.0)
2
+ language js(typescript, jsx)
3
+
4
+ // Dependencies in the define() array must not carry a `.js` extension.
5
+ `define($args)` where {
6
+ $args <: contains JsArrayExpression() as $deps,
7
+ $deps <: contains JsStringLiteralExpression() as $dep where {
8
+ $dep <: r"(['\"])(.*)\.js(['\"])"($q1, $name, $q2),
9
+ register_diagnostic(span=$dep, message="Module name should not include file extension.", severity="error", fix_kind="safe"),
10
+ $dep => `$q1$name$q2`
11
+ }
12
+ }
package/package.json CHANGED
@@ -1,6 +1,83 @@
1
- {
2
- "name": "biome-plugin-suitescript",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
1
+ {
2
+ "name": "biome-plugin-suitescript",
3
+ "version": "0.1.0",
4
+ "description": "Biome lint plugins and configs for NetSuite SuiteScript 1.0/2.x, inspired by eslint-plugin-suitescript.",
5
+ "keywords": [
6
+ "biome-plugin",
7
+ "biome",
8
+ "suitescript",
9
+ "netsuite",
10
+ "lint"
11
+ ],
12
+ "homepage": "https://github.com/nemchik/biome-plugin-suitescript#readme",
13
+ "bugs": "https://github.com/nemchik/biome-plugin-suitescript/issues",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/nemchik/biome-plugin-suitescript.git"
17
+ },
18
+ "license": "MIT",
19
+ "author": "Eric Nemchik",
20
+ "type": "module",
21
+ "exports": {
22
+ "./schema.json": "./schema.json",
23
+ "biome": "./biome-manifest.json"
24
+ },
25
+ "bin": {
26
+ "biome-plugin-suitescript": "./dist/bin/biome-plugin-suitescript.js"
27
+ },
28
+ "files": [
29
+ "biome-manifest.json",
30
+ "configs",
31
+ "dist",
32
+ "schema.json",
33
+ "README.md",
34
+ "LICENSE"
35
+ ],
36
+ "scripts": {
37
+ "prebuild": "node -e \"require(\\\"node:fs\\\").rmSync(\\\"dist\\\",{recursive:true,force:true})\"",
38
+ "build": "tsc -p tsconfig.build.json && node scripts/build-manifest.ts",
39
+ "check": "biome check",
40
+ "preformat": "npm run typecheck",
41
+ "format": "biome check --write",
42
+ "lint": "biome lint",
43
+ "prepack": "npm run build",
44
+ "sync-modules": "node scripts/sync-modules.ts",
45
+ "pretest": "npm run build",
46
+ "test": "node --test test/*.test.ts",
47
+ "typecheck": "tsc"
48
+ },
49
+ "dependencies": {
50
+ "oxc-parser": "^0.156.0",
51
+ "tinyglobby": "^0.2.17"
52
+ },
53
+ "devDependencies": {
54
+ "@biomejs/biome": "2.6.4",
55
+ "@biomejs/runtime": "2.6.4",
56
+ "@hitc/netsuite-types": "2026.2.4",
57
+ "@types/node": "24.19.2",
58
+ "git-pull-run": "2.1.0",
59
+ "lefthook": "2.2.2",
60
+ "typescript": "7.0.2"
61
+ },
62
+ "peerDependencies": {
63
+ "@biomejs/biome": "^2.6.4"
64
+ },
65
+ "engines": {
66
+ "node": ">=24"
67
+ },
68
+ "devEngines": {
69
+ "runtime": {
70
+ "name": "node",
71
+ "version": "24.22.2",
72
+ "onFail": "error"
73
+ },
74
+ "packageManager": {
75
+ "name": "npm",
76
+ "version": "12.2.1",
77
+ "onFail": "warn"
78
+ }
79
+ },
80
+ "allowScripts": {
81
+ "lefthook": true
82
+ }
83
+ }
package/schema.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "$id": "https://github.com/nemchik/biome-plugin-suitescript/schema.json",
3
+ "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "additionalProperties": false,
5
+ "description": "Configuration for the `biome-plugin-suitescript check` command.",
6
+ "properties": {
7
+ "$schema": { "type": "string" },
8
+ "includes": {
9
+ "description": "Glob patterns of SuiteScript source files to check: files deployed to the file cabinet, or the sources they are transpiled from (not the transpiled output). Prefix a pattern with ! to exclude, as in Biome's `includes`.",
10
+ "examples": [
11
+ ["src/TypeScripts/**/*.{js,ts}", "!**/*.d.ts", "!**/*.test.*"]
12
+ ],
13
+ "items": { "minLength": 1, "type": "string" },
14
+ "minItems": 1,
15
+ "type": "array"
16
+ }
17
+ },
18
+ "required": ["includes"],
19
+ "title": "biome-plugin-suitescript configuration",
20
+ "type": "object"
21
+ }