Socket
Socket
Sign inDemoInstall

eslint-config-xo

Package Overview
Dependencies
0
Maintainers
3
Versions
70
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-config-xo


Version published
Weekly downloads
213K
decreased by-15.61%
Maintainers
3
Created
Weekly downloads
 

Package description

What is eslint-config-xo?

eslint-config-xo is a shareable ESLint configuration package that enforces the XO style guide. XO is a strict and opinionated code style guide for JavaScript and TypeScript, which aims to enforce best practices and consistency in codebases.

What are eslint-config-xo's main functionalities?

Enforcing Code Style

By extending the 'xo' configuration in your ESLint configuration file, you can enforce the XO style guide in your project. This includes rules for code formatting, best practices, and potential errors.

{
  "extends": "xo"
}

TypeScript Support

eslint-config-xo provides support for TypeScript by allowing you to extend the 'xo-typescript' configuration. This ensures that TypeScript-specific rules and best practices are enforced.

{
  "extends": "xo",
  "overrides": [
    {
      "files": "*.ts",
      "extends": "xo-typescript"
    }
  ]
}

React Support

For projects using React, you can extend the 'xo-react' configuration to enforce React-specific linting rules and best practices.

{
  "extends": [
    "xo",
    "xo-react"
  ]
}

Other packages similar to eslint-config-xo

Readme

Source

eslint-config-xo Build Status

ESLint shareable config for XO

This is for advanced users. You probably want to use XO directly.

See eslint-plugin-unicorn for some additional useful rules.

Install

$ npm install --save-dev eslint-config-xo

Usage

Add some ESLint config to your package.json:

{
	"name": "my-awesome-project",
	"eslintConfig": {
		"extends": "xo"
	}
}

Or to .eslintrc:

{
	"extends": "xo"
}

Supports parsing ES2015+, but doesn't enforce it by default.

This package also exposes xo/esnext if you want ES2015+ rules:

{
	"extends": "xo/esnext"
}

And xo/browser if you're in the browser:

{
	"extends": "xo/browser"
}

Use the XO CLI instead

XO is an ESLint wrapper with great defaults.

Here are some reason why you should use the XO CLI instead of this config:

  • XO comes bundled with this config.
  • Beautiful output.
  • Bundles many useful plugins, like eslint-plugin-unicorn, eslint-plugin-import, eslint-plugin-ava, and more.
  • No need to specify file paths to lint. It will lint all JS files except commonly ignored paths.
  • Super simple to add XO to a project: $ xo --init
  • Specify indent and semicolon preferences easily without messing with the rule config.
  • Config/rule overrides per files/globs. (ESLint still doesn't support this)
  • Can open all files with errors at the correct line in your editor. (See the --open flag)
  • The editor plugins are IMHO better than the ESLint ones. (Subjective)

tl;dr You miss out on a lot by just using this config.

License

MIT © Sindre Sorhus

Keywords

FAQs

Last updated on 03 Sep 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc