From 27f9124a85d02476e243db709033f5d6e964b2bd Mon Sep 17 00:00:00 2001 From: chris Date: Sat, 14 Sep 2024 15:21:37 -0700 Subject: [PATCH] chore: upgrade eslint to v9.10.0 --- .eslintignore | 1 - eslint.config.js | 32 ++++++++++++++++++++++++++++++++ package.json | 8 ++++---- 3 files changed, 36 insertions(+), 5 deletions(-) delete mode 100644 .eslintignore create mode 100644 eslint.config.js diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 93bbd9b..0000000 --- a/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -!.*.js diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..2655f6e --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,32 @@ +const js = require('@eslint/js'); +const unicorn = require('eslint-plugin-unicorn'); +const xolass = require('eslint-config-xo-lass'); + +module.exports = [ + js.configs.recommended, + unicorn.configs['flat/recommended'], + { + ignores: ['!.*.js'], + languageOptions: { + ecmaVersion: 2022, + sourceType: 'commonjs', + globals: { + console: true, + setTimeout: true, + + __dirname: true, + before: true, + after: true, + beforeEach: true, + describe: true, + it: true + } + }, + rules: { + ...xolass.rules, + 'promise/prefer-await-to-then': 0, + 'logical-assignment-operators': 0, + 'arrow-body-style': 0 + } + } +]; diff --git a/package.json b/package.json index fcde93b..ea6fc14 100644 --- a/package.json +++ b/package.json @@ -29,8 +29,9 @@ "@commitlint/cli": "^17.7.2", "@commitlint/config-conventional": "^17.7.0", "@ladjs/env": "^4.0.0", - "eslint": "^8.39.0", + "eslint": "^9.10.0", "eslint-config-xo-lass": "^2.0.1", + "eslint-plugin-unicorn": "55.0.0", "fixpack": "^4.0.0", "husky": "^8.0.3", "jsdoc-to-markdown": "^8.0.0", @@ -40,8 +41,7 @@ "nyc": "^17.0.0", "remark-cli": "11", "remark-preset-github": "^4.0.4", - "supertest": "^7.0.0", - "xo": "0.53.1" + "supertest": "^7.0.0" }, "engines": { "node": ">= 18" @@ -66,7 +66,7 @@ "bench": "make -C bench", "coverage": "nyc npm run test", "docs": "NODE_ENV=test jsdoc2md -t ./lib/API_tpl.hbs --src ./lib/*.js >| API.md", - "lint": "xo --fix && remark . -qfo && fixpack", + "lint": "eslint . && remark . -qfo && fixpack", "prepare": "husky install", "pretest": "npm run lint", "test": "mocha test/**/*.js",