Skip to content

Commit 3dca437

Browse files
authored
Merge pull request #216 from Auge19/add_eslint
Add eslint and fix some warnings
2 parents 782d01c + 90e0f89 commit 3dca437

File tree

12 files changed

+1259
-588
lines changed

12 files changed

+1259
-588
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ lint:
3838
tsc:
3939
$(NPX) tsc
4040

41+
eslint:
42+
$(NPX) eslint .
43+
4144
dts:
4245
$(NPX) tsc --build tsconfig.dts.json
4346

eslint.config.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import globals from "globals";
2+
import pluginJs from "@eslint/js";
3+
import tseslint from "typescript-eslint";
4+
5+
6+
/** @type {import('eslint').Linter.Config[]} */
7+
export default [
8+
pluginJs.configs.recommended,
9+
...tseslint.configs.recommended,
10+
{ ignores: ['**/*.{js,mjs,cjs}', 'builds/**/*'] },
11+
{
12+
rules: {
13+
"no-empty": "off",
14+
"prefer-rest-params" : "off",
15+
"prefer-spread": "off",
16+
"prefer-const": "off",
17+
"no-useless-escape": "off",
18+
"no-array-constructor": "off",
19+
"@typescript-eslint/no-array-constructor": "off",
20+
"@typescript-eslint/no-explicit-any": "off",
21+
"@typescript-eslint/no-require-imports": "off",
22+
"@typescript-eslint/no-unused-vars" : "off",
23+
"@typescript-eslint/no-unsafe-function-type": "off"
24+
}
25+
}
26+
];

global.d.ts

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,21 @@ declare global {
1919
//This namespace merges the jasmine namespace to correct same tsc warnings
2020
namespace jasmine {
2121

22-
function setNodeText(node, text: string): void
23-
var Spec: any;
24-
function getGlobal(): any;
25-
var updateInterval: number
22+
function setNodeText(node, text: string): void
23+
function getGlobal(): any
2624
function resolve(promise: Promise<boolean>)
2725
function prepareTestNode() : HTMLElement
28-
function nodeText(node)
29-
var Clock: Clock
30-
function getEnv(): any;
26+
function nodeText(node)
27+
function getEnv(): any
3128

32-
var FakeTimer: any
33-
var undefined: undefined
34-
var browserSupportsProtoAssignment: any
35-
var ieVersion: any
29+
const Matchers: Matchers
30+
const Spec: any;
31+
const FakeTimer: any
32+
const undefined: undefined
3633

37-
var Matchers: Matchers
34+
let browserSupportsProtoAssignment: any
35+
let ieVersion: any
36+
let updateInterval: number
3837

3938
interface Matchers<T> {
4039
toContainText(expected: string, ignoreSpaces: boolean): boolean
@@ -61,6 +60,6 @@ declare global {
6160
}
6261

6362
interface SymbolConstructor {
64-
observable?: Symbol;
63+
observable?: symbol;
6564
}
6665
}

0 commit comments

Comments
 (0)