❤️ JavaScript/TypeScript linter (ESLint wrapper) with great defaults
MIT License
Bot releases are hidden (Show)
Important: We changed the cache structure, so you'll need to delete node_modules/.cache/xo
:
$ rm node_modules/.cache/xo
d.ts
files in JS projects. Read more.
extends
, envs
, globals
, plugins
(#429) 4cefdbcnode/no-unsupported-features
rules (#341) 2297c07import/no-unassigned-import
settings (#430) 0c78113eslint-config-prettier
override (#422) 9fbdb97$ xo --init
to $ npm init xo
6463dfe20 new rules 👌
default-param-last
function-call-argument-newline
grouped-accessor-pairs
no-constructor-return
no-dupe-else-if
no-import-assign
no-setter-return
no-useless-catch
prefer-exponentiation-operator
prefer-named-capture-group
prefer-object-spread
prefer-regex-literals
unicorn/prefer-modern-dom-apis
unicorn/prefer-negative-index
unicorn/prefer-replace-all
unicorn/prefer-string-slice
unicorn/prefer-trim-start-end
es2020
environment by default eb5ea2cimport/order
rule 776927funicorn/prefer-flat-map
only for Node.js >=11 (#403) 80c592eno-nested-ternary
rule when Prettier is used (#402) 537ef66.json
extension for JSON files in imports 7e56730prefer-named-capture-group
rule (for Node.js >=10 target) 21e7b57default-param-last
ruleprefer-regex-literals
ruleno-import-assign
ruleunicorn/expiring-todo-comments
ruleunicorn/no-nested-ternary
ruleunicorn/prefer-reflect-apply
ruleunicorn/prefer-string-slice
ruleunicorn/prefer-dataset
ruleunicorn/no-for-loop
ruleunicorn/no-zero-fractions
ruleunicorn/prefer-includes
ruleunicorn/prefer-text-content
ruleunicorn/prefer-node-remove
ruleunicorn/prefer-event-key
ruleunicorn/prefer-flat-map
rulenode/prefer-promises/fs
rule a3d74a6node/prefer-promises/dns
rule 8f8fc94.eslintignore
(#377) f6bf4c0cwd
-relative before linting (#372) 3033fcdimport/no-useless-path-segments
rule 8d6c5c5tap-snapshots/*.js
to default ignore list (#385) b73b11b--stdin --fix
always return the code even if nothing was fixed (#383) ec51d18node_modules/.cache/xo
. (#351) d1fd3e1import/no-unassigned-import
rule dd2c015padding-line-between-statements
no-useless-catch
unicorn/prefer-query-selector
unicorn/prefer-node-append
unicorn/no-unreadable-array-destructuring
unicorn/no-console-spaces
eslint-comments/disable-enable-pair
eslint-comments/no-aggregating-enable
eslint-comments/no-duplicate-disable
eslint-comments/no-unused-disable
eslint-comments/no-unused-enable
node/prefer-global/buffer
node/prefer-global/console
node/prefer-global/process
node/prefer-global/text-decoder
(When targeting Node.js 11)
node/prefer-global/text-encoder
(When targeting Node.js 11)
node/prefer-global/url-search-params
(When targeting Node.js 10)
node/prefer-global/url
(When targeting Node.js 10)
.ts
and .tsx
extensions by default. This caused a lot of problems for non-TS projects, so it has been reverted pending a better solution.quotes
rule is now set to disallow using template literals when you're not using any interpolation. https://github.com/xojs/eslint-config-xo/commit/ea693f32b4875928d410fbbb208152fb527be3d3
no-use-before-define
rule. It has too many false-positives. https://github.com/xojs/eslint-config-xo/commit/125759704552a56ef1f8d332c9c7a0933307c353
require-await
unicorn/prefer-exponentiation-operator
unicorn/catch-error-name
(See this thread if you're wondering why error
is preferred over err
) (Sorry about the churn, but this is an important milestone towards more readable code. Code is written once but read many times. We should optimize for the latter.)fixture{-*,}.{js,jsx}
fixture{s,}/**
{test,tests,spec,__tests__}/fixture{s,}/**
**/bundle.js
nodeVersion
option set in an override
block. https://github.com/xojs/xo/commit/98dee9a44aaf2a07f53740f09eeded7931762db7
--space
option parsing. https://github.com/xojs/xo/commit/f76c90107bc52d7be664867a276d735d54ae8c35
no-misleading-character-class
require-atomic-updates
no-async-promise-executor
ava/no-import-test-file
Fix space
/useTabs
conflict message with Prettier. https://github.com/xojs/xo/commit/36f7f38f3c2f495283cda764c68cfee9b4494973
Published by pvdlg over 6 years ago
trailingComma
Prettier option is now none
. https://github.com/xojs/xo/commit/f67ff58c7cafcc7e5ebacbd311532c6886f1063a
prettier-ignore
comments in capitalized-comments rule. https://github.com/xojs/eslint-config-xo/commit/6e417ff8c04fa7bbcabc6340c125ec524e101ae0
This release is way overdue, so glad to finally have it out! It includes a major ESLint upgrade, huge performance improvements, Prettier support, lots of new rules, and bug fixes.
The project was recently moved to a GitHub organization, and we got a new team member, Pierre Vanduynslager ✨
We now also have configs for TypeScript (using tslint
) and CSS & Sass (using stylelint
). And don't forget, we already have a config for React.
Many of the new rules in this release are from the eslint-plugin-unicorn
plugin, which could use some contributions.
engines
field in package.json
. https://github.com/xojs/xo/commit/0d1836816fbc2a223c33aa2b8378719ef7da3eb2
linebreak-style
rule on Windows. https://github.com/xojs/eslint-config-xo/commit/3f8179657736c4c078759416509ca9698e5321e6
spaced-comment
rule more lenient. https://github.com/xojs/eslint-config-xo/commit/e4f1f36531eefb7dfc58d772747ddb5e9c141a4a
_
as argument name in the no-unused-vars
rule. https://github.com/xojs/eslint-config-xo/commit/dda366b13a6ad50d38f807bd1d347e90ab91444e
--open
flag now opens errors first and not warnings. https://github.com/xojs/xo/commit/6f6a606af2f91db377257c5f83b921ef6d25f3dc
--compact
CLI flag. https://github.com/xojs/xo/commit/652a6e51a8812e1d573c55159d8f55794e97b870
babel-register
and babel-polyfill
from the no-unassigned-import
rule. https://github.com/xojs/xo/commit/70d6ab4015d182231eca46dc9b1b512e506a38b4
ecmaVersion
to 2018
. 9859dfb22 new rules!
semi-style
https://github.com/xojs/eslint-config-xo/commit/0b1680e5b6c5848d96150e774ff7da785bf480a5
for-direction
https://github.com/xojs/eslint-config-xo/commit/c957c7f3e0a34866816d339ac714d82e4c225c4c
switch-colon-spacing
https://github.com/xojs/eslint-config-xo/commit/c1c8fc7f63c8f41d09a77078a6917c21e088d11c
no-buffer-constructor
https://github.com/xojs/eslint-config-xo/commit/ee366cbdf63b34cd43c01c6542d98e1cb9eb78bf
getter-return
https://github.com/xojs/eslint-config-xo/commit/40e1442d18e16eedfaf3a773ccf1c6a137780bf1
function-paren-newline
https://github.com/xojs/eslint-config-xo/commit/9e90fdc3bef013d6a85a1afd59d4b8088a62ad7a
lines-between-class-members
https://github.com/xojs/eslint-config-xo/commit/c7f63cde323d98ffea20d7b3d411ead57fc9799f
array-bracket-newline
https://github.com/xojs/eslint-config-xo/commit/e2f374818e91cea854864c0e42e839edb9d306b2
unicorn/prefer-add-event-listener
unicorn/prefer-spread rule
unicorn/no-unsafe-regex
unicorn/error-message
unicorn/import-index
unicorn/new-for-builtins
unicorn/regex-shorthand
unicorn/escape-case
unicorn/no-hex-escape
promise/no-return-wrap
https://github.com/xojs/xo/commit/4273f8aa24b4c4dc2383d64e53d496f2e020481f
promise/no-return-in-finally
https://github.com/xojs/xo/commit/4273f8aa24b4c4dc2383d64e53d496f2e020481f
node/no-unpublished-bin
https://github.com/xojs/xo/commit/16fb8e2fee3a1176aa04fda058e9a02b358719b1
node/process-exit-as-throw
https://github.com/xojs/xo/commit/16fb8e2fee3a1176aa04fda058e9a02b358719b1
node/no-deprecated-api
https://github.com/xojs/xo/commit/16fb8e2fee3a1176aa04fda058e9a02b358719b1
https://github.com/sindresorhus/xo/compare/v0.18.2...v0.20.0
Why is this not 0.19.0? That version got tainted by an incorrect publish a long time ago.
Published by sindresorhus over 7 years ago
We finally fixed all the gitignore issues. Thanks to hard work by @marionebl and @schnittstabil.
The --open
flag now also supports VS Code.
https://github.com/sindresorhus/xo/compare/v0.18.1...v0.18.2
Published by sindresorhus over 7 years ago
Removes the promise/no-promise-in-callback
and promise/no-callback-in-promise
rules. They were more annoying than useful. You usually have to deal with a lot of non-Promise APIs, so I had to disable it too many times. Some APIs will also never be Promise, like events and streams. https://github.com/sindresorhus/xo/commit/225385202277d1e3c34f14582f9e96225df37e45
https://github.com/sindresorhus/xo/compare/v0.18.0...v0.18.1
Published by sindresorhus over 7 years ago
esnext
option is now true
by default. This means it now enforces the use of as much ES2015+ syntax as Node.js 4 supports. https://github.com/sindresorhus/xo/commit/61c046cab3d908c4c0582211d215e4c7f0d7cf20
$ xo --fix
.--stdin-filename
CLI flag. https://github.com/sindresorhus/xo/commit/0d88cde7e860d55347c40363f8b8985d67b79026
import/no-dynamic-require
rule. https://github.com/sindresorhus/xo/commit/29a5263742f31109cd3fdfd19eb4b3ea0d27de4b
https://github.com/sindresorhus/xo/compare/v0.17.1...v0.18.0
Published by sindresorhus about 8 years ago
Check out the new feature highlight on what makes XO awesome.
Also excited to share that Hyper.app is now using XO \o/
$ xo --fix
. Try it out when upgrading!(If you want to convert ES5 syntax to ES6, you might want to run it with $ xo --fix --esnext
)
babel-eslint
as ESLint now supports async/await. See the parser
option if you still need it, and ensure you have babel-eslint
in devDependencies
. https://github.com/sindresorhus/xo/commit/04733f1724a74c494458754d4982de53cdc30eeb
.gitignore
. https://github.com/sindresorhus/xo/commit/fa99f36494550d967e115b3730d2ca4508f6f038
--quiet
CLI flag. https://github.com/sindresorhus/xo/commit/bb76a2d28817a176056c2da37f09112810643b4a
extension
option. https://github.com/sindresorhus/xo/commit/3c428474cd51579ed55ac94f8e9a467cd48fe9ac
settings
option. https://github.com/sindresorhus/xo/commit/85c609413060f463911a3abdee24c280ed177c9c
parser
option. https://github.com/sindresorhus/xo/commit/85c609413060f463911a3abdee24c280ed177c9c
https://github.com/sindresorhus/xo/compare/v0.16.0...v0.17.0