-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
31a86b1
commit 3ebcbb1
Showing
1 changed file
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'); | ||
``` |