chore: add eslint
This commit is contained in:
parent
0a933f6da8
commit
5ec103e033
|
@ -0,0 +1,6 @@
|
||||||
|
node_modules
|
||||||
|
dist
|
||||||
|
.parcel-cache
|
||||||
|
k8s
|
||||||
|
.prettierrc.js
|
||||||
|
.terserrc.js
|
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
"root": true,
|
||||||
|
"parser": "@typescript-eslint/parser",
|
||||||
|
"plugins": ["@typescript-eslint"],
|
||||||
|
"extends": [
|
||||||
|
"eslint:recommended",
|
||||||
|
"plugin:@typescript-eslint/recommended",
|
||||||
|
"prettier"
|
||||||
|
],
|
||||||
|
"env": {
|
||||||
|
"browser": true
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
"quotes": [
|
||||||
|
"error",
|
||||||
|
"single",
|
||||||
|
{ "avoidEscape": true, "allowTemplateLiterals": true }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"extends": "@parcel/config-default",
|
"extends": "@parcel/config-default",
|
||||||
"validators": {
|
"validators": {
|
||||||
"*.{ts,tsx}": ["@parcel/validator-typescript"]
|
"*.{ts,tsx}": ["@parcel/validator-typescript", "@parcel/validator-eslint"],
|
||||||
|
"*.{js,jsx}": ["@parcel/validator-eslint"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,8 @@
|
||||||
"build-single": "PUBLIC_URL=https://scripts.tribalwarshelp.com parcel build",
|
"build-single": "PUBLIC_URL=https://scripts.tribalwarshelp.com parcel build",
|
||||||
"build:extended-player-profile-user": "PREAMBLE=extended-player-profile yarn build-single ./src/extended-player-profile.user.ts",
|
"build:extended-player-profile-user": "PREAMBLE=extended-player-profile yarn build-single ./src/extended-player-profile.user.ts",
|
||||||
"build:extended-player-profile-quickbar": "yarn build-single ./src/extended-player-profile.quickbar.ts",
|
"build:extended-player-profile-quickbar": "yarn build-single ./src/extended-player-profile.quickbar.ts",
|
||||||
"build": "npm-run-all build:*"
|
"build": "npm-run-all build:*",
|
||||||
|
"lint": "eslint src/**/*.ts"
|
||||||
},
|
},
|
||||||
"targets": {
|
"targets": {
|
||||||
"default": {
|
"default": {
|
||||||
|
@ -23,11 +24,16 @@
|
||||||
"since 2017-06"
|
"since 2017-06"
|
||||||
],
|
],
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@parcel/validator-eslint": "^2.8.3",
|
||||||
"@parcel/validator-typescript": "^2.8.3",
|
"@parcel/validator-typescript": "^2.8.3",
|
||||||
"@types/jquery": "^3.5.14",
|
"@types/jquery": "^3.5.14",
|
||||||
"@types/lodash": "^4.14.191",
|
"@types/lodash": "^4.14.191",
|
||||||
"@types/node": "^18.11.17",
|
"@types/node": "^18.11.17",
|
||||||
|
"@typescript-eslint/eslint-plugin": "^5.50.0",
|
||||||
|
"@typescript-eslint/parser": "^5.50.0",
|
||||||
"buffer": "^5.5.0",
|
"buffer": "^5.5.0",
|
||||||
|
"eslint": "^7.32.0",
|
||||||
|
"eslint-config-prettier": "^8.6.0",
|
||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all": "^4.1.5",
|
||||||
"parcel": "^2.8.3",
|
"parcel": "^2.8.3",
|
||||||
"prettier": "^2.8.3",
|
"prettier": "^2.8.3",
|
||||||
|
|
|
@ -126,7 +126,7 @@ export type InADayPlayer = {
|
||||||
|
|
||||||
export class InADayClient {
|
export class InADayClient {
|
||||||
client: AxiosInstance;
|
client: AxiosInstance;
|
||||||
constructor(timeout: number = 10000) {
|
constructor(timeout = 10000) {
|
||||||
this.client = axios.create({
|
this.client = axios.create({
|
||||||
timeout,
|
timeout,
|
||||||
});
|
});
|
||||||
|
|
|
@ -131,7 +131,7 @@ export type ListPlayerOtherServersParams = {
|
||||||
export class TWHelpClient {
|
export class TWHelpClient {
|
||||||
client: AxiosInstance;
|
client: AxiosInstance;
|
||||||
|
|
||||||
constructor(url: string, timeout: number = 10000) {
|
constructor(url: string, timeout = 10000) {
|
||||||
this.client = axios.create({
|
this.client = axios.create({
|
||||||
baseURL: url,
|
baseURL: url,
|
||||||
timeout,
|
timeout,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "es2017",
|
"target": "es2020",
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"moduleResolution": "Node",
|
"moduleResolution": "Node",
|
||||||
"strictNullChecks": true,
|
"strictNullChecks": true,
|
||||||
|
|
Loading…
Reference in New Issue