-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[tests] add test for es6-react prettier formated
- Loading branch information
Simon Mollweide
committed
Jul 18, 2017
1 parent
3367b38
commit 9843c0f
Showing
61 changed files
with
1,802 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
extends: [ | ||
"../../configurations/es6-react.js", | ||
"../../configurations/es6-react-disable-styles.js", | ||
], | ||
}; |
30 changes: 30 additions & 0 deletions
30
test/es6-react-disable-styles/rules/react-a11y/aria-props.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// DESCRIPTION = Enforce all aria-* props are valid. | ||
// STATUS = 2 | ||
|
||
/* eslint require-jsdoc: 0*/ | ||
/* eslint no-use-before-define: 0*/ | ||
/* eslint no-undef: 0*/ | ||
/* eslint no-unused-vars: 0*/ | ||
/* eslint no-unreachable: 0*/ | ||
/* eslint no-empty: 0*/ | ||
/* eslint no-empty-function: 0*/ | ||
/* eslint no-shadow: 0*/ | ||
/* eslint no-redeclare: 0*/ | ||
/* eslint no-unused-expressions: 0*/ | ||
/* eslint react/react-in-jsx-scope: 0*/ | ||
/* eslint react/prefer-stateless-function: 0*/ | ||
/* eslint react/prefer-es6-class: 0*/ | ||
/* eslint react/prop-types: 0*/ | ||
/* eslint react/jsx-indent: 0*/ | ||
/* eslint object-shorthand: 0*/ | ||
// <!START | ||
// Bad | ||
/* | ||
<div id="address_label">Enter your address</div>; | ||
<input aria-labeledby="address_label" />; | ||
*/ | ||
|
||
// Good | ||
<div id="address_label">Enter your address</div>; | ||
<input aria-labelledby="address_label" />; | ||
// END!> |
27 changes: 27 additions & 0 deletions
27
test/es6-react-disable-styles/rules/react-a11y/aria-proptypes.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// DESCRIPTION = Enforce ARIA state and property values are valid. | ||
// STATUS = 2 | ||
|
||
/* eslint require-jsdoc: 0*/ | ||
/* eslint no-use-before-define: 0*/ | ||
/* eslint no-undef: 0*/ | ||
/* eslint no-unused-vars: 0*/ | ||
/* eslint no-unreachable: 0*/ | ||
/* eslint no-empty: 0*/ | ||
/* eslint no-empty-function: 0*/ | ||
/* eslint no-shadow: 0*/ | ||
/* eslint no-redeclare: 0*/ | ||
/* eslint no-unused-expressions: 0*/ | ||
/* eslint react/react-in-jsx-scope: 0*/ | ||
/* eslint react/prefer-stateless-function: 0*/ | ||
/* eslint react/prefer-es6-class: 0*/ | ||
/* eslint react/prop-types: 0*/ | ||
/* eslint object-shorthand: 0*/ | ||
// <!START | ||
// Bad | ||
/* | ||
<span aria-hidden="yes">foo</span>; | ||
*/ | ||
|
||
// Good | ||
<span aria-hidden="true">foo</span>; | ||
// END!> |
33 changes: 33 additions & 0 deletions
33
test/es6-react-disable-styles/rules/react-a11y/aria-role.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// DESCRIPTION = Require ARIA roles to be valid and non-abstract | ||
// STATUS = 2 | ||
|
||
/* eslint require-jsdoc: 0*/ | ||
/* eslint no-use-before-define: 0*/ | ||
/* eslint no-undef: 0*/ | ||
/* eslint no-unused-vars: 0*/ | ||
/* eslint no-unreachable: 0*/ | ||
/* eslint no-empty: 0*/ | ||
/* eslint no-empty-function: 0*/ | ||
/* eslint no-shadow: 0*/ | ||
/* eslint no-redeclare: 0*/ | ||
/* eslint no-unused-expressions: 0*/ | ||
/* eslint react/self-closing-comp: 0*/ | ||
/* eslint react/react-in-jsx-scope: 0*/ | ||
/* eslint react/prefer-stateless-function: 0*/ | ||
/* eslint react/prefer-es6-class: 0*/ | ||
/* eslint react/prop-types: 0*/ | ||
/* eslint object-shorthand: 0*/ | ||
/* eslint react/jsx-indent: 0*/ | ||
// <!START | ||
// Bad | ||
/* | ||
<div role="datepicker"></div>; | ||
<div role="range"></div>; | ||
<div role=""></div>; | ||
*/ | ||
|
||
// Good | ||
<div role="button" />; | ||
<div role={role} />; | ||
<div />; | ||
// END!> |
28 changes: 28 additions & 0 deletions
28
test/es6-react-disable-styles/rules/react-a11y/aria-unsupported-elements.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* eslint max-len: 0*/ | ||
// DESCRIPTION = Enforce that elements that do not support ARIA roles, states, and properties do not have those attributes. | ||
// STATUS = 2 | ||
|
||
/* eslint require-jsdoc: 0*/ | ||
/* eslint no-use-before-define: 0*/ | ||
/* eslint no-undef: 0*/ | ||
/* eslint no-unused-vars: 0*/ | ||
/* eslint no-unreachable: 0*/ | ||
/* eslint no-empty: 0*/ | ||
/* eslint no-empty-function: 0*/ | ||
/* eslint no-shadow: 0*/ | ||
/* eslint no-redeclare: 0*/ | ||
/* eslint no-unused-expressions: 0*/ | ||
/* eslint react/react-in-jsx-scope: 0*/ | ||
/* eslint react/prefer-stateless-function: 0*/ | ||
/* eslint react/prefer-es6-class: 0*/ | ||
/* eslint react/prop-types: 0*/ | ||
/* eslint object-shorthand: 0*/ | ||
// <!START | ||
// Bad | ||
/* | ||
<meta aria-hidden="false" charSet="UTF-8" />; | ||
*/ | ||
|
||
// Good | ||
<meta charSet="UTF-8" />; | ||
// END!> |
31 changes: 31 additions & 0 deletions
31
test/es6-react-disable-styles/rules/react-a11y/href-no-hash.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// DESCRIPTION = disallow href "#" | ||
// STATUS = 2 | ||
|
||
/* eslint require-jsdoc: 0*/ | ||
/* eslint no-use-before-define: 0*/ | ||
/* eslint no-undef: 0*/ | ||
/* eslint no-unused-vars: 0*/ | ||
/* eslint no-unreachable: 0*/ | ||
/* eslint no-empty: 0*/ | ||
/* eslint no-empty-function: 0*/ | ||
/* eslint no-shadow: 0*/ | ||
/* eslint no-redeclare: 0*/ | ||
/* eslint no-unused-expressions: 0*/ | ||
/* eslint react/react-in-jsx-scope: 0*/ | ||
/* eslint react/prefer-stateless-function: 0*/ | ||
/* eslint react/prefer-es6-class: 0*/ | ||
/* eslint react/prop-types: 0*/ | ||
/* eslint object-shorthand: 0*/ | ||
/* eslint react/jsx-indent: 0*/ | ||
// <!START | ||
// Bad | ||
<a href="#" />; | ||
<a href={"#"} />; | ||
<a href={"#"} />; | ||
|
||
// Good | ||
<a href="https://github.com" />; | ||
<a href="#section" />; | ||
<a href="foo" />; | ||
<a href={undefined} />; | ||
// END!> |
31 changes: 31 additions & 0 deletions
31
test/es6-react-disable-styles/rules/react-a11y/img-has-alt.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// DESCRIPTION = Require <img> to have a non-empty `alt` prop, or role="presentation" | ||
// STATUS = 2 | ||
|
||
/* eslint require-jsdoc: 0*/ | ||
/* eslint no-use-before-define: 0*/ | ||
/* eslint no-undef: 0*/ | ||
/* eslint no-unused-vars: 0*/ | ||
/* eslint no-unreachable: 0*/ | ||
/* eslint no-empty: 0*/ | ||
/* eslint no-empty-function: 0*/ | ||
/* eslint no-shadow: 0*/ | ||
/* eslint no-redeclare: 0*/ | ||
/* eslint no-unused-expressions: 0*/ | ||
/* eslint react/react-in-jsx-scope: 0*/ | ||
/* eslint react/prefer-stateless-function: 0*/ | ||
/* eslint react/prefer-es6-class: 0*/ | ||
/* eslint react/prop-types: 0*/ | ||
/* eslint object-shorthand: 0*/ | ||
// <!START | ||
// Bad | ||
/* | ||
function Foo(src) { | ||
return <img src={src} />; | ||
} | ||
*/ | ||
|
||
// Good | ||
function Foo({ alt, src }) { | ||
return <img alt={alt} src={src} />; | ||
} | ||
// END!> |
32 changes: 32 additions & 0 deletions
32
test/es6-react-disable-styles/rules/react-a11y/img-redundant-alt.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// DESCRIPTION = Prevent img alt text from containing redundant words like "image", "picture", or "photo" | ||
// STATUS = 2 | ||
|
||
/* eslint require-jsdoc: 0*/ | ||
/* eslint no-use-before-define: 0*/ | ||
/* eslint no-undef: 0*/ | ||
/* eslint no-unused-vars: 0*/ | ||
/* eslint no-unreachable: 0*/ | ||
/* eslint no-empty: 0*/ | ||
/* eslint no-empty-function: 0*/ | ||
/* eslint no-shadow: 0*/ | ||
/* eslint no-redeclare: 0*/ | ||
/* eslint no-unused-expressions: 0*/ | ||
/* eslint react/react-in-jsx-scope: 0*/ | ||
/* eslint react/prefer-stateless-function: 0*/ | ||
/* eslint react/prefer-es6-class: 0*/ | ||
/* eslint react/prop-types: 0*/ | ||
/* eslint object-shorthand: 0*/ | ||
/* eslint react/jsx-indent: 0*/ | ||
// <!START | ||
// Bad | ||
/* | ||
<img alt="Photo of foo being weird." src="foo" />; | ||
<img alt="Image of me at a bar!" src="bar" />; | ||
<img alt="Picture of baz fixing a bug." src="baz" />; | ||
*/ | ||
|
||
// Good | ||
<img alt="Foo eating a sandwich." src="foo" />; | ||
<img aria-hidden alt="Picture of me taking a photo of an image" src="bar" />; | ||
<img alt={`Baz taking a ${photo}`} src="baz" />; | ||
// END!> |
31 changes: 31 additions & 0 deletions
31
test/es6-react-disable-styles/rules/react-a11y/label-has-for.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// DESCRIPTION = require that JSX labels use "htmlFor" | ||
// STATUS = 2 | ||
|
||
/* eslint require-jsdoc: 0*/ | ||
/* eslint no-use-before-define: 0*/ | ||
/* eslint no-undef: 0*/ | ||
/* eslint no-unused-vars: 0*/ | ||
/* eslint no-unreachable: 0*/ | ||
/* eslint no-empty: 0*/ | ||
/* eslint no-empty-function: 0*/ | ||
/* eslint no-shadow: 0*/ | ||
/* eslint no-redeclare: 0*/ | ||
/* eslint no-unused-expressions: 0*/ | ||
/* eslint react/react-in-jsx-scope: 0*/ | ||
/* eslint react/prefer-stateless-function: 0*/ | ||
/* eslint react/prefer-es6-class: 0*/ | ||
/* eslint react/prop-types: 0*/ | ||
/* eslint object-shorthand: 0*/ | ||
// <!START | ||
// Bad | ||
/* | ||
function Foo(props) { | ||
return <label {...props} />; | ||
} | ||
*/ | ||
|
||
// Good | ||
function Foo({ htmlFor, props }) { | ||
return <label htmlFor={htmlFor} {...props} />; | ||
} | ||
// END!> |
33 changes: 33 additions & 0 deletions
33
test/es6-react-disable-styles/rules/react-a11y/mouse-events-have-key-events.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// DESCRIPTION = require that mouseover/out come with focus/blur, for keyboard-only users | ||
// STATUS = 0 | ||
|
||
/* eslint require-jsdoc: 0*/ | ||
/* eslint no-use-before-define: 0*/ | ||
/* eslint no-undef: 0*/ | ||
/* eslint no-unused-vars: 0*/ | ||
/* eslint no-unreachable: 0*/ | ||
/* eslint no-empty: 0*/ | ||
/* eslint no-empty-function: 0*/ | ||
/* eslint no-shadow: 0*/ | ||
/* eslint no-redeclare: 0*/ | ||
/* eslint no-unused-expressions: 0*/ | ||
/* eslint react/react-in-jsx-scope: 0*/ | ||
/* eslint react/prefer-stateless-function: 0*/ | ||
/* eslint react/prefer-es6-class: 0*/ | ||
/* eslint react/prop-types: 0*/ | ||
/* eslint react/jsx-sort-props: 0*/ | ||
/* eslint object-shorthand: 0*/ | ||
/* eslint react/jsx-indent: 0*/ | ||
// <!START | ||
// Bad | ||
<div onMouseOver={() => {}} />; | ||
<div onMouseOut={() => {}} />; | ||
<div onMouseOver={() => {}} />; | ||
<div onMouseOut={() => {}} />; | ||
|
||
// Good | ||
<div onMouseOver={() => {}} onFocus={() => {}} />; | ||
<div onMouseOut={() => {}} onBlur={() => {}} />; | ||
<div onMouseOver={() => {}} onFocus={() => {}} />; | ||
<div onMouseOut={() => {}} onBlur={() => {}} />; | ||
// END!> |
27 changes: 27 additions & 0 deletions
27
test/es6-react-disable-styles/rules/react-a11y/no-access-key.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// DESCRIPTION = Prevent use of `accessKey` | ||
// STATUS = 2 | ||
|
||
/* eslint require-jsdoc: 0*/ | ||
/* eslint no-use-before-define: 0*/ | ||
/* eslint no-undef: 0*/ | ||
/* eslint no-unused-vars: 0*/ | ||
/* eslint no-unreachable: 0*/ | ||
/* eslint no-empty: 0*/ | ||
/* eslint no-empty-function: 0*/ | ||
/* eslint no-shadow: 0*/ | ||
/* eslint no-redeclare: 0*/ | ||
/* eslint no-unused-expressions: 0*/ | ||
/* eslint react/react-in-jsx-scope: 0*/ | ||
/* eslint react/prefer-stateless-function: 0*/ | ||
/* eslint react/prefer-es6-class: 0*/ | ||
/* eslint react/prop-types: 0*/ | ||
/* eslint object-shorthand: 0*/ | ||
// <!START | ||
// Bad | ||
/* | ||
<div accessKey="h" />; | ||
*/ | ||
|
||
// Good | ||
<div />; | ||
// END!> |
31 changes: 31 additions & 0 deletions
31
test/es6-react-disable-styles/rules/react-a11y/no-onchange.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// DESCRIPTION = require onBlur instead of onChange | ||
// STATUS = 0 | ||
|
||
/* eslint require-jsdoc: 0*/ | ||
/* eslint no-use-before-define: 0*/ | ||
/* eslint no-undef: 0*/ | ||
/* eslint no-unused-vars: 0*/ | ||
/* eslint no-unreachable: 0*/ | ||
/* eslint no-empty: 0*/ | ||
/* eslint no-empty-function: 0*/ | ||
/* eslint no-shadow: 0*/ | ||
/* eslint no-redeclare: 0*/ | ||
/* eslint no-unused-expressions: 0*/ | ||
/* eslint react/react-in-jsx-scope: 0*/ | ||
/* eslint react/prefer-stateless-function: 0*/ | ||
/* eslint react/prefer-es6-class: 0*/ | ||
/* eslint react/prop-types: 0*/ | ||
/* eslint object-shorthand: 0*/ | ||
// <!START | ||
// Bad | ||
<select onChange={updateModel} />; | ||
|
||
// Good | ||
<select onBlur={updateModel}> | ||
<option /> | ||
</select>; | ||
|
||
<select> | ||
<option onBlur={handleOnBlur} onChange={handleOnChange} /> | ||
</select>; | ||
// END!> |
Oops, something went wrong.