Skip to content

Commit 4e8adf2

Browse files
committed
Fix eslint configuration
1 parent 001ee8d commit 4e8adf2

17 files changed

+28
-33
lines changed

eslint.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export default tseslint.config(
88
...tseslint.configs.recommendedTypeChecked,
99
...tseslint.configs.stylisticTypeChecked,
1010
importPlugin.flatConfigs.recommended, // eslint-disable-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access
11+
importPlugin.flatConfigs.typescript, // eslint-disable-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access
1112
stylistic.configs.customize({
1213
arrowParens: true,
1314
braceStyle: "1tbs",
@@ -48,7 +49,7 @@ export default tseslint.config(
4849
// }], // Doesn't respect @import
4950

5051
// Stylistic
51-
"@stylistic/yield-star-spacing": ["error", "after"],
52+
"@stylistic/generator-star-spacing": ["error", { after: true, before: false }],
5253
"@stylistic/multiline-ternary": "off",
5354
"@stylistic/no-mixed-operators": "off",
5455
"@stylistic/no-multiple-empty-lines": ["error", { max: 2, maxEOF: 0, maxBOF: 0 }], // Allow max=2 for imports

src/hyperjump/hyperjump.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ export class Hyperjump {
287287
*
288288
* @type (node: JsonCompatible<JrefNode>) => AsyncGenerator<JsonCompatible<JrefNode>, void, unknown>
289289
*/
290-
async * iter(node) {
290+
async* iter(node) {
291291
if (node.jsonType === "array") {
292292
for (const itemNode of node.children) {
293293
yield this.#followReferences(itemNode);
@@ -303,7 +303,7 @@ export class Hyperjump {
303303
*
304304
* @type (node: JsonCompatible<JrefNode>) => AsyncGenerator<JsonCompatible<JrefNode>, void, unknown>
305305
*/
306-
async * values(node) {
306+
async* values(node) {
307307
if (node.jsonType === "object") {
308308
for (const propertyNode of node.children) {
309309
yield this.#followReferences(propertyNode.children[1]);
@@ -317,7 +317,7 @@ export class Hyperjump {
317317
*
318318
* @type (node: JsonCompatible<JrefNode>) => AsyncGenerator<[string, JsonCompatible<JrefNode>], void, unknown>
319319
*/
320-
async * entries(node) {
320+
async* entries(node) {
321321
if (node.jsonType === "object") {
322322
for (const propertyNode of node.children) {
323323
yield [propertyNode.children[0].value, await this.#followReferences(propertyNode.children[1])];

src/hyperjump/index.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export * from "./hyperjump.js";
2+
export * from "./uri-schemes/uri-scheme-plugin.d.ts";
3+
export * from "./uri-schemes/file-scheme-plugin.js";
4+
export * from "./uri-schemes/http-scheme-plugin.js";
5+
export * from "./media-types/media-type-plugin.d.ts";
6+
export * from "./media-types/json-media-type-plugin.js";
7+
export * from "./media-types/jref-media-type-plugin.js";

src/hyperjump/index.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33
*/
44

55
export * from "./hyperjump.js";
6-
// eslint-disable-next-line import/extensions
7-
export * from "./uri-schemes/uri-scheme-plugin.js";
86
export * from "./uri-schemes/file-scheme-plugin.js";
97
export * from "./uri-schemes/http-scheme-plugin.js";
10-
// eslint-disable-next-line import/extensions
11-
export * from "./media-types/media-type-plugin.js";
128
export * from "./media-types/json-media-type-plugin.js";
139
export * from "./media-types/jref-media-type-plugin.js";

src/hyperjump/media-types/media-type-plugin.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/hyperjump/uri-schemes/uri-scheme-plugin.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { GetOptions } from "../hyperjump.js"; // eslint-disable-line import/named
1+
import { GetOptions } from "../hyperjump.js";
22

33

44
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions

src/hyperjump/uri-schemes/uri-scheme-plugin.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/jref/index.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export * from "./jref-util.js";
2+
export * from "./jref-parse.js";
3+
export * from "./jref-stringify.js";
4+
export * from "./jref.js";
5+
export * from "./jref-ast.d.ts";

src/jref/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@ export * from "./jref-util.js";
22
export * from "./jref-parse.js";
33
export * from "./jref-stringify.js";
44
export * from "./jref.js";
5-
// eslint-disable-next-line import/extensions
6-
export * from "./jref-ast.js";

src/jref/jref-ast.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/json/index.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export * from "./jsonast-util.js";
2+
export * from "./rejson-parse.js";
3+
export * from "./rejson-stringify.js";
4+
export * from "./rejson.js";
5+
export * from "./jsonast.d.ts";

src/json/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@ export * from "./jsonast-util.js";
22
export * from "./rejson-parse.js";
33
export * from "./rejson-stringify.js";
44
export * from "./rejson.js";
5-
// eslint-disable-next-line import/extensions
6-
export * from "./jsonast.js";

src/json/json-lexer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export class JsonLexer {
6161
error: moo.error
6262
});
6363

64-
this.#iterator = (function * (lexer) {
64+
this.#iterator = (function* (lexer) {
6565
for (const token of lexer.reset(json)) {
6666
if (token.type === "WS") {
6767
continue;

src/json/jsonast-util.test.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,7 @@ import {
1717
} from "./index.js";
1818

1919
/**
20-
* @import {
21-
* JsonArrayNode,
22-
* JsonBooleanNode,
23-
* JsonNode,
24-
* JsonNullNode,
25-
* JsonNumberNode,
26-
* JsonObjectNode,
27-
* JsonStringNode
28-
* } from "./index.js"
20+
* @import { JsonNode } from "./index.js"
2921
*/
3022

3123

src/json/jsonast.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/json/types.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

tsconfig.build.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
"include": ["src/**/*"],
44
"exclude": [
55
"**/*.test.js",
6-
"src/hyperjump/media-types/media-type-plugin.js",
7-
"src/hyperjump/uri-schemes/uri-scheme-plugin.js",
8-
"src/json/jsonast.js",
9-
"src/json/types.js",
10-
"src/jref/jref-ast.js"
6+
"src/hyperjump/index.js",
7+
"src/jref/index.js",
8+
"src/json/index.js"
119
],
1210
"compilerOptions": {
1311
"declaration": true,

0 commit comments

Comments
 (0)