biome-plugin-suitescript 0.4.0 → 0.5.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.
- package/README.md +80 -73
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
Requires Biome **>= 2.6.4** (npm-distributed plugins use `biome-manifest.json`) and Node >= 24 for the CLI. Node 24 LTS is also what Oracle's
|
|
12
12
|
[SuiteCloud CLI for Node.js requires](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_1558708810.html).
|
|
13
13
|
Rules work on both AMD `define()` and ES `import`/`export` source, in `.js` and `.ts`.
|
|
14
|
+
Coming from the ESLint plugins? See [Migrating from the ESLint plugins](docs/migrating-from-eslint.md).
|
|
15
|
+
Want to see it run first? Open the [example project](https://github.com/nemchik/biome-plugin-suitescript-example) in GitHub Codespaces, or use it as a template for your own.
|
|
14
16
|
|
|
15
17
|
## Install
|
|
16
18
|
|
|
@@ -62,78 +64,78 @@ decided is in [docs/rule-priority.md](docs/rule-priority.md).
|
|
|
62
64
|
|
|
63
65
|
<!-- rules-table:start -->
|
|
64
66
|
|
|
65
|
-
| Rule
|
|
66
|
-
|
|
|
67
|
-
| `noBrowserGlobals`
|
|
68
|
-
| `noGlobalShadowing`
|
|
69
|
-
| `noMissingModules`
|
|
70
|
-
| `noModuleScopeApiCalls`
|
|
71
|
-
| `noNativeIterators`
|
|
72
|
-
| `noSuiteQLTypeInSearch`
|
|
73
|
-
| `noSuiteScript1Api`
|
|
74
|
-
| `noHardcodedSecrets`
|
|
75
|
-
| `noDynamicRequire`
|
|
76
|
-
| `noDynamicSuiteQL`
|
|
77
|
-
| `noInnerHtml`
|
|
78
|
-
| `noPostMessageWildcard`
|
|
79
|
-
| `noWildcardCors`
|
|
80
|
-
| `requireEachReturn`
|
|
81
|
-
| `noRecordInLoop`
|
|
82
|
-
| `requireLogModule`
|
|
83
|
-
| `noInsecureCookie`
|
|
84
|
-
| `noLocationHeader`
|
|
85
|
-
| `noPublicFileUpload`
|
|
86
|
-
| `noSensitiveBrowserStorage`
|
|
87
|
-
| `noStackInResponse`
|
|
88
|
-
| `noSuiteQLSelectStar`
|
|
89
|
-
| `noSuiteQLSystemNoteJoin`
|
|
90
|
-
| `noWeakHash`
|
|
91
|
-
| `noAuthorizationHeaderInInternalRequest` | error | :green_circle::large_blue_circle: | No `Authorization` header in `https.requestRestlet`/`requestSuitelet`/`requestSuiteTalkRest` | Tier 2: [headintheclouddev `N/https`](https://github.com/headintheclouddev/typings-suitescript-2.0/blob/master/N/https.d.ts) · Tier 3: [Oracle help: https.requestRestlet](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_159139340774.html) |
|
|
92
|
-
| `noPositionalOptions`
|
|
93
|
-
| `noSecretKeyGuidAndSecret`
|
|
94
|
-
| `noUnknownModuleMember`
|
|
95
|
-
| `noUnsupportedServerWidgetFieldType`
|
|
96
|
-
| `requireOptions`
|
|
97
|
-
| `requireQueryOptions`
|
|
98
|
-
| `requireServerResponseOptions`
|
|
99
|
-
| `requireServerWidgetOptions`
|
|
100
|
-
| `noInvalidEnumMember`
|
|
101
|
-
| `noUnknownOptions`
|
|
102
|
-
| `entryPoints`
|
|
103
|
-
| `noBeforeSubmitRecordReload`
|
|
104
|
-
| `noBlockedResponseHeader`
|
|
105
|
-
| `noConflictingClientScriptProps`
|
|
106
|
-
| `noInsecureHttpsUrl`
|
|
107
|
-
| `noMultipleDefine`
|
|
108
|
-
| `noQueryColumnFieldAndFormula`
|
|
109
|
-
| `noRequireInsteadOfDefine`
|
|
110
|
-
| `noWrongScriptTypeModules`
|
|
111
|
-
| `logRequireTitle`
|
|
112
|
-
| `noBlockedHttpsHeader`
|
|
113
|
-
| `noEmptyEntryPoints`
|
|
114
|
-
| `noHardcodedAuthPasswords`
|
|
115
|
-
| `noHeaderUnderscores`
|
|
116
|
-
| `requireClientValidateReturn`
|
|
117
|
-
| `requireCustpagePrefix`
|
|
118
|
-
| `requireOrderByForPagedSuiteQL`
|
|
119
|
-
| `noClientLog`
|
|
120
|
-
| `noMapReduceSearchResults`
|
|
121
|
-
| `noLogModule`
|
|
122
|
-
| `noExtraParams`
|
|
123
|
-
| `noInvalidModules`
|
|
124
|
-
| `noAmdName`
|
|
125
|
-
| `noInvalidDefine`
|
|
126
|
-
| `noModuleExtensions`
|
|
127
|
-
| `noExtraDeps`
|
|
128
|
-
| `moduleVars`
|
|
129
|
-
| `logRequireDetails`
|
|
130
|
-
| `noGlobalEval` (Biome)
|
|
131
|
-
| `noImpliedEval` (Biome)
|
|
132
|
-
| `noVar` (Biome)
|
|
133
|
-
| `useConst` (Biome)
|
|
134
|
-
| `useForOf` (Biome)
|
|
135
|
-
| `useIncludes` (Biome)
|
|
136
|
-
| `useTemplate` (Biome)
|
|
67
|
+
| Rule | Severity | Presets | Description | Rule source |
|
|
68
|
+
| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
69
|
+
| [`noBrowserGlobals`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noBrowserGlobals.md) | error | :green_circle::large_blue_circle: | No `document`, `window`, `localStorage`, `XMLHttpRequest`, `alert`, `navigator`, `URLSearchParams` or `fetch` in server scripts | Tier 1: [SAFE guide](https://github.com/nemchik/biome-plugin-suitescript/blob/main/.agents/skills/netsuite-sdf-safe-guide/SKILL.md) · Tier 3: [Oracle help: FAQ](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/chapter_N3917921.html) |
|
|
70
|
+
| [`noGlobalShadowing`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noGlobalShadowing.md) | error | :green_circle::large_blue_circle: | No variable named `log` or `util` other than the N/log, N/util module itself | Tier 1: [upgrade skill](https://github.com/nemchik/biome-plugin-suitescript/blob/main/.agents/skills/netsuite-suitescript-upgrade/SKILL.md) |
|
|
71
|
+
| [`noMissingModules`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noMissingModules.md) | error | :green_circle::large_blue_circle: | A module used (`record.load()`) must be loaded in `define`/`import` (`log` and `util` are globals) | Tier 0: [ADR 0006](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/adr/0006-log-is-a-global-with-two-opposite-styles.md) · Tier 1: [upgrade skill](https://github.com/nemchik/biome-plugin-suitescript/blob/main/.agents/skills/netsuite-suitescript-upgrade/SKILL.md), [learning skill](https://github.com/nemchik/biome-plugin-suitescript/blob/main/.agents/skills/netsuite-suitescript-learning/SKILL.md) |
|
|
72
|
+
| [`noModuleScopeApiCalls`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noModuleScopeApiCalls.md) | error | :green_circle::large_blue_circle: | No `N/` API calls while the `define` callback runs; initialize from entry points (calls that only build an object, `createColumn`, `createFilter`, `createSort` and `createSetting`, are skipped) | Tier 1: [SAFE guide](https://github.com/nemchik/biome-plugin-suitescript/blob/main/.agents/skills/netsuite-sdf-safe-guide/SKILL.md) |
|
|
73
|
+
| [`noNativeIterators`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noNativeIterators.md) | error | :green_circle::large_blue_circle: | No generator functions or `Symbol.iterator` (GraalJS) | Tier 1: [SAFE guide](https://github.com/nemchik/biome-plugin-suitescript/blob/main/.agents/skills/netsuite-sdf-safe-guide/SKILL.md) |
|
|
74
|
+
| [`noSuiteQLTypeInSearch`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noSuiteQLTypeInSearch.md) | error | :green_circle::large_blue_circle: | No SuiteQL abbreviation (`PurchOrd`) as the `type` of `search.create` | Tier 1: [SAFE guide](https://github.com/nemchik/biome-plugin-suitescript/blob/main/.agents/skills/netsuite-sdf-safe-guide/SKILL.md) |
|
|
75
|
+
| [`noSuiteScript1Api`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noSuiteScript1Api.md) | error | :green_circle::large_blue_circle: | No `nlapi*`/`nlobj*` or 1.0-only methods (`getFieldValue`, `getLineItemValue`, `e.getCode()`) | Tier 1: [upgrade skill](https://github.com/nemchik/biome-plugin-suitescript/blob/main/.agents/skills/netsuite-suitescript-upgrade/SKILL.md) |
|
|
76
|
+
| [`noHardcodedSecrets`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noHardcodedSecrets.md) | error | :key: | No string literal assigned to `password`, `secret`, `apiKey`, .... **Opt-in, in no preset: it guesses from names, so it can misfire on look-alike names** | Tier 0: [ADR 0005](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/adr/0005-guessing-rules-are-in-no-preset.md) · Tier 1: [OWASP skill](https://github.com/nemchik/biome-plugin-suitescript/blob/main/.agents/skills/netsuite-owasp-secure-coding/SKILL.md) · Tier 3: [Oracle help: security considerations](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/chapter_159804448843.html) |
|
|
77
|
+
| [`noDynamicRequire`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noDynamicRequire.md) | warn | :green_circle::large_blue_circle: | `require()` takes string literal module names, not expressions | Tier 1: [OWASP skill](https://github.com/nemchik/biome-plugin-suitescript/blob/main/.agents/skills/netsuite-owasp-secure-coding/SKILL.md) · Tier 4: [amd `no-dynamic-require`](https://github.com/acdvs/eslint-plugin-amd/blob/main/lib/rules/no-dynamic-require.ts) |
|
|
78
|
+
| [`noDynamicSuiteQL`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noDynamicSuiteQL.md) | warn | :green_circle::large_blue_circle: | `runSuiteQL` queries use `?` placeholders, not concatenation or template literals (calls that pass `params` are skipped) | Tier 1: [OWASP skill](https://github.com/nemchik/biome-plugin-suitescript/blob/main/.agents/skills/netsuite-owasp-secure-coding/SKILL.md) |
|
|
79
|
+
| [`noInnerHtml`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noInnerHtml.md) | warn | :green_circle::large_blue_circle: | No non-static value assigned to `innerHTML`/`outerHTML` or passed to `insertAdjacentHTML`/`document.write` (client scripts) | Tier 1: [OWASP skill](https://github.com/nemchik/biome-plugin-suitescript/blob/main/.agents/skills/netsuite-owasp-secure-coding/SKILL.md) |
|
|
80
|
+
| [`noPostMessageWildcard`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noPostMessageWildcard.md) | warn | :green_circle::large_blue_circle: | No `'*'` target origin in `postMessage` | Tier 1: [OWASP skill](https://github.com/nemchik/biome-plugin-suitescript/blob/main/.agents/skills/netsuite-owasp-secure-coding/SKILL.md) |
|
|
81
|
+
| [`noWildcardCors`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noWildcardCors.md) | warn | :green_circle::large_blue_circle: | No `Access-Control-Allow-Origin: *` response header | Tier 1: [OWASP skill](https://github.com/nemchik/biome-plugin-suitescript/blob/main/.agents/skills/netsuite-owasp-secure-coding/SKILL.md) |
|
|
82
|
+
| [`requireEachReturn`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/requireEachReturn.md) | warn | :green_circle::large_blue_circle: | A `.run().each` or `.iterator().each` callback returns a value (`true` to continue) | Tier 1: [upgrade skill](https://github.com/nemchik/biome-plugin-suitescript/blob/main/.agents/skills/netsuite-suitescript-upgrade/SKILL.md), [learning skill](https://github.com/nemchik/biome-plugin-suitescript/blob/main/.agents/skills/netsuite-suitescript-learning/SKILL.md) |
|
|
83
|
+
| [`noRecordInLoop`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noRecordInLoop.md) | warn | :large_blue_circle: | No `record.load`, `query.runSuiteQL` or `search.create` inside loops or `forEach`/`each`/`map` callbacks | Tier 1: [SAFE guide](https://github.com/nemchik/biome-plugin-suitescript/blob/main/.agents/skills/netsuite-sdf-safe-guide/SKILL.md) |
|
|
84
|
+
| [`requireLogModule`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/requireLogModule.md) | warn | :large_blue_circle: | A used `log.*` needs `N/log` loaded (the upgrade skill recommends it; the global needs no loading) | Tier 0: [ADR 0006](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/adr/0006-log-is-a-global-with-two-opposite-styles.md) · Tier 1: [upgrade skill](https://github.com/nemchik/biome-plugin-suitescript/blob/main/.agents/skills/netsuite-suitescript-upgrade/SKILL.md), [learning skill](https://github.com/nemchik/biome-plugin-suitescript/blob/main/.agents/skills/netsuite-suitescript-learning/SKILL.md) |
|
|
85
|
+
| [`noInsecureCookie`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noInsecureCookie.md) | warn | :key: | A literal `Set-Cookie` value has `HttpOnly`, `Secure` and `SameSite`. **Opt-in, in no preset: only literal values are checked, and we have not confirmed a Suitelet may set `Set-Cookie`** | Tier 0: [ADR 0005](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/adr/0005-guessing-rules-are-in-no-preset.md) · Tier 1: [OWASP skill](https://github.com/nemchik/biome-plugin-suitescript/blob/main/.agents/skills/netsuite-owasp-secure-coding/SKILL.md) |
|
|
86
|
+
| [`noLocationHeader`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noLocationHeader.md) | warn | :key: | No `Location` header built from a variable; use `N/redirect`. **Opt-in, in no preset: the value may already be validated, and the skill's references still set `Location` after sanitising it** | Tier 0: [ADR 0005](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/adr/0005-guessing-rules-are-in-no-preset.md) · Tier 1: [OWASP skill](https://github.com/nemchik/biome-plugin-suitescript/blob/main/.agents/skills/netsuite-owasp-secure-coding/SKILL.md) |
|
|
87
|
+
| [`noPublicFileUpload`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noPublicFileUpload.md) | warn | :key: | No `isOnline: true` (public file). **Opt-in, in no preset: public assets legitimately set `isOnline`** | Tier 0: [ADR 0005](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/adr/0005-guessing-rules-are-in-no-preset.md) · Tier 1: [OWASP skill: file upload](https://github.com/nemchik/biome-plugin-suitescript/blob/main/.agents/skills/netsuite-owasp-secure-coding/references/07-file-upload-download.md) |
|
|
88
|
+
| [`noSensitiveBrowserStorage`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noSensitiveBrowserStorage.md) | warn | :key: | No token- or password-named key in `localStorage`/`sessionStorage.setItem`. **Opt-in, in no preset: it guesses from the key name** | Tier 0: [ADR 0005](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/adr/0005-guessing-rules-are-in-no-preset.md) · Tier 1: [OWASP skill](https://github.com/nemchik/biome-plugin-suitescript/blob/main/.agents/skills/netsuite-owasp-secure-coding/SKILL.md) |
|
|
89
|
+
| [`noStackInResponse`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noStackInResponse.md) | warn | :key: | No `.stack` inside `response.write`/`writeLine` arguments. **Opt-in, in no preset: a stack returned from a RESTlet is not detected, and the skill's own logging example includes `e.stack`** | Tier 0: [ADR 0005](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/adr/0005-guessing-rules-are-in-no-preset.md) · Tier 1: [OWASP skill](https://github.com/nemchik/biome-plugin-suitescript/blob/main/.agents/skills/netsuite-owasp-secure-coding/SKILL.md) |
|
|
90
|
+
| [`noSuiteQLSelectStar`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noSuiteQLSelectStar.md) | warn | :key: | No `SELECT *` in a literal SuiteQL query. **Opt-in, in no preset: the guide itself recommends a `SELECT * ... ROWNUM <= 1` probe, and only literal queries are seen** | Tier 0: [ADR 0005](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/adr/0005-guessing-rules-are-in-no-preset.md) · Tier 1: [SAFE guide: performance](https://github.com/nemchik/biome-plugin-suitescript/blob/main/.agents/skills/netsuite-sdf-safe-guide/references/03-performance-optimization.md) |
|
|
91
|
+
| [`noSuiteQLSystemNoteJoin`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noSuiteQLSystemNoteJoin.md) | warn | :key: | No `JOIN SystemNote` in a literal SuiteQL query. **Opt-in, in no preset: a tightly filtered join is fine, and only literal queries are seen** | Tier 0: [ADR 0005](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/adr/0005-guessing-rules-are-in-no-preset.md) · Tier 1: [SAFE guide](https://github.com/nemchik/biome-plugin-suitescript/blob/main/.agents/skills/netsuite-sdf-safe-guide/SKILL.md) |
|
|
92
|
+
| [`noWeakHash`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noWeakHash.md) | warn | :key: | No `HashAlg.MD5` or `HashAlg.SHA1`. **Opt-in, in no preset: it cannot tell a security use from a vendor integration that requires MD5 or SHA-1, and the type definitions list only `SHA256` and `SHA512` for `crypto.HashAlg`, so the member names come from the skill alone** | Tier 0: [ADR 0005](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/adr/0005-guessing-rules-are-in-no-preset.md) · Tier 1: [OWASP skill](https://github.com/nemchik/biome-plugin-suitescript/blob/main/.agents/skills/netsuite-owasp-secure-coding/SKILL.md) |
|
|
93
|
+
| [`noAuthorizationHeaderInInternalRequest`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noAuthorizationHeaderInInternalRequest.md) | error | :green_circle::large_blue_circle: | No `Authorization` header in `https.requestRestlet`/`requestSuitelet`/`requestSuiteTalkRest` | Tier 2: [headintheclouddev `N/https`](https://github.com/headintheclouddev/typings-suitescript-2.0/blob/master/N/https.d.ts) · Tier 3: [Oracle help: https.requestRestlet](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_159139340774.html) |
|
|
94
|
+
| [`noPositionalOptions`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noPositionalOptions.md) | error | :green_circle::large_blue_circle: | No literal passed where a module function takes an options object (`record.load('customer', 1)`) | Tier 2: [headintheclouddev `N/*`](https://github.com/headintheclouddev/typings-suitescript-2.0/tree/master/N) |
|
|
95
|
+
| [`noSecretKeyGuidAndSecret`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noSecretKeyGuidAndSecret.md) | error | :green_circle::large_blue_circle: | `https.createSecretKey` takes `guid` or `secret`, not both | Tier 2: [headintheclouddev `N/https`](https://github.com/headintheclouddev/typings-suitescript-2.0/blob/master/N/https.d.ts) · Tier 3: [Oracle help: https.createSecretKey](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_4418247967.html) |
|
|
96
|
+
| [`noUnknownModuleMember`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noUnknownModuleMember.md) | error | :green_circle::large_blue_circle: | Only members the type definitions export are read from an `N/` module (`record.loadRecord` is not one) | Tier 2: [headintheclouddev `N/*`](https://github.com/headintheclouddev/typings-suitescript-2.0/tree/master/N) |
|
|
97
|
+
| [`noUnsupportedServerWidgetFieldType`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noUnsupportedServerWidgetFieldType.md) | error | :green_circle::large_blue_circle: | No `DATETIME` in `addField` and no unsupported type in `List.addColumn` | Tier 2: [headintheclouddev `N/ui/serverWidget`](https://github.com/headintheclouddev/typings-suitescript-2.0/blob/master/N/ui/serverWidget.d.ts) · Tier 3: [Oracle help: serverWidget.FieldType](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_4332671056.html) |
|
|
98
|
+
| [`requireOptions`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/requireOptions.md) | error | :green_circle::large_blue_circle: | Every required option of a module function (`record.load`, `search.create`, `email.send`, ...) is present | Tier 2: [headintheclouddev `N/*`](https://github.com/headintheclouddev/typings-suitescript-2.0/tree/master/N) |
|
|
99
|
+
| [`requireQueryOptions`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/requireQueryOptions.md) | error | :green_circle::large_blue_circle: | Required `createColumn`/`createCondition`/`createSort` options (`fieldId` or `formula`, `type` with `formula`, ...) are present | Tier 2: [headintheclouddev `N/query`](https://github.com/headintheclouddev/typings-suitescript-2.0/blob/master/N/query.d.ts) · Tier 3: [Oracle help: Query.createColumn](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_1510780373.html) |
|
|
100
|
+
| [`requireServerResponseOptions`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/requireServerResponseOptions.md) | error | :green_circle::large_blue_circle: | Required `response.setHeader`/`write`/`writeFile`/... options are present | Tier 2: [headintheclouddev `N/http`](https://github.com/headintheclouddev/typings-suitescript-2.0/blob/master/N/http.d.ts) · Tier 3: [Oracle help: ServerResponse](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_4567652689.html) |
|
|
101
|
+
| [`requireServerWidgetOptions`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/requireServerWidgetOptions.md) | error | :green_circle::large_blue_circle: | Required `addField`/`addButton`/`addSublist`/`addColumn`/... options (`id`, `label`, `type`, ...) are present | Tier 2: [headintheclouddev `N/ui/serverWidget`](https://github.com/headintheclouddev/typings-suitescript-2.0/blob/master/N/ui/serverWidget.d.ts) · Tier 3: [Oracle help: N/ui/serverWidget](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_4321345532.html) |
|
|
102
|
+
| [`noInvalidEnumMember`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noInvalidEnumMember.md) | warn | :large_blue_circle: | A member of a module enum (`record.Type.CUSTOMR`) is one the type definitions list | Tier 2: [headintheclouddev `N/*`](https://github.com/headintheclouddev/typings-suitescript-2.0/tree/master/N) |
|
|
103
|
+
| [`noUnknownOptions`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noUnknownOptions.md) | warn | :large_blue_circle: | No option the type definitions do not list for a module function (`record.load({ typ: 'x' })`) | Tier 2: [headintheclouddev `N/*`](https://github.com/headintheclouddev/typings-suitescript-2.0/tree/master/N) |
|
|
104
|
+
| [`entryPoints`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/entryPoints.md) | error | :green_circle::large_blue_circle: | Returned entry points must belong to one script type and include its required ones | Tier 3: [Oracle help: entry point validation](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/chapter_4527904430.html), [Oracle help: validation errors](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_4503568059.html) · Tier 4: [acdvs `entry-points`](https://github.com/acdvs/eslint-plugin-suitescript/blob/master/lib/rules/entry-points.ts), [btonasse `entry-points`](https://github.com/btonasse/eslint-plugin-suitescript/blob/master/lib/rules/entry-points.js) |
|
|
105
|
+
| [`noBeforeSubmitRecordReload`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noBeforeSubmitRecordReload.md) | error | :green_circle::large_blue_circle: | No `record.load`/`submitFields`/`delete` of `context.newRecord.id` inside `beforeSubmit` | Tier 3: [Oracle help: script architecture](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/subsect_0804042112.html) |
|
|
106
|
+
| [`noBlockedResponseHeader`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noBlockedResponseHeader.md) | error | :green_circle::large_blue_circle: | No header NetSuite blocks on a Suitelet response (`Location`, `Server`, `Date`, ...) | Tier 3: [Oracle help: N/https](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_4418229131.html) |
|
|
107
|
+
| [`noConflictingClientScriptProps`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noConflictingClientScriptProps.md) | error | :green_circle::large_blue_circle: | Do not set both `clientScriptFileId` and `clientScriptModulePath` on a form | Tier 3: [Oracle help: Form.clientScriptModulePath](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_4625445350.html) |
|
|
108
|
+
| [`noInsecureHttpsUrl`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noInsecureHttpsUrl.md) | error | :green_circle::large_blue_circle: | No `http://` URL passed to `https.*` (N/https refuses plain HTTP) | Tier 3: [Oracle help: N/https](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_4418229131.html) |
|
|
109
|
+
| [`noMultipleDefine`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noMultipleDefine.md) | error | :green_circle::large_blue_circle: | A script calls `define()` only once | Tier 3: [Oracle help: entry point validation](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/chapter_4527904430.html), [Oracle help: validation errors](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_4503568059.html) |
|
|
110
|
+
| [`noQueryColumnFieldAndFormula`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noQueryColumnFieldAndFormula.md) | error | :green_circle::large_blue_circle: | A query column cannot set both `fieldId` and `formula` | Tier 3: [Oracle help: Column.fieldId](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_1510788976.html), [Oracle help: Column.formula](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_1510789062.html) |
|
|
111
|
+
| [`noRequireInsteadOfDefine`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noRequireInsteadOfDefine.md) | error | :green_circle::large_blue_circle: | A script uses `define()`, not a top-level `require([...], cb)` | Tier 3: [Oracle help: invalid script example](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_4527901694.html) |
|
|
112
|
+
| [`noWrongScriptTypeModules`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noWrongScriptTypeModules.md) | error | :green_circle::large_blue_circle: | No client-only module (`N/currentRecord`, `N/ui/dialog`) in a server script, or a server-only one in a client script | Tier 3: [Oracle help: SuiteScript 2.1 modules](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/chapter_4220488571.html) |
|
|
113
|
+
| [`logRequireTitle`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/logRequireTitle.md) | warn | :green_circle::large_blue_circle: | `log.debug/audit/error/emergency({...})` needs `title` | Tier 0: [ADR 0002](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/adr/0002-options-are-separate-rules.md) · Tier 3: [Oracle help: log.debug](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_4430385329.html) · Tier 4: [acdvs `log-args`](https://github.com/acdvs/eslint-plugin-suitescript/blob/master/lib/rules/log-args.ts), [btonasse `log-args`](https://github.com/btonasse/eslint-plugin-suitescript/blob/master/lib/rules/log-args.js) |
|
|
114
|
+
| [`noBlockedHttpsHeader`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noBlockedHttpsHeader.md) | warn | :green_circle::large_blue_circle: | No header NetSuite discards from an `https.*` request (`Host`, `Content-Length`, ...) | Tier 3: [Oracle help: N/https](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_4418229131.html) |
|
|
115
|
+
| [`noEmptyEntryPoints`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noEmptyEntryPoints.md) | warn | :green_circle::large_blue_circle: | A returned entry point with an empty body | Tier 3: [Oracle help: script architecture](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/subsect_0804042112.html) |
|
|
116
|
+
| [`noHardcodedAuthPasswords`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noHardcodedAuthPasswords.md) | warn | :green_circle::large_blue_circle: | No string literal passed as a password to `auth.changePassword`/`changeEmail` | Tier 3: [Oracle help: security considerations](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/chapter_159804448843.html), [Oracle help: auth.changePassword](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_4298157647.html) |
|
|
117
|
+
| [`noHeaderUnderscores`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noHeaderUnderscores.md) | warn | :green_circle::large_blue_circle: | No underscore in a custom `https.*` header name | Tier 3: [Oracle help: N/https](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_4418229131.html) |
|
|
118
|
+
| [`requireClientValidateReturn`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/requireClientValidateReturn.md) | warn | :green_circle::large_blue_circle: | `saveRecord` and `validate*` return a value (only a body with no `return <value>` is flagged) | Tier 3: [Oracle help: saveRecord](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_4410693749.html), [Oracle help: validateField](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_4410693152.html) |
|
|
119
|
+
| [`requireCustpagePrefix`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/requireCustpagePrefix.md) | warn | :green_circle::large_blue_circle: | The `id` of a UI object added to an existing page (`context.form.addField`, ...) starts with `custpage` | Tier 3: [Oracle help: N/ui/serverWidget](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_4321345532.html) |
|
|
120
|
+
| [`requireOrderByForPagedSuiteQL`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/requireOrderByForPagedSuiteQL.md) | warn | :green_circle::large_blue_circle: | A literal `runSuiteQLPaged` query has an `ORDER BY` | Tier 3: [Oracle help: query.runSuiteQLPaged](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_157960586441.html) |
|
|
121
|
+
| [`noClientLog`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noClientLog.md) | warn | :large_blue_circle: | `log.*` is ignored in client scripts attached to a form; use `console` | Tier 3: [Oracle help: N/log](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_4574548135.html) |
|
|
122
|
+
| [`noMapReduceSearchResults`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noMapReduceSearchResults.md) | warn | :large_blue_circle: | `getInputData` returns the search object, not `getRange()` results | Tier 3: [Oracle help: map/reduce best practices](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_0801064715.html) |
|
|
123
|
+
| [`noLogModule`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noLogModule.md) | warn | :key: | Opt-in style: use the global `log`, not `N/log` (the opposite of `requireLogModule`). **Opt-in, in no preset: the opposite style to `requireLogModule`; enable only one** | Tier 0: [ADR 0005](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/adr/0005-guessing-rules-are-in-no-preset.md), [ADR 0006](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/adr/0006-log-is-a-global-with-two-opposite-styles.md) · Tier 3: [Oracle help: log object](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_4387812838.html) · Tier 4: [acdvs `no-log-module`](https://github.com/acdvs/eslint-plugin-suitescript/blob/master/lib/rules/no-log-module.ts), [btonasse `no-log-module`](https://github.com/btonasse/eslint-plugin-suitescript/blob/master/lib/rules/no-log-module.js) |
|
|
124
|
+
| [`noExtraParams`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noExtraParams.md) | error | :white_circle::green_circle::large_blue_circle: | More callback parameters than dependencies (the extra parameters are always `undefined`) | Tier 4: [btonasse `no-extra-modules`](https://github.com/btonasse/eslint-plugin-suitescript/blob/master/lib/rules/no-extra-modules.js), [amd `no-extra-params`](https://github.com/acdvs/eslint-plugin-amd/blob/main/lib/rules/no-extra-params.ts) |
|
|
125
|
+
| [`noInvalidModules`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noInvalidModules.md) | error | :white_circle::green_circle::large_blue_circle: | Unknown `N/...` modules | Tier 4: [acdvs `no-invalid-modules`](https://github.com/acdvs/eslint-plugin-suitescript/blob/master/lib/rules/no-invalid-modules.ts), [btonasse `no-invalid-modules`](https://github.com/btonasse/eslint-plugin-suitescript/blob/master/lib/rules/no-invalid-modules.js) |
|
|
126
|
+
| [`noAmdName`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noAmdName.md) | error | :green_circle::large_blue_circle: | No module id as the first `define` argument (fixable) | Tier 4: [btonasse `no-amd-name`](https://github.com/btonasse/eslint-plugin-suitescript/blob/master/lib/rules/no-amd-name.js), [amd `no-name`](https://github.com/acdvs/eslint-plugin-amd/blob/main/lib/rules/no-name.ts) |
|
|
127
|
+
| [`noInvalidDefine`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noInvalidDefine.md) | error | :green_circle::large_blue_circle: | `define()` has one of the valid AMD shapes (a function or object factory, an optional name and dependency array) | Tier 4: [amd `no-invalid-define`](https://github.com/acdvs/eslint-plugin-amd/blob/main/lib/rules/no-invalid-define.ts) |
|
|
128
|
+
| [`noModuleExtensions`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noModuleExtensions.md) | error | :green_circle::large_blue_circle: | No `.js` in `define` dependency names (fixable) | Tier 4: [btonasse `no-module-extensions`](https://github.com/btonasse/eslint-plugin-suitescript/blob/master/lib/rules/no-module-extensions.js), [amd `no-module-extensions`](https://github.com/acdvs/eslint-plugin-amd/blob/main/lib/rules/no-module-extensions.ts) |
|
|
129
|
+
| [`noExtraDeps`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/noExtraDeps.md) | warn | :white_circle::green_circle::large_blue_circle: | More dependencies than callback parameters (the extra modules load but are unused) | Tier 4: [btonasse `no-extra-modules`](https://github.com/btonasse/eslint-plugin-suitescript/blob/master/lib/rules/no-extra-modules.js), [amd `no-extra-deps`](https://github.com/acdvs/eslint-plugin-amd/blob/main/lib/rules/no-extra-deps.ts) |
|
|
130
|
+
| [`moduleVars`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/moduleVars.md) | warn | :green_circle::large_blue_circle: | Conventional identifier per `N/` module (`N/record` → `record`) | Tier 4: [acdvs `module-vars`](https://github.com/acdvs/eslint-plugin-suitescript/blob/master/lib/rules/module-vars.ts), [btonasse `module-vars`](https://github.com/btonasse/eslint-plugin-suitescript/blob/master/lib/rules/module-vars.js) |
|
|
131
|
+
| [`logRequireDetails`](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/rules/logRequireDetails.md) | warn | :large_blue_circle: | ...needs `details` (Oracle marks it optional, so this house style is in `all` only) | Tier 0: [ADR 0002](https://github.com/nemchik/biome-plugin-suitescript/blob/main/docs/adr/0002-options-are-separate-rules.md) · Tier 4: [acdvs `log-args`](https://github.com/acdvs/eslint-plugin-suitescript/blob/master/lib/rules/log-args.ts), [btonasse `log-args`](https://github.com/btonasse/eslint-plugin-suitescript/blob/master/lib/rules/log-args.js) |
|
|
132
|
+
| `noGlobalEval` (Biome) | error | :green_circle::large_blue_circle: | No `eval()` (Oracle's OWASP skill: "Never use `eval`") | Tier 5: [Biome `noGlobalEval`](https://biomejs.dev/linter/rules/no-global-eval/) |
|
|
133
|
+
| `noImpliedEval` (Biome) | error | :green_circle::large_blue_circle: | No `new Function()` or string-form `setTimeout`/`setInterval` (OWASP skill) | Tier 5: [Biome `noImpliedEval`](https://biomejs.dev/linter/rules/no-implied-eval/) |
|
|
134
|
+
| `noVar` (Biome) | warn | :large_blue_circle: | Use `const`/`let`, not `var` (upgrade skill: "Modernize JavaScript") | Tier 5: [Biome `noVar`](https://biomejs.dev/linter/rules/no-var/) |
|
|
135
|
+
| `useConst` (Biome) | warn | :large_blue_circle: | Use `const` for never-reassigned bindings (upgrade skill) | Tier 5: [Biome `useConst`](https://biomejs.dev/linter/rules/use-const/) |
|
|
136
|
+
| `useForOf` (Biome) | warn | :large_blue_circle: | Use `for...of` where the index is only used to read (upgrade skill) | Tier 5: [Biome `useForOf`](https://biomejs.dev/linter/rules/use-for-of/) |
|
|
137
|
+
| `useIncludes` (Biome) | warn | :large_blue_circle: | Use `includes`, not `indexOf` (upgrade skill; needs type information, so it may report nothing) | Tier 5: [Biome `useIncludes`](https://biomejs.dev/linter/rules/use-includes/) |
|
|
138
|
+
| `useTemplate` (Biome) | warn | :large_blue_circle: | Use template literals, not string concatenation (upgrade skill) | Tier 5: [Biome `useTemplate`](https://biomejs.dev/linter/rules/use-template/) |
|
|
137
139
|
|
|
138
140
|
<!-- rules-table:end -->
|
|
139
141
|
|
|
@@ -218,7 +220,7 @@ does.
|
|
|
218
220
|
|
|
219
221
|
## Tag checker
|
|
220
222
|
|
|
221
|
-
`@NApiVersion` and `@NScriptType` live in comments, which no Biome plugin can read, so a small CLI checks them.
|
|
223
|
+
`@NApiVersion` and `@NScriptType` live in comments, which no Biome plugin can read (we have [asked Biome for comment access](https://github.com/biomejs/biome/discussions/12939); this CLI goes away if it ships), so a small CLI checks them.
|
|
222
224
|
It is **report-only**: it never edits files.
|
|
223
225
|
|
|
224
226
|
```sh
|
|
@@ -261,6 +263,8 @@ Biome rules identically.
|
|
|
261
263
|
|
|
262
264
|
## Development
|
|
263
265
|
|
|
266
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for how to report bugs, propose rules and open pull requests.
|
|
267
|
+
|
|
264
268
|
The source is TypeScript under `src/`, compiled by `tsc` to `dist/` (the only code that is published). Scripts and
|
|
265
269
|
tests are TypeScript too and run directly on Node. Node and npm versions come from `devEngines` in `package.json`
|
|
266
270
|
(also in `.nvmrc` and `.tool-versions`).
|
|
@@ -270,7 +274,10 @@ npm install
|
|
|
270
274
|
npm run build # tsc -> dist/, copies GritQL rules, regenerates biome-manifest.json
|
|
271
275
|
npm run typecheck # tsc --noEmit over src, scripts and tests
|
|
272
276
|
npm run check # biome check (npm run format applies fixes)
|
|
277
|
+
npm run new-rule -- noFooBar --tier 3 # scaffolds a rule, fixture, test case and sources entry (see CONTRIBUTING.md)
|
|
273
278
|
npm run sync-modules # refreshes the N/ module list from @hitc/netsuite-types
|
|
279
|
+
npm run readme # regenerates the rules table above (after npm run build)
|
|
280
|
+
npm run docs # regenerates the per-rule pages in docs/rules/ and the migration table (after npm run build)
|
|
274
281
|
npm test # builds first, then tests the built package
|
|
275
282
|
```
|
|
276
283
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "biome-plugin-suitescript",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Biome lint plugins and a tag checker for NetSuite SuiteScript 2.1, ported from eslint-plugin-suitescript.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"biome-plugin",
|
|
@@ -37,9 +37,11 @@
|
|
|
37
37
|
"prebuild": "node -e \"require(\\\"node:fs\\\").rmSync(\\\"dist\\\",{recursive:true,force:true})\"",
|
|
38
38
|
"build": "tsc -p tsconfig.build.json && node scripts/build-manifest.ts",
|
|
39
39
|
"check": "biome check",
|
|
40
|
+
"docs": "node scripts/rule-docs.ts && node scripts/migration-table.ts",
|
|
40
41
|
"preformat": "npm run typecheck",
|
|
41
42
|
"format": "biome check --write",
|
|
42
43
|
"lint": "biome lint",
|
|
44
|
+
"new-rule": "node scripts/new-rule.ts",
|
|
43
45
|
"prepack": "npm run build",
|
|
44
46
|
"readme": "node scripts/rules-table.ts",
|
|
45
47
|
"skills": "skills",
|