Jshint: ES7 클래슀 μ†μ„±μ—μ„œ '예기치 μ•Šμ€ 토큰 =' λ°œμƒ

에 λ§Œλ“  2015λ…„ 04μ›” 13일  Β·  8μ½”λ©˜νŠΈ  Β·  좜처: jshint/jshint

Jeff Morrison의 0단계 클래슀 속성 μ΄λ‹ˆμ…œλΌμ΄μ € μ œμ•ˆ 은 클래슀의 속성 ꡬ성 곡백을 μ±„μ›λ‹ˆλ‹€.

ν˜„μž¬ μ‚¬μš© 쀑:

class Person {
  firstName = 'John'; // jshint error 'Unexpected token ='
  static lastName = 'Doe';
}

console.log(new Person().firstName); // "John"
console.log(Person.lastName); // "Doe"

μ΄λŸ¬ν•œ κΈ°λŠ₯을 지원할 κ³„νšμ΄ μžˆμŠ΅λ‹ˆκΉŒ? μ•„λ‹ˆλ©΄ λ‚΄κ°€ μ˜΅μ…˜μ„ λ†“μΉ˜κ³  μžˆμŠ΅λ‹ˆκΉŒ? 감사 ν•΄μš”!

κ°€μž₯ μœ μš©ν•œ λŒ“κΈ€

μ—…λ°μ΄νŠΈλ§Œ ν•˜λ©΄ ν˜„μž¬ 2λ‹¨κ³„μž…λ‹ˆλ‹€: https://github.com/tc39/proposals. 이 문제λ₯Ό λ‹€μ‹œ μ—΄ μ‹œκ°„μ΄ λ κΉŒμš”?

λͺ¨λ“  8 λŒ“κΈ€

JSHintκ°€ 0단계 μ œμ•ˆμ„ μ§€μ›ν•˜κΈ°λ‘œ μ•½μ†ν•˜λŠ” 것은 ν˜„λͺ…ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

ignoreDelimiter 둜 λΉ„ν‘œμ€€ 뢀뢄을 κ΅¬λΆ„ν•˜μ—¬ 였λ₯˜λ₯Ό 방지할 수 μžˆμŠ΅λ‹ˆλ‹€.

class Person {
  //start-non-standard
  firstName = 'John';
  static lastName = 'Doe';
  //end-non-standard
}

.jshintrc

...
ignoreDelimiters: [
  { start: "start-non-standard", end: "end-non-standard" },
],
esnext: true
...

@rwaldron κ°μ‚¬ν•©λ‹ˆλ‹€!

@voronianski 천만 μ—μš”!

이제 1λ‹¨κ³„μž…λ‹ˆλ‹€: https://github.com/jeffmo/es-class-static-properties-and-fields
λ‚˜λŠ” 그것이 아직 멀지 μ•Šμ•˜λ‹€λŠ” 것을 μ•Œκ³  μžˆμ§€λ§Œ λͺ¨λ“  μˆ˜μ—…μ—μ„œ λΉ„ν‘œμ€€ μ‹œμž‘μœΌλ‘œ λ‚΄ μ½”λ“œλ₯Ό μ–΄μ§€λŸ½νžˆμ§€ μ•Šκ³  이것을 μ‚¬μš©ν•˜κ³  μ‹ΆμŠ΅λ‹ˆλ‹€!

@hackel 이 κΈ°λŠ₯을 μš”μ²­ν•œ μ΄ν›„λ‘œ μš°λ¦¬λŠ” μƒˆλ‘œμš΄ μ–Έμ–΄ κΈ°λŠ₯에 λŒ€ν•œ μš”κ΅¬ 사항을 κ³΅μ‹ν™”ν–ˆμŠ΅λ‹ˆλ‹€.

http://jshint.com/blog/new-lang-features/

"클래슀 속성" μ œμ•ˆμ΄ 2단계에 λ„λ‹¬ν•˜λ©΄ 패치λ₯Ό 기꺼이 μˆ˜λ½ν•˜κ² μŠ΅λ‹ˆλ‹€!

μ—…λ°μ΄νŠΈλ§Œ ν•˜λ©΄ ν˜„μž¬ 2λ‹¨κ³„μž…λ‹ˆλ‹€: https://github.com/tc39/proposals. 이 문제λ₯Ό λ‹€μ‹œ μ—΄ μ‹œκ°„μ΄ λ κΉŒμš”?

이제 이 μ œμ•ˆμ΄ 2단계에 λ„λ‹¬ν–ˆμœΌλ―€λ‘œ JSHint λ‚΄μ—μ„œ 지원을 μΆ”μ ν•˜κΈ° μœ„ν•œ 문제λ₯Ό λ§Œλ“€μ—ˆμŠ΅λ‹ˆλ‹€. gh-3139λ₯Ό μ°Έμ‘°ν•˜μ‹­μ‹œμ˜€.

이 νŽ˜μ΄μ§€κ°€ 도움이 λ˜μ—ˆλ‚˜μš”?
0 / 5 - 0 λ“±κΈ‰