-
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 prettier formated
- Loading branch information
Simon Mollweide
committed
Jul 18, 2017
1 parent
7885d5b
commit 3367b38
Showing
51 changed files
with
774 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-browser.js", | ||
"../../configurations/es6-browser-disable-styles.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,21 @@ | ||
// DESCRIPTION = enforces no braces where they can be omitted | ||
// 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*/ | ||
// <!START | ||
// Good | ||
const a = () => 0; | ||
|
||
// Bad | ||
const b = () => { | ||
return 0; | ||
}; | ||
// END!> |
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 parens in arrow function arguments | ||
// 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*/ | ||
// <!START | ||
// Bad | ||
/* | ||
a => {}; | ||
a => a; | ||
a => { '\n'; }; | ||
a.then(foo => {}); | ||
a.then(foo => a); | ||
*/ | ||
|
||
// Good | ||
() => {}; | ||
a => {}; | ||
a => a; | ||
a => { | ||
"\n"; | ||
}; | ||
a.then(foo => {}); | ||
|
||
// END!> |
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,24 @@ | ||
// DESCRIPTION = require space before/after arrow function's arrow | ||
// 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*/ | ||
// <!START | ||
// Bad | ||
/* | ||
()=>{}; | ||
()=> {}; | ||
() =>{}; | ||
*/ | ||
|
||
// Good | ||
() => {}; | ||
// END!> |
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,7 @@ | ||
// DESCRIPTION = verify super() callings in constructors | ||
// STATUS = 0 | ||
|
||
// <!START | ||
|
||
// END!> | ||
document.window.append("", null); |
29 changes: 29 additions & 0 deletions
29
test/es6-disable-styles/rules/es6/generator-star-spacing.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,29 @@ | ||
// DESCRIPTION = enforce the spacing around the * in generator functions | ||
// 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*/ | ||
// <!START | ||
// Bad | ||
/* | ||
function *generator() { | ||
yield '44'; | ||
yield '55'; | ||
} | ||
*/ | ||
|
||
// Good | ||
function* generator() { | ||
yield "44"; | ||
yield "55"; | ||
} | ||
|
||
// END!> |
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,19 @@ | ||
// DESCRIPTION = disallow modifying variables of class declarations | ||
// 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*/ | ||
// <!START | ||
// Bad | ||
/* | ||
class A { } | ||
A = 0; | ||
*/ | ||
// END!> |
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 = disallow arrow functions where they could be confused with comparisons | ||
// 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-constant-condition: 0*/ | ||
/* eslint arrow-parens: 0*/ | ||
/* eslint no-var: 0*/ | ||
// <!START | ||
// Bad | ||
/* | ||
var x = a => 1 ? 2 : 3; | ||
var x = (a) => 1 ? 2 : 3; | ||
*/ | ||
|
||
// Good | ||
var x = a => { | ||
return 1 ? 2 : 3; | ||
}; | ||
var x = a => { | ||
return 1 ? 2 : 3; | ||
}; | ||
// END!> |
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,19 @@ | ||
// DESCRIPTION = disallow modifying variables that are declared using const | ||
// 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*/ | ||
// <!START | ||
// Bad | ||
/* | ||
const a = 0; | ||
a = 1; | ||
*/ | ||
// END!> |
26 changes: 26 additions & 0 deletions
26
test/es6-disable-styles/rules/es6/no-dupe-class-members.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,26 @@ | ||
// DESCRIPTION = disallow duplicate class members | ||
// 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*/ | ||
// <!START | ||
// Bad | ||
/* | ||
class Foo { | ||
bar() { } | ||
bar() { } | ||
} | ||
class Foo { | ||
bar() { } | ||
get bar() { } | ||
} | ||
*/ | ||
// END!> |
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,26 @@ | ||
// DESCRIPTION = disallow importing from the same path more than once | ||
// 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 import/no-unresolved: 0*/ | ||
/* eslint import/no-duplicates: 0*/ | ||
// <!START | ||
// Bad | ||
/* | ||
import { merge } from 'module'; | ||
import something from 'another-module'; | ||
import { find } from 'module'; | ||
*/ | ||
|
||
// Good | ||
import { merge, find } from "module"; | ||
import something from "another-module"; | ||
// END!> |
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,21 @@ | ||
// DESCRIPTION = disallow symbol constructor | ||
// 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*/ | ||
// <!START | ||
// Bad | ||
/* | ||
const foo = new Symbol('foo'); | ||
*/ | ||
|
||
// Good | ||
const foo = Symbol("foo"); | ||
// END!> |
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,7 @@ | ||
// DESCRIPTION = disallow specific imports | ||
// STATUS = 0 | ||
|
||
// <!START | ||
|
||
// END!> | ||
document.window.append("", null); |
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,7 @@ | ||
// DESCRIPTION = disallow to use this/super before super() calling in constructors. | ||
// STATUS = 0 | ||
|
||
// <!START | ||
|
||
// END!> | ||
document.window.append("", null); |
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,7 @@ | ||
// DESCRIPTION = disallow useless computed property keys | ||
// STATUS = 2 | ||
|
||
// <!START | ||
|
||
// END!> | ||
document.window.append("", null); |
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,7 @@ | ||
// DESCRIPTION = disallow unnecessary constructor | ||
// STATUS = 2 | ||
|
||
// <!START | ||
|
||
// END!> | ||
document.window.append("", null); |
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,25 @@ | ||
// DESCRIPTION = disallow renaming import, export, and destructured assignments to the same name | ||
// 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 import/no-mutable-exports: 0*/ | ||
/* eslint import/export: 0*/ | ||
/* eslint import/no-unresolved: 0*/ | ||
// <!START | ||
// Bad | ||
/* | ||
import { foo as foo } from 'bar'; | ||
export { foo as foo }; | ||
export { foo as foo } from 'bar'; | ||
let { foo: foo } = bar; | ||
let { 'foo': foo } = bar; | ||
*/ | ||
// END!> |
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,18 @@ | ||
// DESCRIPTION = require let or const instead of var | ||
// 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*/ | ||
// <!START | ||
// Bad | ||
/* | ||
var test = 'a'; | ||
*/ | ||
// END!> |
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,23 @@ | ||
// DESCRIPTION = require method and property shorthand syntax for object literals | ||
// 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*/ | ||
// <!START | ||
// Bad | ||
/* | ||
const foo = { | ||
w: function () {}, | ||
x: function* () {}, | ||
[y]: function () {}, | ||
z: z | ||
}; | ||
*/ | ||
// END!> |
Oops, something went wrong.