mirror of https://github.com/zulip/zulip.git
eslint: Enable @typescript-eslint/recommended plugin.
This is not automatically enabled by @typescript-eslint/recommended-requiring-type-checking for some reason. https://typescript-eslint.io/linting/configs/#recommended Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
96e657a954
commit
3109ee8015
|
@ -145,6 +145,7 @@
|
||||||
{
|
{
|
||||||
"files": ["**/*.ts"],
|
"files": ["**/*.ts"],
|
||||||
"extends": [
|
"extends": [
|
||||||
|
"plugin:@typescript-eslint/recommended",
|
||||||
"plugin:@typescript-eslint/recommended-requiring-type-checking",
|
"plugin:@typescript-eslint/recommended-requiring-type-checking",
|
||||||
"plugin:import/typescript"
|
"plugin:import/typescript"
|
||||||
],
|
],
|
||||||
|
@ -164,7 +165,6 @@
|
||||||
"rules": {
|
"rules": {
|
||||||
// Disable base rule to avoid conflict
|
// Disable base rule to avoid conflict
|
||||||
"no-duplicate-imports": "off",
|
"no-duplicate-imports": "off",
|
||||||
"no-unused-vars": "off",
|
|
||||||
"no-useless-constructor": "off",
|
"no-useless-constructor": "off",
|
||||||
"no-use-before-define": "off",
|
"no-use-before-define": "off",
|
||||||
|
|
||||||
|
@ -178,6 +178,7 @@
|
||||||
"@typescript-eslint/member-ordering": "error",
|
"@typescript-eslint/member-ordering": "error",
|
||||||
"@typescript-eslint/no-duplicate-imports": "error",
|
"@typescript-eslint/no-duplicate-imports": "error",
|
||||||
"@typescript-eslint/no-extraneous-class": "error",
|
"@typescript-eslint/no-extraneous-class": "error",
|
||||||
|
"@typescript-eslint/no-non-null-assertion": "off",
|
||||||
"@typescript-eslint/no-parameter-properties": "error",
|
"@typescript-eslint/no-parameter-properties": "error",
|
||||||
"@typescript-eslint/no-unnecessary-qualifier": "error",
|
"@typescript-eslint/no-unnecessary-qualifier": "error",
|
||||||
"@typescript-eslint/no-unsafe-argument": "off",
|
"@typescript-eslint/no-unsafe-argument": "off",
|
||||||
|
|
|
@ -22,10 +22,7 @@ async function await_user_hidden(page: Page, name: string): Promise<void> {
|
||||||
|
|
||||||
async function add_user_to_stream(page: Page, name: string): Promise<void> {
|
async function add_user_to_stream(page: Page, name: string): Promise<void> {
|
||||||
const user_id = await common.get_user_id_from_name(page, name);
|
const user_id = await common.get_user_id_from_name(page, name);
|
||||||
await page.evaluate(
|
await page.evaluate((user_id) => zulip_test.add_user_id_to_new_stream(user_id), user_id);
|
||||||
(user_id: Number) => zulip_test.add_user_id_to_new_stream(user_id),
|
|
||||||
user_id,
|
|
||||||
);
|
|
||||||
await await_user_visible(page, name);
|
await await_user_visible(page, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
// remove each declaration when the corresponding module is migrated
|
// remove each declaration when the corresponding module is migrated
|
||||||
// to TS.
|
// to TS.
|
||||||
|
|
||||||
declare let zulip_test: any;
|
declare let zulip_test: any; // eslint-disable-line @typescript-eslint/no-explicit-any
|
||||||
|
|
||||||
interface JQuery {
|
interface JQuery {
|
||||||
expectOne(): JQuery;
|
expectOne(): JQuery;
|
||||||
|
|
|
@ -367,7 +367,7 @@ export function stringify_time(time: number | Date): string {
|
||||||
return get_localized_date_or_time_for_format(time, "time");
|
return get_localized_date_or_time_for_format(time, "time");
|
||||||
}
|
}
|
||||||
|
|
||||||
export function format_time_modern(time: number | Date, today = new Date()): String {
|
export function format_time_modern(time: number | Date, today = new Date()): string {
|
||||||
const hours = differenceInHours(today, time);
|
const hours = differenceInHours(today, time);
|
||||||
const days_old = differenceInCalendarDays(today, time);
|
const days_old = differenceInCalendarDays(today, time);
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,7 @@ export function show_error($target: JQuery): void {
|
||||||
export function loading(
|
export function loading(
|
||||||
response_html: string,
|
response_html: string,
|
||||||
$status_box: JQuery,
|
$status_box: JQuery,
|
||||||
successfully_loaded: boolean = false,
|
successfully_loaded = false,
|
||||||
): void {
|
): void {
|
||||||
$status_box.find(".alert-content").html(response_html);
|
$status_box.find(".alert-content").html(response_html);
|
||||||
if (!successfully_loaded) {
|
if (!successfully_loaded) {
|
||||||
|
|
|
@ -49,7 +49,7 @@ export function update_unread_count_in_dom($unread_count_elem: JQuery, count: nu
|
||||||
|
|
||||||
export function update_unread_mention_info_in_dom(
|
export function update_unread_mention_info_in_dom(
|
||||||
$unread_mention_info_elem: JQuery,
|
$unread_mention_info_elem: JQuery,
|
||||||
stream_has_any_unread_mention_messages: Boolean,
|
stream_has_any_unread_mention_messages: boolean,
|
||||||
): void {
|
): void {
|
||||||
const $unread_mention_info_span = $unread_mention_info_elem.find(".unread_mention_info");
|
const $unread_mention_info_span = $unread_mention_info_elem.find(".unread_mention_info");
|
||||||
if (!stream_has_any_unread_mention_messages) {
|
if (!stream_has_any_unread_mention_messages) {
|
||||||
|
|
|
@ -347,7 +347,7 @@ export function filter_by_word_prefix_match<T>(
|
||||||
items: T[],
|
items: T[],
|
||||||
search_term: string,
|
search_term: string,
|
||||||
item_to_text: (item: T) => string,
|
item_to_text: (item: T) => string,
|
||||||
word_separator_regex: RegExp = /\s/,
|
word_separator_regex = /\s/,
|
||||||
): T[] {
|
): T[] {
|
||||||
if (search_term === "") {
|
if (search_term === "") {
|
||||||
return items;
|
return items;
|
||||||
|
|
Loading…
Reference in New Issue