fourdigit / eslint-config-fourdigit

Fourdigitのプロジェクトで使用するESLint+Prettierの共有設定ファイルです。
MIT License
11 stars 3 forks source link

[WIP] make .editorconfig easier to share the setting #7

Closed NguyenTrung1995 closed 6 years ago

NguyenTrung1995 commented 6 years ago

To do

TakuyaAbe commented 6 years ago

@NguyenTrung1995

Please add the editor config into https://github.com/fourdigit/editorconfig-config-fourdigit , not do work on this repository.

If the project contain .editorconfig file, we will add rules that it does not. I think this behavior is may not good.

Let me explain with a example.

Alice: Developer 1(who make repo & config file of editoconfig) Bob: Developer 2(who clone the repository that Alice made)

  1. Alice create a project (without .editorconfig)
  2. Alice add editorconfig by running yarn add @fourdigit/eslint-config-fourdigit
  3. Alice do git commit & git push
  4. Alice modify editor config & git push
  5. Bob clone the repository
  6. postinstall of eslint-config-fourdigit run automatically & editorconfig is modified by the script
  7. Bob have to reset the modification by the postinstall because the genue setting of the project is what Alice modified.

Everytime other developer joins, the burden occurs. So, the strategy "If the project contain .editorconfig file, we will add rules that it does not." might not better.

Instead of adding the feature, please add a instruction to update editorconfig. e.g.

## Update .editorconfig

When this package is installed & no `.editorconfig` file is existed on your project, npm automatically copies the config from `ndoe_modules/@fourdigit/editorconfig-config-fourdigit/.editorconfig` to project root.
When you want to update your editorconfig manually, please run following command.  

cp './node_modules/@fourdigit/editorconfig-config-fourdigit/.editorconfig' .editorconfig
TakuyaAbe commented 6 years ago

https://www.npmjs.com/package/@fourdigit/editorconfig-config-fourdigit で公開済み