https://github.com/qxy-fe/configs
:gear: QXY-FE config presets
https://github.com/qxy-fe/configs
eslint-config prettier-config stylelint-config
Last synced: 4 months ago
JSON representation
:gear: QXY-FE config presets
- Host: GitHub
- URL: https://github.com/qxy-fe/configs
- Owner: qxy-fe
- License: mit
- Archived: true
- Created: 2019-12-07T20:25:06.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2024-07-12T20:58:53.000Z (over 1 year ago)
- Last Synced: 2025-06-04T07:49:22.188Z (5 months ago)
- Topics: eslint-config, prettier-config, stylelint-config
- Language: JavaScript
- Homepage:
- Size: 2.43 MB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# configs
[](https://github.com//qxy-fe/configs/actions)
[](https://github.com/qxy-fe/configs/blob/main/LICENSE)
Opinionable & sharable linter configs.
---
> [!CAUTION]
> This repository is archived. Please use other shareable linter rules ASAP.
---
## Install
Install eslint and peers:
```bash
yarn add @qxy/eslint-config@next eslint typescript -D
```
Install prettier and peers:
```bash
yarn add @qxy/prettier-config@nex prettier -D
```
Install stylelint and peers:
```bash
yarn add @qxy/stylelint-config@nex @qxy/prettier-config@nex postcss stylelint prettier -D
```
## Config
**ESLint**
Configuration in `.eslintrc.json`:
```json
{
"root": true,
"extends": ["@qxy"]
}
```
**Prettier**
Configuration in `package.json`:
```json
{
"prettier": "@qxy/prettier-config"
}
```
**Stylelint**
Configuration in `stylelint.config.cjs`:
```js
module.exports = {
extends: ['@qxy/stylelint-config'],
rules: {
// override rules
},
}
```
## Usage
Run linter with npm scripts:
```json
{
"scripts": {
"lint:script": "eslint .",
"lint:style": "stylelint \"src/**/*.{vue,scss}\""
}
}
```
Use `yarn lint:script --fix` and `yarn lint:style --fix` to autofix fixable problems.
Lint staged files only via `nano-staged`:
```json
{
"nano-staged": {
"*.{js,ts,json,vue,html,md,yml,yaml}": "eslint --fix",
"*.{css,vue,scss}": "stylelint --fix"
}
}
```
Auto fix when coding with `VSCode`:
Configuration in `.vscode/settings.json`
```json
{
"prettier.enable": true,
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"eslint.validate": [
"vue",
"yaml",
"html",
"json",
"jsonc",
"json5",
"markdown",
"javascript",
"typescript",
"javascriptreact",
"typescriptreact"
],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "always"
},
"[javascript][typescript][vue]": {
"editor.formatOnSave": false
}
}
```
## License
[MIT](./LICENSE) License © 2020-PRESENT [qxy-fe](https://github.com/qxy-fe)