
Inline adoc files when they are included exactly once. Also fix language tags because this inlining gives us better information on what language the code is written in.
35 lines
702 B
Plaintext
35 lines
702 B
Plaintext
== Why is this an issue?
|
|
|
|
This rule enforces the idea to use ES6 style to create React Component instead of the ES5 way.
|
|
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,javascript]
|
|
----
|
|
var Rating = createReactClass({ // Noncompliant
|
|
[...]
|
|
});
|
|
----
|
|
|
|
|
|
=== Compliant solution
|
|
|
|
[source,javascript]
|
|
----
|
|
export default class Rating extends React.Component { // Compliant
|
|
[...]
|
|
}
|
|
----
|
|
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
=== on 23 Feb 2018, 11:48:51 Alexandre Gigleux wrote:
|
|
Covered by ESLint for React: \https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/prefer-es6-class.md (react/prefer-es6-class)
|
|
|
|
endif::env-github,rspecator-view[]
|