Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: eslint not running on packages #25305

Merged
merged 4 commits into from
Apr 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/packages/* @RocketChat/chat-engine
/packages/core-typings/ @RocketChat/chat-engine
/packages/rest-typings/ @RocketChat/chat-engine
/packages/eslint-config/ @RocketChat/chat-engine
/.vscode/ @RocketChat/chat-engine
/.github/ @RocketChat/chat-engine
/_templates/ @RocketChat/chat-engine
2 changes: 1 addition & 1 deletion .github/no-js-action-config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"added": {
"ignore": ["packages/accounts-linkedin/**/*", "packages/linkedin-oauth/**/*", "tests/cypress/integration/08-resolutions.spec.js"]
"ignore": ["packages/accounts-linkedin/**/*", "packages/linkedin-oauth/**/*", "tests/cypress/integration/08-resolutions.spec.js", "**/.eslintrc.js", "packages/eslint-config/**"]
}
}
File renamed without changes.
4 changes: 2 additions & 2 deletions _templates/package/new/package.json.ejs.t
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ to: packages/<%= name %>/package.json
"typescript": "~4.3.5"
},
"scripts": {
"eslint": "eslint --ext .js,.jsx,.ts,.tsx .",
"eslint:fix": "eslint --ext .js,.jsx,.ts,.tsx . --fix",
"lint": "eslint --ext .js,.jsx,.ts,.tsx .",
"lint:fix": "eslint --ext .js,.jsx,.ts,.tsx . --fix",
"jest": "jest",
"build": "tsc -p tsconfig.json"
},
Expand Down
62 changes: 3 additions & 59 deletions apps/meteor/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"extends": ["@rocket.chat/eslint-config", "plugin:prettier/recommended", "plugin:import/typescript"],
"parser": "babel-eslint",
"extends": ["@rocket.chat/eslint-config"],
"globals": {
"__meteor_bootstrap__": false,
"__meteor_runtime_config__": false,
Expand All @@ -10,7 +9,6 @@
},
"plugins": ["react", "react-hooks"],
"rules": {
"jsx-quotes": ["error", "prefer-single"],
"react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error",
"react/jsx-no-undef": "error",
Expand All @@ -24,79 +22,25 @@
]
},
"settings": {
"import/resolver": {
"node": {
"extensions": [".js", ".ts", ".tsx"]
}
},
"react": {
"version": "detect"
}
},
"overrides": [
{
"files": ["**/*.ts", "**/*.tsx"],
"extends": [
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"@rocket.chat/eslint-config",
"plugin:prettier/recommended"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2018,
"warnOnUnsupportedTypeScriptVersion": false,
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"legacyDecorators": true
}
},
"plugins": ["react", "@typescript-eslint", "anti-trojan-source"],
"plugins": ["react"],
"rules": {
"func-call-spacing": "off",
"jsx-quotes": ["error", "prefer-single"],
"indent": "off",
"no-dupe-class-members": "off",
"no-spaced-func": "off",
"no-unused-vars": "off",
"no-useless-constructor": "off",
"no-use-before-define": "off",
"react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error",
"react/jsx-no-undef": "error",
"react/jsx-fragments": ["error", "syntax"],
"@typescript-eslint/ban-ts-ignore": "off",
"@typescript-eslint/interface-name-prefix": ["error", "always"],
"@typescript-eslint/no-dupe-class-members": "error",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_",
"ignoreRestSiblings": true
}
],
"@typescript-eslint/prefer-optional-chain": "warn",
"anti-trojan-source/no-bidi": "error"
},
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true
"react/jsx-fragments": ["error", "syntax"]
},

"settings": {
"import/resolver": {
"node": {
"extensions": [".js", ".ts", ".tsx"]
}
},
"react": {
"version": "detect"
}
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/client/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
root: true,
extends: ['@rocket.chat/eslint-config', 'prettier'],
extends: ['@rocket.chat/eslint-config/original', 'prettier'],
parser: 'babel-eslint',
plugins: ['react', 'react-hooks', 'prettier', 'testing-library', 'anti-trojan-source'],
rules: {
Expand Down Expand Up @@ -54,7 +54,7 @@ module.exports = {
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'@rocket.chat/eslint-config',
'@rocket.chat/eslint-config/original',
'prettier',
],
parser: '@typescript-eslint/parser',
Expand Down
26 changes: 12 additions & 14 deletions apps/meteor/ee/definition/rest/v1/omnichannel/cannedResponses.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
import type { ILivechatDepartment, IOmnichannelCannedResponse, IUser } from '@rocket.chat/core-typings';
import type { PaginatedResult, PaginatedRequest } from '@rocket.chat/rest-typings';

declare module '@rocket.chat/rest-typings' {
// eslint-disable-next-line @typescript-eslint/interface-name-prefix
interface Endpoints {
'canned-responses': {
GET: (params: {
shortcut?: string;
text?: string;
scope?: string;
createdBy?: IUser['username'];
tags?: any;
departmentId?: ILivechatDepartment['_id'];
offset?: number;
count?: number;
}) => {
GET: (
params: PaginatedRequest<{
shortcut?: string;
text?: string;
scope?: string;
createdBy?: IUser['username'];
tags?: any;
departmentId?: ILivechatDepartment['_id'];
}>,
) => PaginatedResult<{
cannedResponses: IOmnichannelCannedResponse[];
count?: number;
offset?: number;
total: number;
};
}>;
POST: (params: {
_id?: IOmnichannelCannedResponse['_id'];
shortcut: string;
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"@babel/preset-react": "^7.14.5",
"@babel/register": "^7.14.5",
"@playwright/test": "^1.21.0",
"@rocket.chat/eslint-config": "^0.4.0",
"@rocket.chat/eslint-config": "workspace:^",
"@rocket.chat/livechat": "1.13.3",
"@settlin/spacebars-loader": "^1.0.9",
"@storybook/addon-essentials": "~6.4.19",
Expand Down
2 changes: 1 addition & 1 deletion packages/core-typings/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": ["../../.eslintrc"],
"extends": ["@rocket.chat/eslint-config"],
"overrides": [
{
"files": ["**/*.spec.js", "**/*.spec.jsx"],
Expand Down
5 changes: 3 additions & 2 deletions packages/core-typings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"private": true,
"devDependencies": {
"@rocket.chat/apps-engine": "^1.31.0",
"@rocket.chat/eslint-config": "workspace:^",
"@rocket.chat/icons": "^0.31.9",
"@rocket.chat/message-parser": "^0.31.6",
"@rocket.chat/ui-kit": "^0.31.6",
Expand All @@ -13,8 +14,8 @@
"typescript": "~4.3.5"
},
"scripts": {
"eslint": "eslint --ext .js,.jsx,.ts,.tsx .",
"eslint:fix": "eslint --ext .js,.jsx,.ts,.tsx . --fix",
"lint": "eslint --ext .js,.jsx,.ts,.tsx .",
"lint:fix": "eslint --ext .js,.jsx,.ts,.tsx . --fix",
"test": "echo \"Error: no test specified\" && exit 1",
"build": "tsc -p tsconfig.json"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/core-typings/src/Federation.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { IRocketChatRecord } from "./IRocketChatRecord";
import type { IRocketChatRecord } from './IRocketChatRecord';

export interface IFederationServer extends IRocketChatRecord {
domain: string;
domain: string;
}
44 changes: 20 additions & 24 deletions packages/core-typings/src/IAnalytic.ts
Original file line number Diff line number Diff line change
@@ -1,37 +1,33 @@
import type { IRocketChatRecord } from "./IRocketChatRecord";
import type { IRocketChatRecord } from './IRocketChatRecord';

interface IAnalyticsBase extends IRocketChatRecord {
type: "messages" | "users" | "seat-request";
date: number;
type: 'messages' | 'users' | 'seat-request';
date: number;
}

export interface IAnalyticsMessages extends IAnalyticsBase {
type: "messages";
room: {
_id: string;
name?: string;
t: string;
usernames: string[];
};
type: 'messages';
room: {
_id: string;
name?: string;
t: string;
usernames: string[];
};
}

export interface IAnalyticsUsers extends IAnalyticsBase {
type: "users";
room: {
_id: string;
name?: string;
t: string;
usernames: string[];
};
type: 'users';
room: {
_id: string;
name?: string;
t: string;
usernames: string[];
};
}

export interface IAnalyticsSeatRequest extends IAnalyticsBase {
type: "seat-request";
count: number;
type: 'seat-request';
count: number;
}

export type IAnalytic =
| IAnalyticsBase
| IAnalyticsMessages
| IAnalyticsUsers
| IAnalyticsSeatRequest;
export type IAnalytic = IAnalyticsBase | IAnalyticsMessages | IAnalyticsUsers | IAnalyticsSeatRequest;
20 changes: 10 additions & 10 deletions packages/core-typings/src/IAvatar.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { IRocketChatRecord } from "./IRocketChatRecord";
import type { IRocketChatRecord } from './IRocketChatRecord';

export interface IAvatar extends IRocketChatRecord {
name: string;
rid: string;
userId: string;
store: string;
complete: boolean;
uploading: boolean;
progress: number;
extension: string;
uploadedAt: Date;
name: string;
rid: string;
userId: string;
store: string;
complete: boolean;
uploading: boolean;
progress: number;
extension: string;
uploadedAt: Date;
}
45 changes: 22 additions & 23 deletions packages/core-typings/src/IBanner.ts
Original file line number Diff line number Diff line change
@@ -1,35 +1,34 @@
import type { IRocketChatRecord } from "./IRocketChatRecord";
import type { IUser } from "./IUser";
import type { UiKitBannerPayload } from "./UIKit";
import type { IRocketChatRecord } from './IRocketChatRecord';
import type { IUser } from './IUser';
import type { UiKitBannerPayload } from './UIKit';

export enum BannerPlatform {
Web = "web",
Mobile = "mobile",
Web = 'web',
Mobile = 'mobile',
}
export interface IBanner extends IRocketChatRecord {
platform: BannerPlatform[]; // pĺatforms a banner could be shown
expireAt: Date; // date when banner should not be shown anymore
startAt: Date; // start date a banner should be presented
roles?: string[]; // only show the banner to this roles
createdBy: Pick<IUser, "_id" | "username">;
createdAt: Date;
view: UiKitBannerPayload;
active?: boolean;
inactivedAt?: Date;
snapshot?: string;
platform: BannerPlatform[]; // pĺatforms a banner could be shown
expireAt: Date; // date when banner should not be shown anymore
startAt: Date; // start date a banner should be presented
roles?: string[]; // only show the banner to this roles
createdBy: Pick<IUser, '_id' | 'username'>;
createdAt: Date;
view: UiKitBannerPayload;
active?: boolean;
inactivedAt?: Date;
snapshot?: string;
}

export type InactiveBanner = IBanner & {
active: false;
inactivedAt: Date;
active: false;
inactivedAt: Date;
};

export const isInactiveBanner = (banner: IBanner): banner is InactiveBanner =>
banner.active === false;
export const isInactiveBanner = (banner: IBanner): banner is InactiveBanner => banner.active === false;

export interface IBannerDismiss extends IRocketChatRecord {
userId: IUser["_id"]; // user receiving the banner dismissed
bannerId: IBanner["_id"]; // banner dismissed
dismissedAt: Date; // when is was dismissed
dismissedBy: Pick<IUser, "_id" | "username">; // who dismissed (usually the same as userId)
userId: IUser['_id']; // user receiving the banner dismissed
bannerId: IBanner['_id']; // banner dismissed
dismissedAt: Date; // when is was dismissed
dismissedBy: Pick<IUser, '_id' | 'username'>; // who dismissed (usually the same as userId)
}
8 changes: 4 additions & 4 deletions packages/core-typings/src/ICustomEmojiDescriptor.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { IRocketChatRecord } from "./IRocketChatRecord";
import type { IRocketChatRecord } from './IRocketChatRecord';

export interface ICustomEmojiDescriptor extends IRocketChatRecord {
name: string;
aliases: string[];
extension: string;
name: string;
aliases: string[];
extension: string;
}
6 changes: 3 additions & 3 deletions packages/core-typings/src/ICustomSound.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { IRocketChatRecord } from "./IRocketChatRecord";
import type { IRocketChatRecord } from './IRocketChatRecord';

export interface ICustomSound extends IRocketChatRecord {
name: string;
statusType: string;
name: string;
statusType: string;
}
6 changes: 3 additions & 3 deletions packages/core-typings/src/ICustomUserStatus.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { IRocketChatRecord } from "./IRocketChatRecord";
import type { IRocketChatRecord } from './IRocketChatRecord';

export interface ICustomUserStatus extends IRocketChatRecord {
name: string;
statusType: string;
name: string;
statusType: string;
}
Loading