p5.js-web-editor icon indicating copy to clipboard operation
p5.js-web-editor copied to clipboard

Migrate from JSHint to ESLint for linting in CodeMirror

Open dipamsen opened this issue 5 years ago • 3 comments

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.

image

  • Steps to reproduce:
class ClassWithPrivateField {
  #privateField
  constructor() {
    this.#privateField = 42;
    this.something = 23;
  }
}

MDN Web Docs on Private Class Fields

dipamsen avatar Aug 10 '20 09:08 dipamsen

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.

catarak avatar Aug 11 '20 19:08 catarak

The way that other online code editors have solved this is by using ESLint instead of JSHint.

catarak avatar Feb 10 '21 21:02 catarak

Hello @catarak, can I work on this? May I know where to start working on this?

SundeepChand avatar Feb 20 '21 13:02 SundeepChand