Skip to content

Commit 7ff6964

Browse files
authored
Merge pull request #439 from node-oauth/feature/replace-eslint-with-biome
Replace eslint with biome
2 parents b511cd9 + 0c94e26 commit 7ff6964

84 files changed

Lines changed: 6994 additions & 9392 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintignore

Lines changed: 0 additions & 5 deletions
This file was deleted.

.eslintrc

Lines changed: 0 additions & 54 deletions
This file was deleted.

.github/workflows/tests.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414

1515
jobs:
1616
lint:
17-
name: Javascript standard lint
17+
name: Javascript Biome lint/format
1818
runs-on: ubuntu-latest
1919
steps:
2020
- name: Checkout repository
@@ -28,8 +28,10 @@ jobs:
2828
with:
2929
node-version: 24
3030
cache: npm
31-
- run: npm clean-install
32-
- run: npm run lint
31+
- run: |
32+
npm clean-install
33+
npm run lint
34+
npm run format
3335
3436
unittest:
3537
name: unit tests

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ Complete, compliant and well tested module for implementing an OAuth2 server in
55

66
[![Tests](https://github.com/node-oauth/node-oauth2-server/actions/workflows/tests.yml/badge.svg)](https://github.com/node-oauth/node-oauth2-server/actions/workflows/tests.yml)
77
[![CodeQL Semantic Analysis](https://github.com/node-oauth/node-oauth2-server/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/node-oauth/node-oauth2-server/actions/workflows/codeql-analysis.yml)
8-
[![Tests for Release](https://github.com/node-oauth/node-oauth2-server/actions/workflows/tests-release.yml/badge.svg)](https://github.com/node-oauth/node-oauth2-server/actions/workflows/tests-release.yml)
98
[![Documentation Status](https://readthedocs.org/projects/node-oauthoauth2-server/badge/?version=latest)](https://node-oauthoauth2-server.readthedocs.io/en/latest/?badge=latest)
109
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
1110
[![npm Version](https://img.shields.io/npm/v/@node-oauth/oauth2-server?label=version)](https://www.npmjs.com/package/@node-oauth/oauth2-server)
1211
[![npm Downloads/Week](https://img.shields.io/npm/dw/@node-oauth/oauth2-server)](https://www.npmjs.com/package/@node-oauth/oauth2-server)
1312
[![GitHub License](https://img.shields.io/github/license/node-oauth/node-oauth2-server)](https://github.com/node-oauth/node-oauth2-server/blob/master/LICENSE)
13+
[![Formatted with Biome](https://img.shields.io/badge/Formatted_with-Biome-60a5fa?style=flat&logo=biome)](https://biomejs.dev/)
1414

1515
NOTE: This project has been forked from [oauthjs/node-oauth2-server](https://github.com/oauthjs/node-oauth2-server) and is a continuation due to the project appearing to be abandoned. Please see [our issue board](https://github.com/node-oauth/node-oauth2-server/issues) to talk about next steps and the future of this project.
1616

biome.json

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.5.0/schema.json",
3+
"vcs": {
4+
"enabled": true,
5+
"clientKind": "git",
6+
"useIgnoreFile": true
7+
},
8+
"files": {
9+
"ignoreUnknown": true,
10+
"includes": ["index.js", "lib/**/*.js", "test/**/*.js"]
11+
},
12+
"formatter": {
13+
"enabled": true
14+
},
15+
"linter": {
16+
"enabled": true,
17+
"rules": {
18+
"preset": "recommended",
19+
"suspicious": {
20+
"noRedundantUseStrict": "off",
21+
"noPrototypeBuiltins": "off",
22+
"useIsArray": "off",
23+
"noGlobalAssign": "off"
24+
},
25+
"complexity": {
26+
"useArrowFunction": "off",
27+
"useDateNow": "off",
28+
"useOptionalChain": "off",
29+
"useLiteralKeys": "off",
30+
"noUselessThisAlias": "off"
31+
},
32+
"correctness": {
33+
"noUnusedFunctionParameters": "off",
34+
"noUnusedVariables": "off"
35+
},
36+
"style": {
37+
"useNodejsImportProtocol": "off",
38+
"useTemplate": "off"
39+
}
40+
}
41+
},
42+
"javascript": {
43+
"formatter": {
44+
"quoteStyle": "single",
45+
"indentStyle": "space",
46+
"trailingCommas": "all",
47+
"lineWidth": 120
48+
}
49+
},
50+
"assist": {
51+
"enabled": true,
52+
"actions": {
53+
"source": {
54+
"organizeImports": "on"
55+
}
56+
}
57+
}
58+
}

index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,3 @@ exports.UnauthorizedClientError = require('./lib/errors/unauthorized-client-erro
3232
exports.UnauthorizedRequestError = require('./lib/errors/unauthorized-request-error');
3333
exports.UnsupportedGrantTypeError = require('./lib/errors/unsupported-grant-type-error');
3434
exports.UnsupportedResponseTypeError = require('./lib/errors/unsupported-response-type-error');
35-

lib/errors/access-denied-error.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ const OAuthError = require('./oauth-error');
1313
*/
1414
class AccessDeniedError extends OAuthError {
1515
/**
16-
* @constructor
17-
* @param message {string}
18-
* @param properties {object=}
19-
*/
16+
* @constructor
17+
* @param message {string}
18+
* @param properties {object=}
19+
*/
2020
constructor(message, properties) {
2121
properties = {
2222
code: 400,
2323
name: 'access_denied',
24-
...properties
24+
...properties,
2525
};
2626

2727
super(message, properties);

lib/errors/insufficient-scope-error.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ class InsufficientScopeError extends OAuthError {
1717
* @constructor
1818
* @param message {string}
1919
* @param properties {object=}
20-
*/
20+
*/
2121
constructor(message, properties) {
2222
properties = {
2323
code: 403,
2424
name: 'insufficient_scope',
25-
...properties
25+
...properties,
2626
};
2727

2828
super(message, properties);

lib/errors/invalid-argument-error.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ class InvalidArgumentError extends OAuthError {
1616
* @constructor
1717
* @param message {string}
1818
* @param properties {object=}
19-
*/
19+
*/
2020
constructor(message, properties) {
2121
properties = {
2222
code: 500,
2323
name: 'invalid_argument',
24-
...properties
24+
...properties,
2525
};
2626

2727
super(message, properties);

lib/errors/invalid-client-error.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ const OAuthError = require('./oauth-error');
1515

1616
class InvalidClientError extends OAuthError {
1717
/**
18-
* @constructor
19-
* @param message {string}
20-
* @param properties {object=}
21-
*/
18+
* @constructor
19+
* @param message {string}
20+
* @param properties {object=}
21+
*/
2222
constructor(message, properties) {
2323
properties = {
2424
code: 400,
2525
name: 'invalid_client',
26-
...properties
26+
...properties,
2727
};
2828

2929
super(message, properties);

0 commit comments

Comments
 (0)