MetaMask / eslint-config

Shareable MetaMask ESLint config
MIT License
6 stars 16 forks source link

@metamask/eslint-config

This monorepo contains MetaMask's ESLint configurations as npm packages. The different configs are split up into individual packages so that we can correctly specify their peer dependencies.

Contributing

Setup

Testing and Linting

Run yarn lint to run the linter, or run yarn lint:fix to run the linter and fix any automatically fixable issues.

Updating or Adding Configs

Configs targeting an entirely new environment should be added in a new package. Our rule validation script (see ./scripts/validate-rules.js) forbids the following rules:

Linting will fail in CI if any of the above conditions are violated in any config.

Finally, in order to understand the impact of changing rules or the set of extended configs, each package has a rules-snapshot.json fill which contains all rules of the particular config and its extended configs in a single dictionary. When editing a package, always check its rules snapshots after running yarn lint:fix to understand which rules changed.

Release & Publishing

The project follows the same release process as the other libraries in the MetaMask organization. The GitHub Actions action-create-release-pr and action-publish-release are used to automate the release process; see those repositories for more information about how they work.

  1. Choose a release version.
  1. If this release is backporting changes onto a previous release, then ensure there is a major version branch for that version (e.g. 1.x for a v1 backport release).
  1. Trigger the workflow_dispatch event manually for the Create Release Pull Request action to create the release PR.
  1. Update the changelog to move each change entry into the appropriate change category (See here for the full list of change categories, and the correct ordering), and edit them to be more easily understood by users of the package.
  1. Review and QA the release.
  1. Squash & Merge the release.
  1. Publish the release on npm.