Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xinyao27/style-guide
https://github.com/xinyao27/style-guide
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/xinyao27/style-guide
- Owner: xinyao27
- License: mit
- Created: 2024-01-09T03:53:10.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-10-10T05:14:45.000Z (3 months ago)
- Last Synced: 2024-10-10T05:38:17.009Z (3 months ago)
- Language: JavaScript
- Size: 645 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# The XYStack Style Guide
## Introduction
This repository is the home of @xinyao27 style guide, which includes configs for
popular linting and styling tools.The following configs are available, and are designed to be used together.
- [The XYStack Style Guide](#the-xystack-style-guide)
- [Introduction](#introduction)
- [Contributing](#contributing)
- [Installation](#installation)
- [Prettier](#prettier)
- [ESLint](#eslint)
- [Usage](#usage)
- [VSCode](#vscode)
- [TypeScript](#typescript)## Contributing
Please read our [contributing](https://github.com/xystack/style-guide/blob/main/CONTRIBUTING.md)
guide before creating a pull request.## Installation
### Starter Wizard
```sh
npx @xystack/style-guide@latest
```### Manual Installation
All of our configs are contained in one package, `@xystack/style-guide`. To install:
```sh
# If you use npm
npm i --save-dev @xystack/style-guide# If you use pmpm
pnpm i --save-dev @xystack/style-guide# If you use Yarn
yarn add --dev @xystack/style-guide
```Some of our ESLint configs require peer dependencies. We'll note those
alongside the available configs in the [ESLint](#eslint) section.## Prettier
> Note: Prettier is a peer-dependency of this package, and should be installed
> at the root of your project.
>
> See: https://prettier.io/docs/en/install.htmlTo use the shared Prettier config, set the following in `package.json`.
```json
{
"prettier": "@xystack/style-guide/prettier"
}
```## ESLint
> Note: ESLint is a peer-dependency of this package, and should be installed
> at the root of your project.
>
> See: https://eslint.org/docs/user-guide/getting-started#installation-and-usage### Usage
```js
// eslint.config.js
import { all } from '@xystack/style-guide/eslint'export default all
```### VSCode
```json
{
"eslint.useFlatConfig": true,
"prettier.enable": false,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.organizeImports": "never"
},
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"html",
"markdown",
"json",
"jsonc",
"astro",
"css",
"less",
"scss",
"pcss",
"postcss"
],
"html.format.enable": false
}
```## TypeScript
To use the shared TypeScript config, set the following in `tsconfig.json`.
```json
{
"extends": "@xystack/style-guide/typescript"
}
```