-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from htmlacademy/feature/update-source
Release 1.0.0
- Loading branch information
Showing
13 changed files
with
200 additions
and
15 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,25 @@ | ||
module.exports = { | ||
extends: 'eslint:recommended', | ||
rules: { | ||
// Possible Errors | ||
// https://eslint.org/docs/rules/#possible-errors | ||
// --------------------------------------------- | ||
'no-console': 'error', | ||
// Stylistic Issues | ||
// https://eslint.org/docs/rules/#stylistic-issues | ||
// --------------------------------------------- | ||
'comma-dangle': ['error', { | ||
'arrays': 'always-multiline', | ||
'objects': 'always-multiline', | ||
'functions': 'always-multiline', | ||
}], | ||
'indent': ['error', 2, { | ||
SwitchCase: 1, | ||
}], | ||
'quotes': ['error', 'single'], | ||
// ECMAScript 6 | ||
// https://eslint.org/docs/rules/#ecmascript-6 | ||
// --------------------------------------------- | ||
'no-var': ['error'], | ||
}, | ||
}; |
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
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,13 @@ | ||
const config = require('../../basic'); | ||
|
||
config.parserOptions = { | ||
ecmaVersion: 9, | ||
sourceType: 'module', | ||
}; | ||
config.env = { | ||
'es2017': true, | ||
'browser': true, | ||
'commonjs': true, | ||
}; | ||
|
||
module.exports = config; |
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 @@ | ||
const arr0 = ['a', 'b', 'c']; | ||
const arr1 = [ | ||
'a', | ||
'b', | ||
'c', | ||
]; | ||
|
||
const obj0 = {q: 'q', w: 'w'}; | ||
const obj1 = { | ||
q: 'q', | ||
w: 'w', | ||
}; | ||
|
||
const func0 = (a, b) => { | ||
return a + b; | ||
}; | ||
const func1 = ( | ||
a, | ||
b, | ||
) => { | ||
return a + b; | ||
}; | ||
|
||
func0( | ||
obj0.a, | ||
obj0.b, | ||
); | ||
|
||
throw new Error(arr0, arr1, obj0, obj1, func0, func1); |
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 @@ | ||
module.exports = { | ||
extends: 'eslint:recommended', | ||
rules: { | ||
// Possible Errors | ||
// https://eslint.org/docs/rules/#possible-errors | ||
// --------------------------------------------- | ||
'no-console': 'error', | ||
// Stylistic Issues | ||
// https://eslint.org/docs/rules/#stylistic-issues | ||
// --------------------------------------------- | ||
'comma-dangle': ['error', { | ||
'arrays': 'always-multiline', | ||
'objects': 'always-multiline', | ||
'functions': 'always-multiline', | ||
}], | ||
'indent': ['error', 2, { | ||
SwitchCase: 1, | ||
}], | ||
'quotes': ['error', 'single'], | ||
// ECMAScript 6 | ||
// https://eslint.org/docs/rules/#ecmascript-6 | ||
// --------------------------------------------- | ||
'no-var': ['error'], | ||
}, | ||
}; |
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,50 @@ | ||
'use strict'; | ||
|
||
// Continuation, aka MemberExpression | ||
const promise = window.Promise.resolve(true); | ||
promise. | ||
then(function (data) { | ||
return data; | ||
}). | ||
then(function (truthy) { | ||
return !truthy; | ||
}). | ||
catch(function () { | ||
return false; | ||
}); | ||
|
||
// Function expression | ||
const fun = function (first, second) { | ||
return first + second; | ||
}; | ||
|
||
// Function declaration | ||
function Constructor(first, second) { | ||
this.data = { | ||
first: first, | ||
second: second, | ||
}; | ||
} | ||
|
||
// Calling site arguments | ||
const myObject = new Constructor( | ||
'Petya', | ||
'Vasya', | ||
); | ||
myObject.toString(); | ||
|
||
const result = fun( | ||
'one', | ||
'two', | ||
); | ||
result.toString(); | ||
|
||
// Switch | ||
const a = 'a'; | ||
|
||
switch(a) { | ||
case 'a': | ||
break; | ||
case 'b': | ||
break; | ||
} |
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,4 @@ | ||
let a = 0; | ||
const B = 'B'; | ||
|
||
throw new Error (a, B); |
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 @@ | ||
const a = 'Anything string'; | ||
const b = `Anything | ||
string`; | ||
const c = `This's a ${a}`; | ||
|
||
throw new Error(a, b, c); |
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 |
---|---|---|
@@ -1,8 +1,11 @@ | ||
let config = require('../../es5'); | ||
'use strict'; | ||
|
||
var config = require('../../es5'); | ||
|
||
config.env = { | ||
'es6': false, | ||
'browser': true, | ||
'commonjs': true | ||
}; | ||
|
||
module.exports = config; | ||
module.exports = config; |
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 |
---|---|---|
@@ -1,21 +1,21 @@ | ||
const config = require('../../es6'); | ||
const es5config = require('../../es5'); | ||
const config = require(`../../es6`); | ||
const es5config = require(`../../es5`); | ||
|
||
const es5Rules = es5config.rules; | ||
|
||
config.rules = { | ||
...config.rules, | ||
...es5Rules | ||
...es5Rules, | ||
...config.rules | ||
}; | ||
|
||
config.parserOptions = { | ||
ecmaVersion: 6, | ||
sourceType: 'module' | ||
ecmaVersion: 9, | ||
sourceType: `module` | ||
}; | ||
config.env = { | ||
'es6': true, | ||
'browser': true, | ||
'commonjs': true | ||
}; | ||
|
||
module.exports = config; | ||
module.exports = config; |
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