Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
012f379
Updated modules.js with new modules
michoelchaikin Feb 5, 2025
7e5c3ce
Update editorconfig
acdvs May 21, 2025
f370009
Move prettierrc
acdvs May 21, 2025
aab6353
Use template literals for tests, general cleanup
acdvs May 22, 2025
0da5ad6
Delete .gitattributes
acdvs May 22, 2025
39660f9
Remove auto-assign
acdvs May 22, 2025
61b00e5
Improve linting and formatting
acdvs May 22, 2025
a7f3259
Cleanup comments
acdvs May 22, 2025
b37e825
Bump dependencies
acdvs May 22, 2025
698c61f
Update eslint config
acdvs May 22, 2025
4b22c27
Move prettierrc
acdvs May 22, 2025
ad854e1
Fix es2015 compat
acdvs May 22, 2025
ab54dc7
Add config base parser opts, set es2015
acdvs May 22, 2025
484f9eb
Fix es5 compat
acdvs May 22, 2025
db75735
Fix prettier rules
acdvs May 22, 2025
975e4a3
Improve eslint peer dep version
acdvs May 22, 2025
93af7d9
Bump eslint dev
acdvs May 22, 2025
f907242
Remove unnecessary globals
acdvs May 22, 2025
52adcd0
Make script type case insensitive, improve naming
acdvs May 22, 2025
6274e38
Build docs
acdvs May 22, 2025
2e919af
Add N/scriptTypes/restlet
acdvs May 22, 2025
a69aee8
Add CustomGLPlugin script type
acdvs May 22, 2025
8e2b4ca
Format docs
acdvs May 22, 2025
0cc308f
Update CI
acdvs May 22, 2025
5c54d94
Use arrow functions
acdvs May 22, 2025
62863f4
Simplify script type lookup
acdvs May 22, 2025
454e62e
Rename file
acdvs May 22, 2025
fdf25b9
Update docs
acdvs May 22, 2025
3c86c61
Improve naming
acdvs May 22, 2025
0e7d6fc
Updated modules.js with new modules
michoelchaikin Feb 5, 2025
98764ae
Merge branch 'patch-1' of https://github.com/michoelchaikin/eslint-pl…
acdvs May 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
insert_final_newline = true
end_of_line = lf
indent_size = 2
indent_style = space
trim_trailing_whitespace = true
max_line_length = 90
max_line_length = 90

[*.md]
trim_trailing_whitespace = false
13 changes: 2 additions & 11 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,10 @@
"node": true
},
"parserOptions": {
"ecmaVersion": 2020,
"ecmaVersion": 2015,
"sourceType": "module"
},
"globals": {
"Promise": true
},
"extends": [
"prettier"
],
"plugins": [
"prettier"
],
"rules": {
"prettier/prettier": ["error"]
}
]
}
2 changes: 0 additions & 2 deletions .gitattributes

This file was deleted.

3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ name: Bug report
about: Report a bug
title: ''
labels: bug
assignees: acdvs

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand Down
2 changes: 0 additions & 2 deletions .github/ISSUE_TEMPLATE/feature-change-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: Feature/change request
about: Suggest an new feature or change
title: ''
labels: feature-request
assignees: acdvs

---

**Is your feature request related to a problem? Please describe.**
Expand Down
49 changes: 13 additions & 36 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,27 @@ name: CI

on:
push:
paths:
- 'lib/**'
- 'tests/**'
pull_request:

jobs:
lint:
name: Lint code
name: Check linting and formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x

- name: Install packages
uses: borales/actions-yarn@v4
with:
cmd: install

- name: Run tests
uses: borales/actions-yarn@v4
with:
cmd: lint
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: |
yarn
yarn prettier . --debug-check
- run: |
yarn lint

test:
name: Test rules
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x

- name: Install packages
uses: borales/actions-yarn@v4
with:
cmd: install

- name: Run tests
uses: borales/actions-yarn@v4
with:
cmd: test
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: |
yarn
yarn test
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"trailingComma": "all",
"trailingComma": "es5",
"semi": true,
"singleQuote": true
}
4 changes: 3 additions & 1 deletion docs/rules/api-version.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ Valid tag values are `1.0`, `2.x`, `2.0`, and `2.1`.
* @NApiVersion
*/
```

```js
/* eslint suitescript/api-version: "error" */

/**
* @NApiVersion2
*/
```

```js
/* eslint suitescript/api-version: "error" */

Expand All @@ -48,4 +50,4 @@ This rule was introduced in version 1.0.0.

## Source

- [Rule source](../../lib/rules/api-version.js)
- [Rule source](../../lib/rules/api-version.js)
36 changes: 19 additions & 17 deletions docs/rules/entry-points.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ define([], function () {

### Script Types and Their Respective Entry Points

- BankConnectivityPlugin
- getRequiredConfigurationFields
- downloadPreviousDayBankStatementFile
- BundleInstallationScript
- afterInstall
- afterUpdate
Expand All @@ -94,13 +97,27 @@ define([], function () {
- validateLine
- localizationContextEnter
- localizationContextExit
- CustomGLPlugin
- customizeGlImpact
- DatasetBuilderPlugin
- createDataset
- FiConnectivityPlugin
- getConfigurationIFrameUrl
- getAccounts
- getTransactionData
- FiParserPlugin
- parseData
- getStandardTransactionCodes
- getExpenseCodes
- getConfigurationPageUrl
- MapReduceScript
- getInputData
- map
- reduce
- summarize
- MassUpdateScript
- each
- PluginTypeImpl
- Portlet
- render
- Restlet
Expand All @@ -118,25 +135,10 @@ define([], function () {
- afterSubmit
- beforeLoad
- beforeSubmit
- WorkbookBbuilderPlugin
- createWorkbook
- WorkflowActionScript
- onAction
- bankConnectivityPlugin
- getRequiredConfigurationFields
- downloadPreviousDayBankStatementFile
- datasetbuilderplugin
- createDataset
- fiConnectivityPlugin
- getConfigurationIFrameUrl
- getAccounts
- getTransactionData
- fiParserPlugin
- parseData
- getStandardTransactionCodes
- getExpenseCodes
- getConfigurationPageUrl
- workbookbuilderplugin
- createWorkbook
- plugintypeimpl

## Version

Expand Down
5 changes: 4 additions & 1 deletion docs/rules/log-args.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ If no options are provided, the rule will require both title and details.

log.debug({ title: 'Title', details: 'Details' });
```

```js
/* eslint suitescript/log-args: "error" */

log.audit('Title', 'Details');
```

```js
/* eslint suitescript/log-args: "error" */

Expand All @@ -31,6 +33,7 @@ log.error('', 'Details');

log.debug('Title');
```

```js
/* eslint suitescript/log-args: "error" */

Expand Down Expand Up @@ -78,4 +81,4 @@ This rule was introduced in version 1.0.0.

## Source

- [Rule source](../../lib/rules/log-args.js)
- [Rule source](../../lib/rules/log-args.js)
1 change: 1 addition & 0 deletions docs/rules/module-vars.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ Specify at least one module name with a corresponding variable name.
- N/redirect
- N/render
- N/runtime
- N/scriptTypes/restlet
- N/search
- N/sftp
- N/sso
Expand Down
6 changes: 3 additions & 3 deletions docs/rules/no-amd-name.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ Naming AMD modules [should generally be avoided](https://requirejs.org/docs/whya
```js
/* eslint suitescript/no-amd-name: "error" */

define([], function() {});
define([], function () {});
```

:x: The following pattern is **incorrect**:

```js
/* eslint suitescript/no-amd-name: "error" */

define('myModule', [], function() {});
define('myModule', [], function () {});
```

## Version
Expand All @@ -30,4 +30,4 @@ This rule was introduced in version 1.0.0.

## Source

- [Rule source](../../lib/rules/no-amd-name.js)
- [Rule source](../../lib/rules/no-amd-name.js)
12 changes: 7 additions & 5 deletions docs/rules/no-extra-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,27 @@ Enforces an equal number of module literals and identifiers in the `define` call
```js
/* eslint suitescript/no-extra-modules: "error" */

define([], function() {});
define([], function () {});
```

```js
/* eslint suitescript/no-extra-modules: "error" */

define(['N/search'], function(search) {});
define(['N/search'], function (search) {});
```

:x: The following patterns are **incorrect**:

```js
/* eslint suitescript/no-extra-modules: "error" */

define(['N/file'], function(file, record) {});
define(['N/file'], function (file, record) {});
```

```js
/* eslint suitescript/no-extra-modules: "error" */

define(['N/file', 'N/record'], function(file) {});
define(['N/file', 'N/record'], function (file) {});
```

## Version
Expand All @@ -36,4 +38,4 @@ This rule was introduced in version 1.0.0.

## Source

- [Rule source](../../lib/rules/no-extra-modules.js)
- [Rule source](../../lib/rules/no-extra-modules.js)
12 changes: 7 additions & 5 deletions docs/rules/no-invalid-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,27 @@ Enforces valid SuiteScript module names in the `define` array.
```js
/* eslint suitescript/no-invalid-modules: "error" */

define(['N/record'], function(record) {});
define(['N/record'], function (record) {});
```

```js
/* eslint suitescript/no-invalid-modules: "error" */

define(['N/https', 'N/search'], function(https, search) {});
define(['N/https', 'N/search'], function (https, search) {});
```

```js
/* eslint suitescript/no-invalid-modules: "error" */

define(['customModule'], function(customModule) {});
define(['customModule'], function (customModule) {});
```

:x: The following pattern is **incorrect**:

```js
/* eslint suitescript/no-invalid-modules: "error" */

define(['N/somethingElse'], function(somethingElse) {});
define(['N/somethingElse'], function (somethingElse) {});
```

## Version
Expand All @@ -36,4 +38,4 @@ This rule was introduced in version 1.0.0.

## Source

- [Rule source](../../lib/rules/no-invalid-modules.js)
- [Rule source](../../lib/rules/no-invalid-modules.js)
Loading