Skip to content

Commit

Permalink
Upgrade ESLint to v9 and prettier to v3
Browse files Browse the repository at this point in the history
- Raises the minimum required Node.js version to `v20`

Additionally, bumps:
- `@babel/core`
- `@babel/eslint-parser`
- `eslint-config-prettier`
- `eslint-plugin-jsdoc`
- `esling-plugin-mocha`
- `eslint-plugin-prettier`
- `eslint-plugin-promise`
- `eslint-plugin-sort-destructure-keys`
- `eslint-plugin-sort-imports-requires`
- `eslint-plugin-sql-template`
- `globals`
  • Loading branch information
risantos committed Oct 16, 2024
1 parent d4efb2d commit 5d50b8c
Show file tree
Hide file tree
Showing 9 changed files with 709 additions and 608 deletions.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

1 change: 0 additions & 1 deletion .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: ['18', '20']
node: ['20', '22']

container:
image: node:${{ matrix.node }}-alpine
Expand Down
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ extend the [eslint-recommended](https://github.com/eslint/eslint/blob/master/con
as well as the [overrides](https://github.com/prettier/eslint-config-prettier/blob/master/index.js)
that allow the [Prettier](https://prettier.io) pretty-printer to reformat the code without conflicts.

## Status

[![npm version][npm-image]][npm-url]

## Installation

```sh
Expand All @@ -15,6 +19,33 @@ npm install eslint eslint-config-uphold prettier --save-dev

## Usage

### New (ESLint >= 9)

Create an `eslint.config.js` file with the following content:

```js
const uphold = require('eslint-config-uphold');

module.exports = uphold;
```

If you want to extend the config, you can do so like this:

```js
const uphold = require('eslint-config-uphold');
const yourPlugin = require('your-eslint-plugin');

module.exports = {
...uphold,
plugins: {
...uphold[0].plugins,
yourPlugin,
}
};
```

### Old (ESLint < 9)

Create an `.eslintrc.yml` file with the following content:

```yaml
Expand Down Expand Up @@ -62,3 +93,6 @@ Run it by clicking the "Run workflow" button.
## License

MIT

[npm-image]: https://img.shields.io/npm/v/eslint-config-uphold.svg
[npm-url]: https://www.npmjs.com/package/eslint-config-uphold
8 changes: 8 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const uphold = require('./src');

module.exports = [
...uphold,
{
ignores: ['!**/.release-it.js', 'test/fixtures']
}
];
34 changes: 19 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,39 +31,43 @@
"test": "mocha $npm_package_options_mocha"
},
"dependencies": {
"@babel/core": "^7.24.5",
"@babel/eslint-parser": "^7.24.5",
"@babel/core": "^7.25.8",
"@babel/eslint-parser": "^7.25.8",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jsdoc": "^48.2.5",
"eslint-plugin-mocha": "^10.4.3",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-jsdoc": "^50.4.1",
"eslint-plugin-mocha": "^10.5.0",
"eslint-plugin-prettier": "5.1.3",
"eslint-plugin-promise": "^7.1.0",
"eslint-plugin-rulesdir": "^0.2.2",
"eslint-plugin-sort-destructure-keys": "^1.6.0",
"eslint-plugin-sort-imports-requires": "^1.0.2",
"eslint-plugin-sort-destructure-keys": "^2.0.0",
"eslint-plugin-sort-imports-requires": "2.0.0",
"eslint-plugin-sort-keys-fix": "^1.1.2",
"eslint-plugin-sql-template": "^2.0.0"
"eslint-plugin-sql-template": "3.0.0"
},
"devDependencies": {
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.9.1",
"@uphold/github-changelog-generator": "^3.4.0",
"eslint": "^8.57.0",
"eslint": "^9.12.0",
"globals": "^15.11.0",
"mocha": "^10.4.0",
"pre-commit": "^1.2.2",
"prettier": "^2.8.7",
"prettier": "^3.3.3",
"release-it": "^17.2.1",
"should": "^13.2.3"
},
"peerDependencies": {
"eslint": "^8.20.0",
"prettier": "^2.8.7"
"eslint": "^9.0.0",
"prettier": "^3.0.0"
},
"pre-commit": [
"lint"
],
"engines": {
"node": ">=18"
"node": ">=20"
},
"options": {
"mocha": "-t 10000 --require should test"
}
},
"type": "commonjs"
}
Loading

0 comments on commit 5d50b8c

Please sign in to comment.