Skip to content

Some keywords, such as: static, instanceof  #2384

@nanarino

Description

@nanarino

Description

Input

The code looked like this before beautification:

  class Even {
      static [Symbol.hasInstance](num) {
          return Number(num) % 2 == 1
      }
  }

  console.log("123" instanceof Even) // true
  console.log("1230" instanceof Even) // false

Expected Output

The code should have looked like this after beautification:

class Even {
    static [Symbol.hasInstance](num) {
        return Number(num) % 2 == 1
    }
}

console.log("123" instanceof Even) // true
console.log("1230" instanceof Even) // false

Actual Output

The code actually looked like this after beautification:

class Even {
    static[Symbol.hasInstance](num) {
        return Number(num) % 2 == 1
    }
}

console.log("123"
    instanceof Even) // true
console.log("1230"
    instanceof Even) // false

Steps to Reproduce

Environment

OS: windows / web / mdformat-web

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions