-
-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: console.log(式); //=> 評価結果
に表記を統一
#212
Merged
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d435c0e
refactor: `console.log(式); //=> 評価結果` に表記を統一
azu e222f1d
refactor(operator): console.logを使うように
azu 49d7974
Revert "refactor(operator): console.logを使うように"
azu b0fd270
fix(test): Identifierを含んでいるかを判定に追加
azu 7637ab4
refactor(data-type): リテラルからはconsole.logを削除
azu 7a488fa
docs(CONTRIBUTING): どちらを優先するかを記述
azu eca1f33
test(comment): 1行以下のもおんはチェックしないように
azu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
|
@@ -58,7 +58,7 @@ function multiple(num) { | |
return num * 2; | ||
} | ||
|
||
multiple(10); // => 20 | ||
console.log(multiple(10)); // => 20 | ||
``` | ||
|
||
値を返していない又は空の`return;`と書いた場合、関数は`undefined`を返します。 | ||
|
@@ -68,7 +68,7 @@ multiple(10); // => 20 | |
function noop() { | ||
} | ||
|
||
noop(); // => undefined; | ||
console.log(noop()); // => undefined; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. これも不要っぽい There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. と思ったけど値として返ってくるという話なのであったほうがいいか |
||
``` | ||
|
||
### 可変長引数 | ||
|
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,41 @@ | ||
// MIT © 2017 azu | ||
"use strict"; | ||
const path = require("path"); | ||
const ignoreFileList = [ | ||
// 演算子はいいかな | ||
"source/basic/operator", | ||
// 文字列リテラルそのものなので無視 | ||
"source/basic/string", | ||
// これもリテラルの話なので… | ||
"source/basic/implicit-coercion" | ||
]; | ||
/** | ||
* lineが問題ある行ならばErrorオブジェクトを返す | ||
* @param {string} line | ||
* @param {string} filePath ファイルパスは無視したい対象の指定に使う | ||
* @returns {Error|undefined} | ||
*/ | ||
module.exports = function shouldConsoleWithComment(line, filePath) { | ||
const isIgnored = ignoreFileList.some(ignoreFilePath => { | ||
return filePath.includes(path.normalize(ignoreFilePath)); | ||
}); | ||
if (isIgnored) { | ||
return; | ||
} | ||
if (!/\/\/\s*=>\s*/.test(line)) { | ||
return; | ||
} | ||
if (line.includes("console.")) { | ||
return; | ||
} | ||
// エラーの場合は無視 | ||
if (/=>.*Error/.test(line)) { | ||
return; | ||
} | ||
// template literalっぽいのは無視 | ||
if (line.includes("`")) { | ||
return; | ||
} | ||
return new Error(`console.log(式); // => 評価結果 にそろえてください | ||
該当コード: ${line}`); | ||
}; |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
この変も微妙なのかな?