Skip to content

Conversation

@hybridherbst
Copy link
Contributor

Description

I'm using npm run lint-addons to check for linting errors. For a while, that has produced ~14 errors across files, and some for lint-examples.

This PR brings the errors down to 2 (which I don't know how to fix).

Remaining linter errors:

three\examples\jsm\loaders\LDrawLoader.js
767:12  error  Parsing error: Unexpected token {
(which is just `} catch {`)

three\examples\jsm\nodes\Nodes.js
34:10  error  Parsing error: Unexpected token as
(which is just `export * as NodeUtils from './core/NodeUtils.js';`)

@LeviPesin
Copy link
Contributor

export * as NodeUtils from './core/NodeUtils.js

I think this is because the linter is configured to es2018?

@LeviPesin
Copy link
Contributor

And I again suggest that we should add some lints to npm run lint... At least npm run lint-docs, npm run lint-addons, and npm run lint-examples.

@Mugen87 Mugen87 added this to the r152 milestone Mar 31, 2023
@hybridherbst
Copy link
Contributor Author

I think this is because the linter is configured to es2018?

Do you know whether this means the line has to be changed (to still support es2018) or the linter config has to be changed?

@Mugen87
Copy link
Collaborator

Mugen87 commented Mar 31, 2023

Do you know whether this means the line has to be changed (to still support es2018)

Correct.

@hybridherbst
Copy link
Contributor Author

cc @sunag then I guess.

I can change } catch { to } catch ( _ ) { for the other line even when I don't quite understand why the linter doesn't like the former.

@sunag
Copy link
Collaborator

sunag commented Mar 31, 2023

@hybridherbst It's ok for me.

@hybridherbst
Copy link
Contributor Author

@sunag do you know what export * as NodeUtils from './core/NodeUtils.js'; needs to be changed to to make the linter happy? 🧐

@Mugen87
Copy link
Collaborator

Mugen87 commented Apr 1, 2023

Check out how this issue was solved in the core: #25470

@sunag
Copy link
Collaborator

sunag commented Apr 3, 2023

I think an alternative could be?

// utils
import * as NodeUtils from './core/NodeUtils.js';
export { NodeUtils };

@Mugen87
Copy link
Collaborator

Mugen87 commented Apr 3, 2023

AFAIK, the usage of as in import statements is not ECMA2018 conform.

@Mugen87
Copy link
Collaborator

Mugen87 commented Apr 4, 2023

Merging this in the meanwhile. The open points can be fixed with another PR.

@Mugen87 Mugen87 merged commit 6622dbf into mrdoob:dev Apr 4, 2023
@hybridherbst hybridherbst deleted the cleanup-lint-addons-examples branch May 23, 2023 22:20
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.

4 participants