p5.js-web-editor
p5.js-web-editor copied to clipboard
Migrate from JSHint to ESLint for linting in CodeMirror
Nature of issue?
p5 Web Editor doesn't support Private Class Fields
- Enhancement
(Private Class Fields is probably a new thing)
Note that Private Class fields is "an experimental proposal to allow defining private class fields using a hash prefix", hence this is not considered a bug.
Details:
Private class properties, or "Hash" names, as stated in the MDN Docs; are not supported by the Web Editor.
Though the code works, the editor comes with an error.

- Steps to reproduce:
class ClassWithPrivateField {
#privateField
constructor() {
this.#privateField = 42;
this.something = 23;
}
}
MDN Web Docs on Private Class Fields
Thanks for reporting! To check for syntax errors in the JavaScript, the web editor uses JSHint, which I believe does not support this yet (see https://github.com/jshint/jshint/issues/3139). We could look into an alternative, like ESLint, which I don't know how to make work on the front end + with CodeMirror.
The way that other online code editors have solved this is by using ESLint instead of JSHint.
Hello @catarak, can I work on this? May I know where to start working on this?