Skip to content

ESLint #21

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

Closed
8 tasks done
azu opened this issue Aug 29, 2015 · 4 comments
Closed
8 tasks done

ESLint #21

azu opened this issue Aug 29, 2015 · 4 comments
Labels
Status: PR Welcome Welcome to Pull Request Status: Proposal Request for comments

Comments

@azu
Copy link
Owner

azu commented Aug 29, 2015

ESLintのアーキテクチャ

URL: http://eslint.org/

どう書ける?

consoleが残ってないかを検出するno-console.js

module.exports = function(context) {
    return {
        "MemberExpression": function(node) {
            if (node.object.name === "console") {
                context.report(node, "Unexpected console statement.");
            }
        }
    };
};

どういう仕組み?

どういう事に向いてる?

  • ルールが独立したものになるのでルール間で依存がない
  • Plugabbleなルールを追加して管理するタイプ

どういう事に向いていない?

  • それぞれのプラグインが順序的な依存があるもの
  • 例えばプラグインがソースに対して書き換えのような破壊的な変更を含む場合、それぞれのプラグインが変更した内容をマージする仕組みが必要になってしまう。

この仕組みを使ってるもの

チェックリスト

  • どう書ける?
  • どういう仕組み?
  • どういう用途に向いている?
  • どういう用途に向いていない?
  • この仕組みを使ってるもの
  • 実装してみよう
  • エコシステム
  • まとめ
@azu azu added Status: Proposal Request for comments Status: PR Welcome Welcome to Pull Request labels Aug 29, 2015
@azu
Copy link
Owner Author

azu commented Aug 30, 2015

@azu
Copy link
Owner Author

azu commented Aug 31, 2015

いわゆるpub/subなパターンといえる

@azu
Copy link
Owner Author

azu commented Sep 3, 2015

eslint/eslint#3134 (comment)

やっぱりwriteするには吸収層が必要。
このアーキテクチャー的にプラグインは基本的writeは難しいので、擬似的にwriteする仕組みは必要。

@azu
Copy link
Owner Author

azu commented Sep 4, 2015

ひとまず書けたので close #21
細かいところは別Issueで直そう

@azu azu closed this as completed Sep 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: PR Welcome Welcome to Pull Request Status: Proposal Request for comments
Projects
None yet
Development

No branches or pull requests

1 participant