trying to get eslint to work with typescript-language-server

This commit is contained in:
Rudis Muiznieks 2021-09-05 08:04:02 -05:00
parent 704079060f
commit 484c37c9bf
7 changed files with 3494 additions and 22 deletions

2
.eslintignore Normal file
View File

@ -0,0 +1,2 @@
node_modules
public

1
.gitignore vendored
View File

@ -1 +1,2 @@
public/js/irreligious.js public/js/irreligious.js
node_modules/*

15
cmd
View File

@ -1,15 +0,0 @@
#!/usr/bin/env bash
cmd=$1
if [ "$cmd" = "lint" ]; then
eslint_d . --ext .ts
elif [ "$cmd" = "build" ]; then
eslint_d . --ext .ts && tsc
elif [ "$cmd" = "run" ]; then
firefox public/index.html &
else
echo "Usage: ./cmd lint - lint"
echo " ./cmd build - lint and compile"
echo " ./cmd run - run in firefox"
fi

3475
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

10
package.json Normal file
View File

@ -0,0 +1,10 @@
{
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.30.0",
"@typescript-eslint/parser": "^4.30.0",
"@typescript-eslint/typescript-estree": "^4.30.0",
"eslint": "^7.32.0",
"typescript": "^4.4.2",
"typescript-language-server": "^0.6.2"
}
}

View File

@ -14,15 +14,15 @@ interface IResource {
readonly valueInWholeNumbers: boolean; readonly valueInWholeNumbers: boolean;
readonly clickText: string; readonly clickText: string;
readonly clickDescription: string; readonly clickDescription: string;
readonly altClickText?: string; // readonly altClickText?: string;
readonly altClickDescription?: string; // readonly altClickDescription?: string;
readonly value: number; readonly value: number;
readonly cost: { [key: string]: number }; readonly cost: { [key: string]: number };
max (state: GameState): number | null; max (state: GameState): number | null;
inc (state: GameState): number | null; inc (state: GameState): number | null;
clickAction(state: GameState): void; clickAction(state: GameState): void;
altClickAction (state: GameState): void; // altClickAction (state: GameState): void;
addValue (amount: number, state: GameState): void; addValue (amount: number, state: GameState): void;
isUnlocked (state: GameState): boolean; isUnlocked (state: GameState): boolean;
advanceAction (time: number, state: GameState): void; advanceAction (time: number, state: GameState): void;

View File

@ -8,8 +8,7 @@
"experimentalDecorators": true, "experimentalDecorators": true,
"target": "ES5", "target": "ES5",
"module": "none", "module": "none",
"plugins": [{ "plugins": [{"name": "typescript-eslint-language-service"}]
"name": "typescript-eslint-language-service" },
}] "include": ["src"]
}
} }