Skip to content

Commit 60fa4ee

Browse files
committed
feat: up linters
1 parent be77bcb commit 60fa4ee

File tree

10 files changed

+814
-511
lines changed

10 files changed

+814
-511
lines changed

.eslintrc.js renamed to eslint.config.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88

99
'use strict';
1010

11-
const base = require('@v4fire/linters/.eslintrc');
11+
const
12+
headerPlugin = require('eslint-plugin-header');
13+
14+
const
15+
base = require('@v4fire/linters/eslint.config');
1216

1317
const copyrightTemplate = [
1418
'!',
@@ -20,6 +24,16 @@ const copyrightTemplate = [
2024
' '
2125
];
2226

23-
base.rules['header/header'] = [2, 'block', copyrightTemplate];
27+
base.forEach((item) => {
28+
item.ignores = ['**/*spec.js'];
29+
30+
if (item.plugins) {
31+
item.plugins['header'] = headerPlugin;
32+
}
33+
34+
if (item.rules) {
35+
item.rules['header/header'] = [2, 'block', copyrightTemplate];
36+
}
37+
});
2438

2539
module.exports = base;

jest-eslint.config.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@ module.exports = {
1414
...base,
1515
testMatch: [
1616
'<rootDir>/src/**/*.ts',
17-
'<rootDir>/src/**/*.js',
1817
'<rootDir>/config/**/*.js',
1918
'<rootDir>/build/**/*.js',
2019
'<rootDir>/ts-definitions/**/*.ts',
2120
'<rootDir>/index.d.ts',
2221
'<rootDir>/gulpfile.js',
23-
'<rootDir>/.eslintrc.js',
22+
'<rootDir>/eslint-config.js',
2423
'<rootDir>/jest-eslint.config.js',
2524
'<rootDir>/jest-runner-eslint.config.js',
2625
'<rootDir>/jest.config.ts'

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
"tsconfig-paths": "3.13.0",
9191
"typescript": "4.6.2",
9292
"upath": "2.0.1",
93-
"xhr2": "^0.2.1"
93+
"xhr2": "0.2.1"
9494
},
9595
"devDependencies": {
9696
"@types/fs-extra-promise": "1.0.10",
@@ -103,14 +103,14 @@
103103
"@v4fire/linters": "git+https://github.com/v4fire/linters#rework_rules",
104104
"express": "4.17.3",
105105
"husky": "7.0.4",
106-
"jest": "29.6.1",
107-
"jest-runner-eslint": "2.0.0",
106+
"jest": "29.7.0",
107+
"jest-runner-eslint": "2.1.1",
108108
"ts-jest": "29.1.1",
109109
"typedoc": "0.23.28",
110110
"typedoc-theme-hierarchy": "3.2.0"
111111
},
112-
"directories": {
113-
"doc": "docs"
112+
"resolutions": {
113+
"globals": "13.19.0"
114114
},
115115
"packageManager": "[email protected]"
116116
}

src/core/json/stream/filters/abstract-filter.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ export default abstract class AbstractFilter implements TokenProcessor<FilterTok
182182
* Check the specified token for filter satisfaction
183183
* @param token
184184
*/
185-
protected*check(token: FilterToken): Generator<FilterToken> {
185+
protected *check(token: FilterToken): Generator<FilterToken> {
186186
const
187187
last = this.stack.length - 1;
188188

@@ -271,23 +271,23 @@ export default abstract class AbstractFilter implements TokenProcessor<FilterTok
271271
* Passes the passed token into an output token stream
272272
* @param token
273273
*/
274-
protected*pass(token: FilterToken): Generator<FilterToken> {
274+
protected *pass(token: FilterToken): Generator<FilterToken> {
275275
yield token;
276276
}
277277

278278
/**
279279
* Skips the passed token from an output token stream
280280
*/
281281
// eslint-disable-next-line require-yield
282-
protected*skip(_: FilterToken): Generator<FilterToken> {
282+
protected *skip(_: FilterToken): Generator<FilterToken> {
283283
return undefined;
284284
}
285285

286286
/**
287287
* Passes the passed object token into an output token stream
288288
* @param token
289289
*/
290-
protected*passObject(token: FilterToken): Generator<FilterToken> {
290+
protected *passObject(token: FilterToken): Generator<FilterToken> {
291291
switch (token.name) {
292292
case 'startObject':
293293
case 'startArray':

src/core/json/stream/filters/filter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default class Filter extends Super {
2323
super(filter);
2424
}
2525

26-
override*finishTokenProcessing(): Generator<Token> {
26+
override *finishTokenProcessing(): Generator<Token> {
2727
const
2828
{stack, objStack} = this;
2929

@@ -92,7 +92,7 @@ export default class Filter extends Super {
9292
}
9393

9494
/** @inheritDoc */
95-
protected*checkToken(chunk: Token): Generator<Token> {
95+
protected *checkToken(chunk: Token): Generator<Token> {
9696
switch (chunk.name) {
9797
case 'startObject':
9898
if (this.filter(this.stack, chunk)) {

src/core/json/stream/filters/pick.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default class Pick extends Super {
1717
}
1818

1919
/** @inheritDoc */
20-
protected*checkToken(chunk: Token): Generator<boolean | Token> {
20+
protected *checkToken(chunk: Token): Generator<boolean | Token> {
2121
switch (chunk.name) {
2222
case 'startObject':
2323
case 'startArray':

src/core/json/stream/parser/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export default class Parser {
4747
// eslint-disable-next-line @typescript-eslint/no-unused-vars
4848
T extends [...infer A, TokenProcessor<infer R>] ? AsyncGenerator<R> : unknown;
4949

50-
static async*from(
50+
static async *from(
5151
source: AnyIterable<string>,
5252
...processors: Array<TokenProcessor<unknown>>
5353
): AsyncGenerator {

src/core/json/stream/streamers/array.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default class ArrayStreamer<T = unknown> extends Streamer<StreamedArray<T
3131
}
3232

3333
/** @inheritDoc */
34-
protected*push(): Generator<StreamedArray<T>> {
34+
protected *push(): Generator<StreamedArray<T>> {
3535
const
3636
{value} = this.assembler;
3737

src/core/json/stream/streamers/object.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default class StreamObject<T = unknown> extends Streamer<StreamedObject<T
3131
}
3232

3333
/** @inheritDoc */
34-
protected*push(): Generator<StreamedObject<T>> {
34+
protected *push(): Generator<StreamedObject<T>> {
3535
const
3636
{key, value} = this.assembler;
3737

0 commit comments

Comments
 (0)