Skip to content

Commit

Permalink
Removed last vestige of tslint, replaced with eslint header plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
anoek committed Jun 21, 2024
1 parent ce9934d commit 31e4dc3
Show file tree
Hide file tree
Showing 16 changed files with 121 additions and 221 deletions.
28 changes: 7 additions & 21 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@ module.exports = {
project: "tsconfig.json",
sourceType: "module",
},
plugins: [
"eslint-plugin-jsdoc",
"@typescript-eslint",
"@typescript-eslint/tslint",
"prettier",
"react-hooks",
],
plugins: ["eslint-plugin-jsdoc", "header", "prettier", "react-hooks", "@typescript-eslint"],
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"],
rules: {
// Recommended rules with errors
Expand Down Expand Up @@ -110,21 +104,14 @@ module.exports = {
"prefer-arrow-callback": ["error", { allowNamedFunctions: true }],
"prettier/prettier": "error",
"use-isnan": "error",
"@typescript-eslint/tslint/config": [
"header/header": [
"error",
{
rules: {
"file-header": [true, "[Cc]opyright ([(][Cc][)])?\\s*[Oo]nline-[gG]o.com"],
"import-spacing": true,
whitespace: [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
],
"block",
[
{
pattern: "[Cc]opyright ([(][Cc][)])?\\s*[Oo]nline-[gG]o.com", // cspell: disable-line
},
},
],
],
"react-hooks/rules-of-hooks": "error",
"prefer-const": [
Expand All @@ -146,7 +133,6 @@ module.exports = {
// rules that depend on type information (and therefore
// parserOptions.project)
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/tslint/config": "off",
},
},
],
Expand Down
1 change: 1 addition & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"kyus",
"Leela",
"lerp",
"linebreak",
"localstorage",
"malkovich",
"MDPI",
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@
"@types/react-linkify": "^1.0.4",
"@types/testing-library__jest-dom": "^5.14.5",
"@types/valid-url": "^1.0.7",
"@typescript-eslint/eslint-plugin": "^7.7.0",
"@typescript-eslint/eslint-plugin-tslint": "^7.0.2",
"@typescript-eslint/parser": "^7.7.0",
"@typescript-eslint/eslint-plugin": "^7.13.1",
"@typescript-eslint/parser": "^7.13.1",
"autoprefixer": "^10.4.19",
"body-parser": "^1.20.2",
"circular-dependency-plugin": "^5.2.2",
Expand All @@ -46,6 +45,7 @@
"deepl-node": "^1.10.1",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsdoc": "^46.9.1",
"eslint-plugin-prefer-arrow": "^1.2.3",
Expand Down Expand Up @@ -81,7 +81,6 @@
"supervisor": "^0.12.0",
"ts-jest": "^29.1.1",
"ts-loader": "^9.5.1",
"tslint": "^6.1.3",
"typescript": "=5.4.5",
"webpack": "^5.91.0",
"webpack-bundle-analyzer": "^4.10.2",
Expand Down
5 changes: 5 additions & 0 deletions src/components/Chat/chat_markup.test.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (C) Online-Go.com
* Copyright (C) Benjamin P. Jones
*/

import { chat_markup } from "./chat_markup";
import * as React from "react";

Expand Down
5 changes: 5 additions & 0 deletions src/components/Clock/Clock.test.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (C) Online-Go.com
* Copyright (C) Benjamin P. Jones
*/

import { Clock, prettyTime } from "./Clock";
import * as React from "react";
import { TestGoban } from "goban";
Expand Down
16 changes: 2 additions & 14 deletions src/components/TimeControl/TimeControl.test.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
/*
* Copyright (C) 2012-2022 Online-Go.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* Copyright (C) Online-Go.com
* Copyright (C) Benjamin P. Jones
*/

import "./TimeControl";
Expand Down
16 changes: 2 additions & 14 deletions src/lib/rank_utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
/*
* Copyright (C) Benjamin P. Jones
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* Copyright (C) Online-Go.com
* Copyright (C) Benjamin P. Jones
*/

import {
Expand Down
5 changes: 5 additions & 0 deletions src/lib/translate.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (C) Online-Go.com
* Copyright (C) Benjamin P. Jones
*/

// Set the window variables before importing the module
(window as any)["ogs_current_language"] = "test_language";
(window as any)["ogs_locales"] = {
Expand Down
5 changes: 5 additions & 0 deletions src/views/Game/GameDock.test.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (C) Online-Go.com
* Copyright (C) Benjamin P. Jones
*/

import { render, screen } from "@testing-library/react";
import * as React from "react";
import { GameDock } from "./GameDock";
Expand Down
5 changes: 5 additions & 0 deletions src/views/Game/PlayButtons.test.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (C) Online-Go.com
* Copyright (C) Benjamin P. Jones
*/

import { AdHocPackedMove, createGoban, GobanRenderer } from "goban";
import { CancelButton, PlayButtons } from "./PlayButtons";
import { act, cleanup, fireEvent, render, screen /* waitFor */ } from "@testing-library/react";
Expand Down
5 changes: 5 additions & 0 deletions src/views/Game/PlayControls.test.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (C) Online-Go.com
* Copyright (C) Benjamin P. Jones
*/

import { createGoban, GobanRenderer, ConditionalMoveTree } from "goban";
import { PlayControls } from "./PlayControls";
import { render, screen } from "@testing-library/react";
Expand Down
4 changes: 4 additions & 0 deletions src/views/Game/PlayerCards.test.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (C) Online-Go.com
* Copyright (C) Benjamin P. Jones
*/
import { render } from "@testing-library/react";
import "@testing-library/jest-dom";
import * as React from "react";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (C) Online-Go.com
* Copyright (C) Benjamin P. Jones
*/
import * as React from "react";
import { MemoryRouter, Route, Routes } from "react-router-dom";

Expand Down
4 changes: 4 additions & 0 deletions src/views/Settings/AccountSettings.test.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (C) Online-Go.com
* Copyright (C) Benjamin P. Jones
*/
import { AccountSettings } from "./AccountSettings";
import * as React from "react";
import { act, render, screen } from "@testing-library/react";
Expand Down
4 changes: 4 additions & 0 deletions src/views/User/UserByName.test.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (C) Online-Go.com
* Copyright (C) Benjamin P. Jones
*/
import { UserByName } from "./UserByName";
import * as React from "react";
import * as player_cache from "../../lib/player_cache";
Expand Down
Loading

0 comments on commit 31e4dc3

Please sign in to comment.