You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
何かJavaScriptのソースコードを機械的にチェックするためのツールを作りたいという場合に、JavaScriptのASTというものを触る必要が出てくると思います。 この記事では、その取っ掛かりとなる案内を簡単にまとめたものです。 ASTとは AST(Abstract Syntax Tree)はコードをパースした抽象構文木のこと。 JavaScriptの場合はJavaScriptオブジェクト(JSON)として表現されます。 コード: { "range": [ 0, 10 ], "type": "Program", "body": [ { "range": [ 0, 10 ], "type": "VariableDeclaration", "declarations": [ { "range": [ 4, 9 ], "type": "VariableDeclarator", "id": {
With things like TypeScript and Flow becoming more popular, I'd really like to find a way to incorporate type annotations into ESTree in some sort of common way so we can start creating tooling around it. In particular, we're getting more requests in ESLint to be able to write rules around type annotations, but without having this is information in a predictable place, it's really hard to do that
Written by Jamie Kyle A guided handbook on how to use Babel and how to create plugins for Babel. Translations English Afrikaans العربية Català Čeština Dansk Deutsch Ελληνικά Español فارسی Français עִברִית Italiano 日本語 한국어 Magyar Nederlands Norsk Polskie Português Português (Brasil) Română Русский Српски језик (Ћирилица) Suomi Svenska Türkçe Tiếng Việt Українська 中文 繁體中文 Request another translation
What is the Shift AST? Represents the structure of an ECMAScript program as a tree Easily transformed to create new programs or analysed to create reports or inform other computations Why is it relevant to you? ECMAScript ASTs are used in the vast majority of language tooling: linters, compilers, minifiers, refactoring tools, IDEs, etc. Nearly eliminates the chance of accidentally creating an AST
Some functions to help transform an acorn/babel ast to esprima format. Primarily for use in babel-eslint, babel-jscs, and ast explorer There are no dependencies (the methods were changed to pass in dependencies instead) The current functions exposed are: function attachComments(ast, comments, tokens) This modifies the comments passed in. function toTokens(tokens, tt) tt is require("babel-core").ac
今回power-doctestをシンプルなものへと作りなおしました。 rewrite simply by azu · Pull Request #11 · azu/power-doctest 1.0未満のバージョンはツール自体に変換したコードの実行=>レポート表示の機能があったのですが、そこを削除して変換のみを行うように書き換えました。 実行機能はやっぱりとても複雑で、Nodeだけでも結構制御が大変なので、単純にassertに変換して後は他のツールと組み合わせて実行できるような形がいいかなと思いました。 使い方 azu/power-doctest さきほども書いたように変換機能しかないのでライブラリとして使うのがいい気がしますが、単純なファイルを指定して変換するCLIの機能だけは入っています。
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く