Skip to content

Commit

Permalink
Merge branch 'main' into 3747-update-abstractmessagemanager-to-baseco…
Browse files Browse the repository at this point in the history
…ntrollerv2
  • Loading branch information
OGPoyraz authored Jan 14, 2025
2 parents b273f9f + 74f6d9c commit b4d78a1
Show file tree
Hide file tree
Showing 133 changed files with 6,490 additions and 4,971 deletions.
11 changes: 8 additions & 3 deletions .depcheckrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@ ignores:
- 'simple-git-hooks'
- 'ts-node'
- 'typedoc'
# Ignore plugins implicitly imported by tools
# Ignore plugins for tools
- '@typescript-eslint/*'
- 'babel-jest'
- 'eslint-config-*'
- 'eslint-plugin-*'
- 'jest-silent-reporter'
- 'prettier-plugin-packagejson'
# Ignore plugins we explicitly use with tools
- 'babel-jest'
- 'typescript-eslint'
# Ignore dependencies imported implicitly by tools
- 'eslint-import-resolver-typescript'
# Ignore dependencies which plug into the NPM lifecycle
- '@lavamoat/preinstall-always-fail'
141 changes: 0 additions & 141 deletions .eslintrc.js

This file was deleted.

3 changes: 0 additions & 3 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
## Accounts Team
/packages/accounts-controller @MetaMask/accounts-engineers
/packages/keyring-controller @MetaMask/accounts-engineers
/packages/chain-controller @MetaMask/accounts-engineers

## Assets Team
/packages/assets-controllers @MetaMask/metamask-assets
Expand Down Expand Up @@ -71,8 +70,6 @@
/packages/approval-controller/CHANGELOG.md @MetaMask/confirmations @MetaMask/wallet-framework-engineers
/packages/assets-controllers/package.json @MetaMask/metamask-assets @MetaMask/wallet-framework-engineers
/packages/assets-controllers/CHANGELOG.md @MetaMask/metamask-assets @MetaMask/wallet-framework-engineers
/packages/chain-controller/package.json @MetaMask/accounts-engineers @MetaMask/wallet-framework-engineers
/packages/chain-controller/CHANGELOG.md @MetaMask/accounts-engineers @MetaMask/wallet-framework-engineers
/packages/ens-controller/package.json @MetaMask/confirmations @MetaMask/wallet-framework-engineers
/packages/ens-controller/CHANGELOG.md @MetaMask/confirmations @MetaMask/wallet-framework-engineers
/packages/gas-fee-controller/package.json @MetaMask/confirmations @MetaMask/wallet-framework-engineers
Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ Each package in this repository has its own README where you can find installati
- [`@metamask/assets-controllers`](packages/assets-controllers)
- [`@metamask/base-controller`](packages/base-controller)
- [`@metamask/build-utils`](packages/build-utils)
- [`@metamask/chain-controller`](packages/chain-controller)
- [`@metamask/composable-controller`](packages/composable-controller)
- [`@metamask/controller-utils`](packages/controller-utils)
- [`@metamask/ens-controller`](packages/ens-controller)
Expand Down Expand Up @@ -70,7 +69,6 @@ linkStyle default opacity:0.5
assets_controllers(["@metamask/assets-controllers"]);
base_controller(["@metamask/base-controller"]);
build_utils(["@metamask/build-utils"]);
chain_controller(["@metamask/chain-controller"]);
composable_controller(["@metamask/composable-controller"]);
controller_utils(["@metamask/controller-utils"]);
ens_controller(["@metamask/ens-controller"]);
Expand Down Expand Up @@ -112,7 +110,6 @@ linkStyle default opacity:0.5
assets_controllers --> network_controller;
assets_controllers --> preferences_controller;
base_controller --> json_rpc_engine;
chain_controller --> base_controller;
composable_controller --> base_controller;
composable_controller --> json_rpc_engine;
ens_controller --> base_controller;
Expand Down
152 changes: 152 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
import base, { createConfig } from '@metamask/eslint-config';
import nodejs from '@metamask/eslint-config-nodejs';
import jest from '@metamask/eslint-config-jest';
import typescript from '@metamask/eslint-config-typescript';

const config = createConfig(
{
ignores: [
'yarn.lock',
'**/**.map',
'**/**.tsbuildinfo',
'**/*.json',
'**/*.md',
'**/LICENSE',
'**/*.sh',
'**/.DS_Store',
'**/dist/**',
'**/docs/**',
'**/coverage/**',
'merged-packages/**',
'.yarn/**',
'scripts/create-package/package-template/**',
],
},
...base,
{
rules: {
// Left disabled because various properties throughough this repo are snake_case because the
// names come from external sources or must comply with standards
// e.g. `txreceipt_status`, `signTypedData_v4`, `token_id`
camelcase: 'off',
'id-length': 'off',

// TODO: re-enble most of these rules
'@typescript-eslint/naming-convention': 'off',
'function-paren-newline': 'off',
'id-denylist': 'off',
'implicit-arrow-linebreak': 'off',
'import/no-anonymous-default-export': 'off',
'import/no-unassigned-import': 'off',
'lines-around-comment': 'off',
'n/no-sync': 'off',
'no-async-promise-executor': 'off',
'no-case-declarations': 'off',
'no-invalid-this': 'off',
'no-negated-condition': 'off',
'no-new': 'off',
'no-param-reassign': 'off',
'no-restricted-syntax': 'off',
radix: 'off',
'require-atomic-updates': 'off',
'jsdoc/match-description': [
'off',
{ matchDescription: '^[A-Z`\\d_][\\s\\S]*[.?!`>)}]$' },
],
},
settings: {
jsdoc: {
mode: 'typescript',
},
},
},
{
files: [
'**/jest.config.js',
'**/jest.environment.js',
'**/tests/**/*.{ts,js}',
'*.js',
'*.test.{ts,js}',
'scripts/*.ts',
'scripts/create-package/*.ts',
'yarn.config.cjs',
],
extends: [nodejs],
},
{
files: ['*.test.{ts,js}', '**/tests/**/*.{ts,js}'],
extends: [jest],
},
{
// These files are test helpers, not tests. We still use the Jest ESLint
// config here to ensure that ESLint expects a test-like environment, but
// various rules meant just to apply to tests have been disabled.
files: ['**/tests/**/*.{ts,js}', '!*.test.{ts,js}'],
rules: {
'jest/no-export': 'off',
'jest/require-top-level-describe': 'off',
'jest/no-if': 'off',
},
},
{
files: ['*.js', '*.cjs'],
parserOptions: {
sourceType: 'script',
ecmaVersion: '2020',
},
},
{
files: ['*.ts'],
extends: [typescript],
parserOptions: {
tsconfigRootDir: import.meta.dirname,
project: ['./tsconfig.packages.json'],
},
rules: {
// Enable rules that are disabled in `@metamask/eslint-config-typescript`
'@typescript-eslint/no-explicit-any': 'error',

// TODO: auto-fix breaks stuff
'@typescript-eslint/promise-function-async': 'off',

// TODO: re-enable most of these rules
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/prefer-enum-initializers': 'off',
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'@typescript-eslint/prefer-optional-chain': 'off',
'@typescript-eslint/prefer-reduce-type-parameter': 'off',
'no-restricted-syntax': 'off',
'no-restricted-globals': 'off',
},
},
{
files: ['tests/setupAfterEnv/matchers.ts'],
parserOptions: {
sourceType: 'script',
},
},
{
files: ['*.d.ts'],
rules: {
'@typescript-eslint/naming-convention': 'warn',
'import/unambiguous': 'off',
},
},
{
files: ['scripts/*.ts'],
rules: {
// All scripts will have shebangs.
'n/shebang': 'off',
},
},
{
files: ['**/jest.environment.js'],
rules: {
// These files run under Node, and thus `require(...)` is expected.
'n/global-require': 'off',
},
},
);

export default config;
4 changes: 2 additions & 2 deletions examples/example-controllers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch"
},
"dependencies": {
"@metamask/base-controller": "^7.1.0",
"@metamask/base-controller": "^7.1.1",
"@metamask/utils": "^11.0.1"
},
"devDependencies": {
"@metamask/auto-changelog": "^3.4.4",
"@metamask/controller-utils": "^11.4.4",
"@metamask/controller-utils": "^11.4.5",
"@types/jest": "^27.4.1",
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
Expand Down
Loading

0 comments on commit b4d78a1

Please sign in to comment.