Skip to content

Commit

Permalink
Merge branch 'main' into max
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante authored Jul 27, 2024
2 parents 5cc5617 + a6dc171 commit 1962022
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 40 deletions.
4 changes: 0 additions & 4 deletions .github/funding.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
- 14
- 12
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm install
Expand Down
79 changes: 51 additions & 28 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ module.exports = {
],
'no-empty-static-block': 'error',
'no-ex-assign': 'error',
'no-extra-boolean-cast': 'error',
'no-extra-boolean-cast': [
'error',
{
enforceForInnerExpressions: true
},
],
// Disabled because of https://github.com/eslint/eslint/issues/6028
// 'no-extra-parens': [
// 'error',
Expand Down Expand Up @@ -222,9 +227,18 @@ module.exports = {
'no-restricted-globals': [
'error',
'event',
// TODO: Enable this in 2025.
// {
// name: 'Buffer',
// message: 'Use Uint8Array instead. See: https://sindresorhus.com/blog/goodbye-nodejs-buffer',
// },
{
name: 'atob',
message: 'This API is deprecated. Use https://github.com/sindresorhus/uint8array-extras instead.',
},
{
name: 'Buffer',
message: 'Use Uint8Array instead. See: https://sindresorhus.com/blog/goodbye-nodejs-buffer',
name: 'btoa',
message: 'This API is deprecated. Use https://github.com/sindresorhus/uint8array-extras instead.',
},
],
'no-shadow-restricted-names': 'error',
Expand All @@ -239,6 +253,7 @@ module.exports = {
'error',
{
vars: 'all',
varsIgnorePattern: /^_/.source,
args: 'after-used',
ignoreRestSiblings: true,
argsIgnorePattern: /^_/.source,
Expand All @@ -256,14 +271,15 @@ module.exports = {
'sys',
'querystring',
'colors',
{
name: 'buffer',
message: 'Use Uint8Array instead. See: https://sindresorhus.com/blog/goodbye-nodejs-buffer',
},
{
name: 'node:buffer',
message: 'Use Uint8Array instead. See: https://sindresorhus.com/blog/goodbye-nodejs-buffer',
},
// TODO: Enable this in 2025.
// {
// name: 'buffer',
// message: 'Use Uint8Array instead. See: https://sindresorhus.com/blog/goodbye-nodejs-buffer',
// },
// {
// name: 'node:buffer',
// message: 'Use Uint8Array instead. See: https://sindresorhus.com/blog/goodbye-nodejs-buffer',
// },
],
'array-bracket-newline': [
'error',
Expand Down Expand Up @@ -362,24 +378,34 @@ module.exports = {
'unix',
],
'lines-between-class-members': [
'error',
{
enforce: [
{
blankLine: 'always',
prev: '*',
next: 'method',
},
{
blankLine: 'always',
prev: 'method',
next: 'field',
},
{
blankLine: 'never',
prev: 'field',
next: 'field',
},
],
},
],
'logical-assignment-operators': [
'error',
'always',
{
// Workaround to allow class fields to not have lines between them.
// TODO: Get ESLint to add an option to ignore class fields.
exceptAfterSingleLine: true,
enforceForIfStatements: true,
},
],

// TODO: Enable this again when targeting Node.js 16.
// 'logical-assignment-operators': [
// 'error',
// 'always',
// {
// enforceForIfStatements: true,
// },
// ],

'max-depth': 'warn',
'max-len': [
'warn',
Expand Down Expand Up @@ -642,10 +668,7 @@ module.exports = {
},
],
'prefer-numeric-literals': 'error',

// TODO: Enable when targeting Node.js 16.
// 'prefer-object-has-own': 'error',

'prefer-object-has-own': 'error',
'prefer-rest-params': 'error',
'prefer-spread': 'error',
'require-yield': 'error',
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-xo",
"version": "0.43.1",
"version": "0.45.0",
"description": "ESLint shareable config for XO",
"license": "MIT",
"repository": "xojs/eslint-config-xo",
Expand All @@ -10,8 +10,9 @@
"email": "[email protected]",
"url": "https://sindresorhus.com"
},
"sideEffects": false,
"engines": {
"node": ">=12"
"node": ">=18"
},
"scripts": {
"test": "eslint . && ava"
Expand Down Expand Up @@ -53,10 +54,10 @@
},
"devDependencies": {
"ava": "^2.4.0",
"eslint": "^8.50.0",
"eslint": "^8.56.0",
"is-plain-obj": "^3.0.0"
},
"peerDependencies": {
"eslint": ">=8.50.0"
"eslint": ">=8.56.0"
}
}
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ See [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicor

## Install

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

## Usage
Expand Down

0 comments on commit 1962022

Please sign in to comment.