1.1.0 • Published 5 years ago

generator-scaffold-code-guidelines v1.1.0

Weekly downloads
1
License
Apache-2.0
Repository
-
Last release
5 years ago

Scaffold Code Guidelines Generator

Import Code Guidelines configurations into project.

There are rules for SCSS (stylelint) and JS (ESlint). There is also a .editorconfig and .prettierrc to help you follow guidelines as easily as possible. You can read more about code formatting and editor configuration in knowledge base.

This package is built on Yeoman Generator, read more about it in knowledge base.

Installation

  1. Check if you have installed Yeoman already.
npm list -g --depth 0
  1. If you haven't, do so.
npm install -g yo
  1. Install this generator itself.
npm install -g git+ssh://git@git.proofreason.com:jan.hajek/scaffold-code-guidelines.git

You need to have SSH key correctly set up. If you are generating the key, don't forget paste your email instead of “GitLab” in command ssh-keygen -t rsa -C “GitLab” -b 4096

  1. Then, we need to run command which will output our configuration files. Make sure you're in your projects folder and run:
yo scaffold-code-guidelines

These configuration files are stored in the globally installed package. You should update this package before starting new project.

Adding code guidelines to the ongoing project

In case you are updating old project, there might be a conflict between new files and those already present. Yeoman asks you what to do, don't worry about loosing anything. However, you generally want to have the standard version of the configuration files. If you have your files versioned, you can safely overwrite them. Next, you check git diff to see, if there was something worth keeping and take it back.

Updating the rules in configs

If you want to change the rules, you can do so in this repo. Let the team know, though, so everyone can update their package. You can also make local changes, but that's not recommended, the purpose of those guidelines is to write unified code.

Even smoother work

Download editor extensions (stylelint, eslint, prettier), so the checking is done as you write and formating errors are fixed on save. Check knowledge base on how to do so.

1.1.0

5 years ago

1.0.1

5 years ago