Skip to content

Commit

Permalink
chore: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-sanderson committed Nov 6, 2024
1 parent 2bfdbbb commit 7f791e5
Show file tree
Hide file tree
Showing 26 changed files with 91 additions and 52 deletions.
1 change: 1 addition & 0 deletions packages/connect-explorer/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export default [
{
rules: {
'import/no-default-export': 'off', // Todo: shall be fixed
'no-restricted-syntax': 'off', // Todo: shall be fixed
'@typescript-eslint/no-restricted-imports': 'off',
'@typescript-eslint/no-shadow': 'off',
'react/jsx-filename-extension': [
Expand Down
10 changes: 10 additions & 0 deletions packages/connect-iframe/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { eslint } from '@trezor/eslint';

export default [
...eslint,
{
rules: {
'import/no-default-export': 'off', // Todo: shall be fixed
},
},
];
1 change: 1 addition & 0 deletions packages/connect-iframe/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"devDependencies": {
"@babel/preset-typescript": "^7.24.7",
"@trezor/env-utils": "workspace:*",
"@trezor/eslint": "workspace:*",
"babel-loader": "^9.1.3",
"copy-webpack-plugin": "^12.0.2",
"es6-promise": "^4.2.8",
Expand Down
10 changes: 10 additions & 0 deletions packages/connect-plugin-stellar/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { eslint } from '@trezor/eslint';

export default [
...eslint,
{
rules: {
'import/no-default-export': 'off', // Todo: fix and solve
},
},
];
3 changes: 2 additions & 1 deletion packages/connect-plugin-stellar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"tslib": "^2.6.2"
},
"devDependencies": {
"@stellar/stellar-sdk": "^12.1.3"
"@stellar/stellar-sdk": "^12.1.3",
"@trezor/eslint": "workspace:*"
},
"dependencies": {
"@trezor/utils": "workspace:*"
Expand Down
1 change: 1 addition & 0 deletions packages/connect-popup/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export default [
...eslint,
{
rules: {
'no-console': 'off',
'no-restricted-syntax': 'off', // Todo: fix and solve
},
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/prefer-ts-expect-error */
// @ts-ignore
import { MessagesSchema } from '@trezor/protobuf';

Expand Down
40 changes: 0 additions & 40 deletions packages/eslint/src/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -63,44 +63,4 @@ export default [
'import/no-extraneous-dependencies': 'off',
},
},

// Todo: remove all below before merge!
{
// we are using explicit blacklist because this will enforce new rules in newly created packages
files: [
'packages/analytics/**/*',
'packages/blockchain-link/**/*',
'packages/components/**/*',
'packages/product-components/**/*',
'packages/connect/**/*',
'packages/connect-common/**/*',
'packages/connect-explorer/**/*',
'packages/connect-web/**/*',
'packages/connect-popup/**/*',
'packages/connect-iframe/**/*',
'packages/connect-examples/**/*',
'packages/connect-plugin-ethereum/**/*',
'packages/connect-plugin-stellar/**/*',
'packages/request-manager/**/*',
'**/packages/suite/**/*',
'packages/suite-build/**/*',
'packages/suite-data/**/*',
'packages/suite-desktop-api/**/*',
'packages/suite-storage/**/*',
'packages/suite-web/**/*',
'packages/transport/**/*',
'packages/utxo-lib/**/*',
'scripts/**/*',
'docs/**/*',
],
rules: {
// '@typescript-eslint/no-shadow': 'off',
'import/no-default-export': 'off',
// 'no-console': 'off',
// 'react/jsx-no-undef': 'off',
// 'no-catch-shadow': 'off',
// '@typescript-eslint/no-restricted-imports': 'off',
// 'no-restricted-syntax': 'off',
},
},
];
1 change: 1 addition & 0 deletions packages/eslint/src/importConfig.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export const importConfig = [
'**/*.stories.*',
'**/*webpack.config*',
'**/webpack/**',
'**/.storybook/**',
],

includeTypes: true,
Expand Down
1 change: 1 addition & 0 deletions packages/product-components/.storybook/manager.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { addons } from '@storybook/addons';

import theme from './theme';

addons.setConfig({
Expand Down
10 changes: 10 additions & 0 deletions packages/product-components/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { eslint } from '@trezor/eslint';

export default [
...eslint,
{
rules: {
'import/no-default-export': 'off',
},
},
];
2 changes: 2 additions & 0 deletions packages/product-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
"@storybook/client-api": "^7.6.13",
"@storybook/react": "^7.6.13",
"@storybook/react-webpack5": "^7.6.13",
"@storybook/theming": "^7.6.13",
"@trezor/eslint": "workspace:*",
"@types/react": "18.2.79",
"storybook": "^7.6.13",
"stylelint": "^16.2.1",
Expand Down
1 change: 0 additions & 1 deletion packages/react-native-usb/plugins/withUSBDevice.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-shadow */
/* eslint-disable require-await */
const { AndroidConfig, withAndroidManifest } = require('expo/config-plugins');

Expand Down
1 change: 0 additions & 1 deletion packages/suite-analytics/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export enum AppUpdateEventStatus {
InstallAndRestart = 'install-and-restart',
InstallOnQuit = 'install-on-quit',
Closed = 'closed',
// eslint-disable-next-line @typescript-eslint/no-shadow
Error = 'error',
}

Expand Down
11 changes: 11 additions & 0 deletions packages/suite-build/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { eslint } from '@trezor/eslint';

export default [
...eslint,
{
rules: {
'no-console': 'off',
'import/no-default-export': 'off',
},
},
];
1 change: 1 addition & 0 deletions packages/suite-build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"devDependencies": {
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.11",
"@sentry/webpack-plugin": "^2.14.0",
"@trezor/eslint": "workspace:*",
"@types/copy-webpack-plugin": "^10.1.0",
"@types/webpack-bundle-analyzer": "^4.7.0",
"@types/webpack-plugin-serve": "^1.4.6",
Expand Down
1 change: 0 additions & 1 deletion packages/suite-data/src/translations/backport-en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import fs from 'fs';
import path from 'path';

// See comment in list-duplicates.ts
// eslint-disable-next-line import/no-extraneous-dependencies
import messages from '@trezor/suite/src/support/messages';

const packagesRoot = path.join(__dirname, '../../../');
Expand Down
1 change: 0 additions & 1 deletion packages/suite-data/src/translations/list-duplicates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// this is causing module cyclic dependency!!! it will work since this dep is not specified
// in package.json or refs, and also these files must be excluded from TS check
// TODO: intl or scripts should have dedicated package on that could both suite-data and suite depends
// eslint-disable-next-line import/no-extraneous-dependencies
import messages from '@trezor/suite/src/support/messages';

type Message = {
Expand Down
1 change: 0 additions & 1 deletion packages/suite-data/src/translations/list-unused.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import path from 'path';
import fs from 'fs';

// See comment in list-duplicates.ts
// eslint-disable-next-line import/no-extraneous-dependencies
import messages from '@trezor/suite/src/support/messages';

console.log('unused messages: ');
Expand Down
1 change: 0 additions & 1 deletion packages/suite-desktop-core/scripts/notarize.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable no-console */

const { notarize } = require('@electron/notarize');
Expand Down
1 change: 0 additions & 1 deletion packages/suite-desktop-core/src/app.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-use-before-define */
import path from 'path';
import { app, BrowserWindow } from 'electron';

Expand Down
10 changes: 10 additions & 0 deletions packages/suite-storage/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { eslint } from '@trezor/eslint';

export default [
...eslint,
{
rules: {
'import/no-default-export': 'off',
},
},
];
1 change: 1 addition & 0 deletions packages/suite-storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"browser": "./src/web/index.ts",
"dependencies": {
"@trezor/env-utils": "workspace:*",
"@trezor/eslint": "workspace:*",
"@trezor/utils": "workspace:*",
"broadcast-channel": "^7.0.0",
"idb": "^8.0.0"
Expand Down
1 change: 0 additions & 1 deletion packages/suite-web/e2e/support/commands.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable @typescript-eslint/no-namespace */
/* eslint-disable @typescript-eslint/no-var-requires */

import { SuiteAnalyticsEvent } from '@trezor/suite-analytics';

Expand Down
2 changes: 0 additions & 2 deletions suite-common/test-utils/src/conditionalDescribe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ export const conditionalDescribe = (
fn: jest.EmptyFunction,
) => {
if (skipCondition) {
// eslint-disable-next-line jest/valid-describe-callback
describe.skip(title, fn);
} else {
// eslint-disable-next-line jest/valid-describe-callback
describe(title, fn);
}
};
29 changes: 29 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8487,6 +8487,15 @@ __metadata:
languageName: node
linkType: hard

"@storybook/client-logger@npm:7.6.20":
version: 7.6.20
resolution: "@storybook/client-logger@npm:7.6.20"
dependencies:
"@storybook/global": "npm:^5.0.0"
checksum: 10/0062c440c825ab460667d799b00d3ff87dcf4dabce05733c11ffbb1ea70e0a2e77fdc313ce9bdeccc4ac816101abe17572b96cc20c975874812f875828653704
languageName: node
linkType: hard

"@storybook/codemod@npm:7.6.13":
version: 7.6.13
resolution: "@storybook/codemod@npm:7.6.13"
Expand Down Expand Up @@ -8924,6 +8933,21 @@ __metadata:
languageName: node
linkType: hard

"@storybook/theming@npm:^7.6.13":
version: 7.6.20
resolution: "@storybook/theming@npm:7.6.20"
dependencies:
"@emotion/use-insertion-effect-with-fallbacks": "npm:^1.0.0"
"@storybook/client-logger": "npm:7.6.20"
"@storybook/global": "npm:^5.0.0"
memoizerific: "npm:^1.11.3"
peerDependencies:
react: ^16.8.0 || ^17.0.0 || ^18.0.0
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
checksum: 10/c26ba05d8fa1ba6c9d62b1d690dc55ba56874c493a7dfef5e85df89fc1da2ce8be09d7426071e43dbb3bf16ca4bc579a94f8f1a1ab14cfd29465a6a6eca5b158
languageName: node
linkType: hard

"@storybook/types@npm:7.6.13":
version: 7.6.13
resolution: "@storybook/types@npm:7.6.13"
Expand Down Expand Up @@ -11316,6 +11340,7 @@ __metadata:
"@trezor/connect-analytics": "workspace:*"
"@trezor/connect-common": "workspace:*"
"@trezor/env-utils": "workspace:*"
"@trezor/eslint": "workspace:*"
babel-loader: "npm:^9.1.3"
copy-webpack-plugin: "npm:^12.0.2"
es6-promise: "npm:^4.2.8"
Expand Down Expand Up @@ -11639,13 +11664,15 @@ __metadata:
"@storybook/client-api": "npm:^7.6.13"
"@storybook/react": "npm:^7.6.13"
"@storybook/react-webpack5": "npm:^7.6.13"
"@storybook/theming": "npm:^7.6.13"
"@suite-common/validators": "workspace:*"
"@suite-common/wallet-config": "workspace:*"
"@suite-common/wallet-utils": "workspace:*"
"@trezor/components": "workspace:*"
"@trezor/connect": "workspace:*"
"@trezor/dom-utils": "workspace:*"
"@trezor/env-utils": "workspace:*"
"@trezor/eslint": "workspace:*"
"@trezor/react-utils": "workspace:*"
"@trezor/theme": "workspace:*"
"@trezor/urls": "workspace:*"
Expand Down Expand Up @@ -11792,6 +11819,7 @@ __metadata:
"@pmmmwh/react-refresh-webpack-plugin": "npm:^0.5.11"
"@sentry/webpack-plugin": "npm:^2.14.0"
"@suite-common/suite-config": "workspace:*"
"@trezor/eslint": "workspace:*"
"@trezor/suite": "workspace:*"
"@types/copy-webpack-plugin": "npm:^10.1.0"
"@types/webpack-bundle-analyzer": "npm:^4.7.0"
Expand Down Expand Up @@ -11953,6 +11981,7 @@ __metadata:
resolution: "@trezor/suite-storage@workspace:packages/suite-storage"
dependencies:
"@trezor/env-utils": "workspace:*"
"@trezor/eslint": "workspace:*"
"@trezor/utils": "workspace:*"
broadcast-channel: "npm:^7.0.0"
idb: "npm:^8.0.0"
Expand Down

0 comments on commit 7f791e5

Please sign in to comment.