@peccul is peccu

(love peccu '(emacs lisp cat outdoor bicycle mac linux coffee))

.jshintrcを.eslintrcに変換する

Yeomanが.editorconfigや.jshintrcは生成してくれていたのですが、.eslintも使ってみたくなり、変換する方法を探しました。

eslintのIssueに上がっていて、マッパーを書いた人が現れていました。

github.com

このリポジトリを使えばすぐでした。

github.com

  • インストール
% git clone https://github.com/valorkin/eslint-rules-mapper.git
Cloning into 'eslint-rules-mapper'...
remote: Counting objects: 65, done.
remote: Total 65 (delta 0), reused 0 (delta 0), pack-reused 65
Unpacking objects: 100% (65/65), done.
Checking connectivity... done.
% cd eslint-rules-mapper
% npm install   
lodash@2.4.2 node_modules/lodash

eslint@0.12.0 node_modules/eslint
├── object-assign@2.0.0
├── escape-string-regexp@1.0.3
├── strip-json-comments@1.0.2
├── xml-escape@1.0.0
├── user-home@1.1.1
├── globals@4.0.0
├── estraverse@1.9.3
├── text-table@0.2.0
├── debug@2.1.3 (ms@0.7.0)
├── escope@1.0.3 (estraverse@2.0.0)
├── chalk@0.5.1 (ansi-styles@1.1.0, supports-color@0.2.0, has-ansi@0.1.0, strip-ansi@0.3.0)
├── minimatch@2.0.7 (brace-expansion@1.1.0)
├── mkdirp@0.5.0 (minimist@0.0.8)
├── concat-stream@1.4.8 (inherits@2.0.1, typedarray@0.0.6, readable-stream@1.1.13)
├── espree@1.12.3
├── doctrine@0.6.4 (isarray@0.0.1, esutils@1.1.6)
├── optionator@0.5.0 (type-check@0.3.1, deep-is@0.1.3, prelude-ls@1.1.1, levn@0.2.5, wordwrap@0.0.2, fast-levenshtein@1.0.6)
└── js-yaml@3.3.0 (esprima@2.2.0, argparse@1.0.2)
  • 変換
% cd path/to/project
% node path/to/eslint-rules-mapper/index.js ./.jshintrc >>./.eslintrc