0.2.4 • Published 4 years ago

@studyworld/code v0.2.4

Weekly downloads
4
License
MIT
Repository
-
Last release
4 years ago

@studyworld/code

Набор конфигов для prettier и eslint

Как использовать

npm i --save-dev @studyworld/code

package.json

{
    // ...
    "prettier": "@studyworld/code/prettier",
    "eslintConfig": {
        "extends": "./node_modules/@studyworld/code/eslint"
    },
    // ...
}

Prettier

WebStorm

Go to Preferences | Tools | File Watchers and click + to add a new watcher.

In Webstorm 2018.2, select Prettier from the list, review the configuration, add any additional arguments if needed, and click OK.

In older IDE versions, select Custom and do the following configuration:

  • Name: Prettier or any other name
  • File Type: JavaScript (or Any if you want to run Prettier on all files)
  • Scope: Project Files
  • Program: full path to .bin/prettier or .bin\prettier.cmd in the project’s node_module folder. Or, if Prettier is installed globally, select prettier on macOS and Linux or C:\Users\user_name\AppData\Roaming\npm\prettier.cmd on Windows (or whatever npm prefix -g returns).
  • Arguments: --write $FilePath$
  • Output paths to refresh: $FilePathRelativeToProjectRoot$
  • Working directory: $ProjectFileDir$
  • Auto-save edited files to trigger the watcher: Uncheck to reformat on Save only.

ESLint

WebStorm

  • In the Settings/Preferences dialog go to Languages and Frameworks | JavaScript | Code Quality Tools | ESLint.
  • Select Automatic ESLint configuration.

VS Code

  • Install ESLint plugin from the extensions marketplace
  • Enjoy!
0.2.3

4 years ago

0.2.4

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.2.2

4 years ago

0.1.0

4 years ago