eslint / js

Monorepo for the JS language tools.
BSD 2-Clause "Simplified" License
2.29k stars 196 forks source link

Support for `using` keyword #586

Closed fregante closed 1 year ago

fregante commented 1 year ago

I don't see any commits related to this so I think this keyword is not supported yet. I created an issue in the eslint repo to track it, but I think it has to be fixed here, so I'm opening it for visibility.

Sample code:

{
  const getResource = () => {
    return {
      [Symbol.dispose]: () => {
        console.log('Hooray!')
      }
    }
  }
  using resource = getResource();
}

Related:

mdjermanovic commented 1 year ago

As stated in What ECMAScript features do you support, we are implementing features as they are finalized. When this proposal reaches stage 4, we'll add support for this syntax.