eslint / espree

An Esprima-compatible JavaScript parser
BSD 2-Clause "Simplified" License
2.26k stars 189 forks source link

Update: add class fields (refs eslint/eslint#14343) #486

Closed mysticatea closed 3 years ago

mysticatea commented 3 years ago

WIP.

This PR adds ES2022 class features.


Remaining steps:

  1. Revert https://github.com/eslint/espree/pull/486/commits/3e9caa787c0d4945401f1abf093b03be9fb44c6c to remove dist.
  2. Release eslint-visitor-keys.
  3. Update the eslint-visitor-keys version range in package.json.

Also, because I expect ESLint built-in rules have false positives about the new syntax, I hope to release this feature together with built-in rules updates.

mysticatea commented 3 years ago

Hmmm. The build step makes developing new syntax on cross-packages difficult. 😟

npm install github:eslint/espree#class-fields doesn't work because dist doesn't exist. Are any alternative ways?

aladdin-add commented 3 years ago

for local development, you can use npm link

However, I don't think there is an easy way to run on CI.

mdjermanovic commented 3 years ago

npm install github:eslint/espree#class-fields doesn't work because dist doesn't exist. Are any alternative ways?

Maybe comment out dist in .gitignore, build locally and push dist/ to this branch (we should revert that before merging).

nzakas commented 3 years ago

Switched to a draft for work-in-progress changes.

nzakas commented 3 years ago

You can also use a preinstall npm script. That might be easier to remove before merging.

nzakas commented 3 years ago

@mysticatea what is left to do on this PR? Is anything we can help with?

aladdin-add commented 3 years ago

@mysticatea seems it is ready to go (the deps has been released & updated).

sanex3339 commented 3 years ago

Any news?

nzakas commented 3 years ago

@sanex3339 all news is posted on the pull request.

mdjermanovic commented 3 years ago

There are merge conflicts that should be resolved

nzakas commented 3 years ago

Yup, all fixed now.

sanex3339 commented 3 years ago

Thank you for this PR