https://github.com/tommy-mitchell/eslint-config-xo
Personal config for XO.
https://github.com/tommy-mitchell/eslint-config-xo
xo xo-config
Last synced: 3 months ago
JSON representation
Personal config for XO.
- Host: GitHub
- URL: https://github.com/tommy-mitchell/eslint-config-xo
- Owner: tommy-mitchell
- License: mit
- Created: 2024-02-18T00:03:23.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-14T14:54:59.000Z (3 months ago)
- Last Synced: 2025-03-14T15:08:45.404Z (3 months ago)
- Topics: xo, xo-config
- Language: JavaScript
- Homepage: https://npm.im/@tommy-mitchell/eslint-config-xo
- Size: 106 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
# @tommy-mitchell/eslint-config-xo
Personal config for [`XO`](https://github.com/xojs/xo). Recommended to be used with my [`dprint` config](https://github.com/tommy-mitchell/dprint-config).
## Install
```sh
npm install --save-dev @tommy-mitchell/eslint-config-xo@beta xo@npm:@spence-s/flat-xo@latest
```Other Package Managers
```sh
yarn add --dev @tommy-mitchell/eslint-config-xo@beta xo@npm:@spence-s/flat-xo@latest
```With dprint
```sh
npm install --save-dev @tommy-mitchell/eslint-config-xo@beta xo@npm:@spence-s/flat-xo@latest @tommy-mitchell/dprint-config dprint
``````sh
yarn add --dev @tommy-mitchell/eslint-config-xo@beta xo@npm:@spence-s/flat-xo@latest @tommy-mitchell/dprint-config dprint
```### Peer Dependencies
- [xo](https://github.com/xojs/xo) - JavaScript/TypeScript linter (ESLint wrapper) with great defaults.
- [dprint](https://github.com/dprint/dprint) (*Optional*) - Pluggable and configurable code formatting platform written in Rust.
- [react](https://react.dev) (*Optional*) - The library for web and native user interfaces.
- [tailwindcss](https://tailwindcss.com) (*Optional*) - A utility-first CSS framework for rapid UI development.## Usage (Flat Config)
```js
// xo.config.js
import * as configs from "@tommy-mitchell/eslint-config-xo";export default [
...configs.xo,
...configs.react, // If using React
...configs.next, // If using Next.js
...configs.tailwind, // If using Tailwind CSS
...configs.dprint, // If using dprint (must be last to override stylistic rules)
// Plus any overrides
]
```### VS Code
Add the following to your `settings.json`:
```jsonc
"xo.enable": true,
"xo.format.enable": true,
"xo.overrideSeverity": "warn",
"xo.debounce": 100,
```If formatting with `dprint`:
```jsonc
"[javascript][javascriptreact][typescript][typescriptreact]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "dprint.dprint",
"editor.codeActionsOnSave": {
"source.fixAll.xo": "explicit", // Will run lint autofixes
},
},
```## Related
- [XO (VS Code Extension)](https://marketplace.visualstudio.com/items?itemName=samverschueren.linter-xo) - Linter for XO.