0.0.6 • Published 3 years ago

ui-lint-config-prettier-test v0.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@sr/ui-linter-config-prettier

NPM Version NPM Downloads Node.js Version Licence

SmartRecruiters’ linting and formatting configs for Prettier.

Linting & formatting configuration for angular project

ESLint compatibility

Current version is designed to work with eslint@^7.

Installation & configuration

Step 1. Install the latest @sr/ui-linter-config-prettier as devDependency (-D) in your project:

$ npm i @sr/ui-linter-config-prettier  -D

Step 2. Install libraries, plugins and extensions required by configs as devDependencies:

$ npx install-peerdeps --dev @sr/ui-linter-config-prettier

Step 3. Configure prettier in your project:

In root directory of your client-app and server-app, create .prettierrc.js with following content:

module.exports = {
  ...require("@sr/ui-linter-config-prettier")
};

Step 4. Configure your IDE (VSCode configuration , IntelliJ IDEA configuration).

Step 5. (optional) Configure husky to run linter on pre-commit/pre-push .

Configuration for Intellij IDEA

Follow instructions : (link)https://www.jetbrains.com/help/idea/prettier.html#ws_prettier_install

Configuration for VSCode

Visit the extensions section of VSCode (cmd + shift + x for MacOS / ctrl + shift + x for windows) and search for Prettier — Code formatter and install it.

Now configure VSCode settings for ESlint to work on autosave. Follow the below-mentioned steps:

  • Go to File > Preferences> Settings
  • On your right-hand side, there is an icon to Open Settings in JSON format. Click on that icon.
  • Add below JSON code there
    "editor.defaultFormatter": "ebsenp.prettier-vscode",
    "editor.formatOnSave": true

References

License

MIT