Skip to content
This repository was archived by the owner on Jun 20, 2023. It is now read-only.
10 changes: 8 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
"node": true
},
"rules": {
"quotes": [2, "single"],
"no-use-before-define": 0
"//": "single quote に統一",
"quotes": [2, "single", "avoid-escape"],

"//": "関数宣言文以外は hoisting 避けのため禁止",
"no-use-before-define": [2, "nofunc"],

"//": "この形式のキャストはくっついていないと読みづらい",
"space-infix-ops": [2, { "int32Hint": false }]
}
}
43 changes: 36 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,23 @@ JavaScript 初心者が JS の未来を見据えつつ、



トレーニングの目標
------------------



このトレーニングの目標は、
**モジュールを読み書きできるようになり、**
自分の好きなモジュールを
つくれるようになることです。



トレーニングの前に、セットアップを
終わらせてしまいましょう。



セットアップ
------------

Expand Down Expand Up @@ -52,7 +69,7 @@ JavaScriptTraining リポジトリを fork します。
下のコマンドをターミナルで実行してください。

cd JavaScriptTraining
npm run setup
npm install



Expand Down Expand Up @@ -1047,7 +1064,7 @@ fetch('/users.json')



実はこの Promsie という複雑な仕組みを使う理由は、
実はこの Promise という複雑な仕組みを使う理由は、

- 並行非同期処理
- 直列非同期処理
Expand Down Expand Up @@ -1118,8 +1135,6 @@ fetch('/api/foo')



#### モジュール

JavaScript は言語機能としてモジュールの
仕組みをもっていません。

Expand All @@ -1134,7 +1149,16 @@ JavaScript は言語機能としてモジュールの



[エコシステムの例](https://github.com/wilmoore/frontend-packagers)
- bower
- component
- jam
- volo
- npm with browserify
- spm
- jspm
- duo

(source: [wilmoore/frontend-packagers](https://github.com/wilmoore/frontend-packagers))



Expand All @@ -1156,9 +1180,14 @@ bower は、JavaScript、HTML、CSSなどを
自分が作ったモジュールを公開することも
できます。

ただ、JavaScript の場合モジュールの仕組みを
もたないため、この部分を RequireJS などの


ただ、bower はモジュール読み込みの
仕組みを提供していません。

この部分は RequireJS など、別の
モジュールシステムに頼ることになります。

どのモジュールシステムに対応するかという選択は、
bower によって読み込まれるパッケージ側に
裁量(責務)があります。
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Training course repository for JavaScript by mixi",
"main": "index.js",
"scripts": {
"setup": "npm install; (cd public; bower install)",
"postinstall": "(cd public; $(npm bin)/bower install)",
"help": "$(npm bin)/gulp help",
"serve": "$(npm bin)/gulp serve",
"presentation": "$(npm bin)/reveal-md README.md --theme solarized --separator '^\\n\\n\\n' --verticalSeparator '^\\n\\n'"
Expand Down
8 changes: 7 additions & 1 deletion public/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
{
"env": {
"mocha": true
"mocha": true,
"browser": true,
"jquery": true
},
"globals": {
"expect": false
},
"rules": {
"//": "chai の expect 構文が誤警告になるため無視",
"no-unused-expressions": 0
}
}
11 changes: 0 additions & 11 deletions public/stage1/.eslintrc

This file was deleted.

11 changes: 0 additions & 11 deletions public/stage2/.eslintrc

This file was deleted.

4 changes: 2 additions & 2 deletions public/stage2/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ describe('ステージ2(意図した通りに DOM 要素の属性・テキス
});


it('5 番の要素を jQuery を使って時計回り方向に 10 度回転させる', function() {
it('11 番の要素を jQuery を使って時計回り方向に 10 度回転させる', function() {

// ここにコードを記述してください。
// 変更した DOM 要素は $element 変数に代入してください。
Expand All @@ -198,7 +198,7 @@ describe('ステージ2(意図した通りに DOM 要素の属性・テキス
});


it('6 番の要素を jQuery を使って上に 20px 移動させる', function() {
it('12 番の要素を jQuery を使って上に 20px 移動させる', function() {

// ここにコードを記述してください。
// 変更した DOM 要素は $element 変数に代入してください。
Expand Down
11 changes: 0 additions & 11 deletions public/stage3/.eslintrc

This file was deleted.

11 changes: 0 additions & 11 deletions public/stage4/.eslintrc

This file was deleted.

9 changes: 1 addition & 8 deletions public/stage5/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
{
"env": {
"browser": true,
"mocha": true
},
"globals": {
"$": false,
"jQuery": false,
"fetch": false,
"Promise": false,
"HTMLCollection": false
"Promise": false
}
}
11 changes: 2 additions & 9 deletions public/stage6/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
{
"env": {
"browser": true,
"mocha": true
},
"rules": {
"no-unused-expressions": 0,
"//": "シャレオツコードの意図が undefined 代入だとわかりやすいので許可",
"no-undef-init": 0
},
"globals": {
"$": false,
"jQuery": false,
"fetch": false,
"Promise": false,
"HTMLCollection": false
"Promise": false
}
}
19 changes: 9 additions & 10 deletions public/stage7/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
{
"env": {
"browser": true,
"mocha": true
},
"rules": {
"no-unused-expressions": 0,
"no-undef-init": 0
"//": "undefined 上書き問題のため、明示的な undefined 代入を許可",
"no-undef-init": 0,

"//": "== 演算子の振る舞いの問題の警告は誤警告",
"yoda": 0,

"//": "truthy, falsey を判定する問題のため、定数式を許可",
"no-constant-condition": 0
},
"globals": {
"$": false,
"jQuery": false,
"fetch": false,
"Promise": false,
"HTMLCollection": false
"Promise": false
}
}
Loading