From 3ebcbb11c0fe84487b4985f815aba02682685b60 Mon Sep 17 00:00:00 2001 From: Peter Kulko Date: Tue, 26 Nov 2024 12:01:44 +0200 Subject: [PATCH] refactor: updated Readme file --- README.md | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b221daa..ae0b398 100644 --- a/README.md +++ b/README.md @@ -1 +1,66 @@ -# rg-frontend-linters +# RG Frontend Linters + +**RG Frontend Linters** provides standardized configurations for **ESLint**, **Stylelint**, and **CommitLint**. +This ensures consistent code quality, style, and commit message conventions across all projects. + +## Configurations + +- **ESLint**: Enforce consistent JavaScript code style and quality. +- **Stylelint**: Maintain uniform SCSS formatting and conventions. +- **CommitLint**: Validate commit messages against defined standards. + +--- + +## Installation and Usage + +### 1. Add the repository to `package.json`: + +Include `rg-frontend-linters` as a dependency: + +```json +"dependencies": { + "rg-frontend-linters": "git+https://github.com/raccoongang/rg-frontend-linters.git#main" +} +``` + +Install the dependency: + +```bash + npm install +``` + +### 2. Create a configuration file + +Add a configuration file for the desired linter in the root of your project. For example, to configure Stylelint: + +```bash + touch .stylelintrc.js +``` + +### 3. Initialize the configuration + +Use the provided helper function to set up the linter configuration. For example: + +Stylelint (`.stylelintrc.js`): + +```javascript +const { createConfig } = require('rg-frontend-linters'); + +module.exports = createConfig('stylelint'); +``` + +ESLint (`.eslintrc.js`): + +```javascript +const { createConfig } = require('rg-frontend-linters'); + +module.exports = createConfig('eslint'); +``` + +CommitLint (`commitlint.config.js`): + +```javascript +const { createConfig } = require('rg-frontend-linters'); + +module.exports = createConfig('commitlint'); +```