Degordian js coding standards


482.0.02 years ago4 years agoMinified + gzip package size for @degordian/standards in KB



Degordian js coding standard


Procedure for adding new rules to the repository after code reviewing:

  1. Check if the error is recurring or critical (important for everybody)
  2. Create a pull request
    1. Write a rule to correct the mistake
    2. Write a short code snippet (https://help.github.com/articles/creating-and-highlighting-code-blocks/)
      1. Keep it generic
      2. Minimal code possible
      3. Avoid copy/pasting from private projects
  3. Create a pull request
  4. If the rule can be automated, write a rule for ESlint

Prettier setup

Using the config in your project: https://prettier.io/docs/en/configuration.html#sharing-configurations

  1. add prettier as a project dependency (yarn add prettier | npm install prettier)
  2. add prettier config key to package.json, e.g.:
        "name": "my-awesome-project",
        "version": "0.1.0",
        "prettier": "@degordian/standards/standards/prettier/.prettierrc.json"
  3. Configure your IDE for formatting
  4. If you want to format the whole codebase recursively, run this command (or add it to npm scripts)
    • *you may need to change the source directory and extensions based on your criteria
      prettier --write \"{src,test}/**/*.{ts,tsx,js,jsx,scss}\"
  5. Success, you may now enjoy meaningful code reviews that focus on logic and features, and not the formatting. 🎉

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.