Skip to content

Commit c3f59b9

Browse files
Fix lint checking (#383)
* Fix lint checking * Create separate rules for examples
1 parent 78baf7c commit c3f59b9

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

eslint.config.mjs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ const compat = new FlatCompat({
2020
});
2121

2222
export default [...compat.extends("./tools/eslint/base_rules.js"), {
23+
files: ["**/*.ts"],
24+
2325
plugins: {
2426
ban,
2527
filenames,
2628
local,
27-
"prefer-let": preferLet,
2829
"@typescript-eslint": typescriptEslint,
29-
prettier,
3030
},
3131

3232
languageOptions: {
@@ -47,11 +47,21 @@ export default [...compat.extends("./tools/eslint/base_rules.js"), {
4747
},
4848
},
4949

50-
settings: {},
51-
5250
rules: {
5351
"@typescript-eslint/restrict-plus-operands": "error",
52+
},
5453

54+
settings: {},
55+
}, {
56+
files: ["examples/**/*.ts"],
57+
58+
plugins: {
59+
"prefer-let": preferLet,
60+
"@typescript-eslint": typescriptEslint,
61+
prettier,
62+
},
63+
64+
rules: {
5565
"@typescript-eslint/no-unused-vars": ["error", {
5666
varsIgnorePattern: "_.*|response|datasourceUrl|MySchema",
5767
argsIgnorePattern: "_.*|context|param",
@@ -103,4 +113,4 @@ export default [...compat.extends("./tools/eslint/base_rules.js"), {
103113
rules: {
104114
"@typescript-eslint/consistent-type-imports": "off",
105115
},
106-
}];
116+
}];

lib/test_utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {assert} from "chai";
1+
import {assert} from 'chai';
22

33
export async function willBeRejected<ErrorT = any>(
44
promise: Promise<any>,
@@ -9,7 +9,7 @@ export async function willBeRejected<ErrorT = any>(
99
return err;
1010
}
1111

12-
throw new Error("Promise unexpectedly resolved");
12+
throw new Error('Promise unexpectedly resolved');
1313
}
1414

1515
export async function willBeRejectedWith<T, ErrorT = any>(
@@ -18,7 +18,7 @@ export async function willBeRejectedWith<T, ErrorT = any>(
1818
): Promise<ErrorT> {
1919
const error = await willBeRejected(promise);
2020
if (matcher) {
21-
assert.match(error, matcher, "Promise was rejected with unexpected error.");
21+
assert.match(error, matcher, 'Promise was rejected with unexpected error.');
2222
}
2323
return error as ErrorT;
2424
}

0 commit comments

Comments
 (0)