Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(lint): compatibility of ESLint plugin with Node.js 18 #6580

Merged
merged 4 commits into from
Jan 1, 2024

Conversation

zackbcom
Copy link
Contributor

@zackbcom zackbcom commented Dec 30, 2023

Fixes issue #6579 with node 18 compat in dev container when running yarn run lint:zwave

Before:

@zwave-js/config:lint:zwave: Oops! Something went wrong! :(
@zwave-js/config:lint:zwave: 
@zwave-js/config:lint:zwave: ESLint: 8.48.0
@zwave-js/config:lint:zwave: 
@zwave-js/config:lint:zwave: TypeError: propsWithComments.toSorted is not a function
@zwave-js/config:lint:zwave: Occurred while linting /workspaces/node-zwave-js/packages/config/config/devices/0x027a/zen37.json:64
@zwave-js/config:lint:zwave: Rule: "@zwave-js/consistent-device-config-property-order"
@zwave-js/config:lint:zwave:     at JSONProperty[key.value='paramInformation'] > JSONArrayExpression > JSONObjectExpression (/workspaces/node-zwave-js/packages/eslint-plugin/build/rules/consistent-device-config-property-order.js:58:60)
@zwave-js/config:lint:zwave:     at ruleErrorHandler (/workspaces/node-zwave-js/node_modules/.store/eslint-npm-8.48.0-0dd1c36629/node_modules/eslint/lib/linter/linter.js:1050:28)
@zwave-js/config:lint:zwave:     at /workspaces/node-zwave-js/node_modules/.store/eslint-npm-8.48.0-0dd1c36629/node_modules/eslint/lib/linter/safe-emitter.js:45:58
@zwave-js/config:lint:zwave:     at Array.forEach (<anonymous>)
@zwave-js/config:lint:zwave:     at Object.emit (/workspaces/node-zwave-js/node_modules/.store/eslint-npm-8.48.0-0dd1c36629/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
@zwave-js/config:lint:zwave:     at NodeEventGenerator.applySelector (/workspaces/node-zwave-js/node_modules/.store/eslint-npm-8.48.0-0dd1c36629/node_modules/eslint/lib/linter/node-event-generator.js:297:26)
@zwave-js/config:lint:zwave:     at NodeEventGenerator.applySelectors (/workspaces/node-zwave-js/node_modules/.store/eslint-npm-8.48.0-0dd1c36629/node_modules/eslint/lib/linter/node-event-generator.js:326:22)
@zwave-js/config:lint:zwave:     at NodeEventGenerator.enterNode (/workspaces/node-zwave-js/node_modules/.store/eslint-npm-8.48.0-0dd1c36629/node_modules/eslint/lib/linter/node-event-generator.js:340:14)
@zwave-js/config:lint:zwave:     at CodePathAnalyzer.enterNode (/workspaces/node-zwave-js/node_modules/.store/eslint-npm-8.48.0-0dd1c36629/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js:795:23)
@zwave-js/config:lint:zwave:     at /workspaces/node-zwave-js/node_modules/.store/eslint-npm-8.48.0-0dd1c36629/node_modules/eslint/lib/linter/linter.js:1085:32
@zwave-js/config:lint:zwave: ERROR: command finished with error: command (/workspaces/node-zwave-js/packages/config) yarn run lint:zwave exited (1)
command (/workspaces/node-zwave-js/packages/config) yarn run lint:zwave exited (1)

After:

@zwave-js/config:lint:zwave: The config files are valid!
@zwave-js/config:lint:zwave: 
@zwave-js/config:lint:zwave:  
@zwave-js/config:lint:zwave: 
@zwave-js/config:lint:zwave: /workspaces/node-zwave-js/packages/config/config/devices/0x027a/zen37.json
@zwave-js/config:lint:zwave:   65:3  error  For consistency, config param properties should follow the order "#", "$if", "$import", "label", "description", "valueSize", "unit", "minValue", "maxValue", "defaultValue", "unsigned", "readOnly", "writeOnly", "allowManualEntry", "options"  @zwave-js/consistent-device-config-property-order
@zwave-js/config:lint:zwave: 
@zwave-js/config:lint:zwave: ✖ 1 problem (1 error, 0 warnings)
@zwave-js/config:lint:zwave:   1 error and 0 warnings potentially fixable with the `--fix` option.
@zwave-js/config:lint:zwave: 
@zwave-js/config:lint:zwave: ERROR: command finished with error: command (/workspaces/node-zwave-js/packages/config) yarn run lint:zwave exited (1)
command (/workspaces/node-zwave-js/packages/config) yarn run lint:zwave exited (1)

@zackbcom
Copy link
Contributor Author

zackbcom commented Dec 30, 2023

Unable to determine what needs to be fixed on job: Test and Release / lint (18) (pull_request) . I cannot run dprint with the prettier plugin on mac devcontainer arm64. dprint/dprint-plugin-prettier#65

Ran typescript lint on the file, that might be the issue,.

Didn't fix it.

Maintainer, please run lint on file and push fixes up.

@AlCalzone
Copy link
Member

Yeah it's indentation of the changed lines. Will fix that when I have time. Thanks for the PR

@zackbcom
Copy link
Contributor Author

@AlCalzone Fixed.

@AlCalzone AlCalzone changed the title fix(lint): fix node 18 zwave lint fix(lint): compatibility of ESLint plugin with Node.js 18 Jan 1, 2024
@AlCalzone AlCalzone merged commit 86b137e into zwave-js:master Jan 1, 2024
17 checks passed
AlCalzone added a commit that referenced this pull request Jan 19, 2024
This release adds support for Z-Wave Long Range thanks to the amazing work of @jtbraun. Application developers planning to add support should read [this](https://github.com/zwave-js/node-zwave-js/blob/release-12.5.x/docs/getting-started/long-range.md) to get started.

### Features
* Support Z-Wave Long Range (#6401)

### Config file changes
* Add 2nd product ID for Ring Panic Button Gen2 (#6595)

### Changes under the hood
* Fix compatibility of ESLint plugin with Node.js 18 (#6580)
AlCalzone added a commit that referenced this pull request Jan 23, 2024
### Bugfixes
* The check for a changed device config now always returns `false` for the controller (#6625)

### Config file changes
* Disable Supervision for Alfred DB1 Digital Deadbolt Lock to work around battery drain issue (#6629)
* Add 2nd product ID for Ring Panic Button Gen2 (#6595)

### Changes under the hood
* Fix compatibility of ESLint plugin with Node.js 18 (#6580)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants