Skip to content

Commit

Permalink
Merge branch 'main' into restrict-more-syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
rekmarks committed Sep 8, 2022
2 parents 13ab76c + 6560a01 commit 597e584
Show file tree
Hide file tree
Showing 17 changed files with 818 additions and 508 deletions.
1 change: 1 addition & 0 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
key: yarn-cache-${{ runner.os }}-${{ steps.yarn-version.outputs.YARN_VERSION }}-${{ hashFiles('yarn.lock') }}
- run: yarn --frozen-lockfile
- run: yarn allow-scripts
- run: yarn patch-package
- run: yarn lint # "Testing" (i.e. config validation) is also done here
- name: Validate RC changelog
if: ${{ startsWith(github.ref, 'release/') }}
Expand Down
17 changes: 10 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,36 @@
{
"name": "root",
"version": "9.0.1",
"version": "10.0.0",
"private": true,
"engines": {
"node": ">=14.0.0"
},
"scripts": {
"setup": "yarn install && yarn allow-scripts",
"setup": "yarn install && yarn allow-scripts && yarn patch-package",
"lint:eslint": "yarn eslint . --ext ts,js",
"lint:config-validation": "node ./scripts/validate-configs.js",
"lint:misc": "prettier '**/*.json' '**/*.md' '!**/CHANGELOG.md' '**/*.yml' --ignore-path .gitignore",
"lint:misc": "prettier '**/*.json' '!**/rules-snapshot.json' '**/*.md' '!**/CHANGELOG.md' '**/*.yml' --ignore-path .gitignore",
"lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:config-validation",
"lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write && yarn lint:config-validation --write"
},
"workspaces": [
"packages/*"
],
"devDependencies": {
"@eslint/eslintrc": "^0.4.0",
"@eslint/eslintrc": "^1.3.0",
"@lavamoat/allow-scripts": "^2.0.3",
"@metamask/auto-changelog": "^2.3.0",
"@metamask/eslint-config": "*",
"@metamask/eslint-config-nodejs": "*",
"@metamask/utils": "^2.1.0",
"eslint": "^7.23.0",
"eslint": "^8.21.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsdoc": "^39.2.9",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-prettier": "^4.2.1",
"fast-deep-equal": "^3.1.3",
"patch-package": "^6.4.7",
"prettier": "^2.2.1"
},
"lavamoat": {
Expand Down
18 changes: 17 additions & 1 deletion packages/base/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [10.0.0]
### Changed
- **(BREAKING)** Update ESLint from v7 to v8 ([#233](https://github.com/MetaMask/eslint-config/pull/233))
- This is breaking because `eslint` is a `peerDependency`.
- Four new rules have been added:
- [`no-loss-of-precision`](https://eslint.org/docs/latest/rules/no-loss-of-precision)
- [`no-nonoctal-decimal-escape`](https://eslint.org/docs/latest/rules/no-nonoctal-decimal-escape)
- [`no-unsafe-optional-chaining`](https://eslint.org/docs/latest/rules/no-unsafe-optional-chaining)
- [`no-useless-backreference`](https://eslint.org/docs/latest/rules/no-useless-backreference)
- **(BREAKING)** Update `eslint-plugin-prettier` from v3 to v4 ([#231](https://github.com/MetaMask/eslint-config/pull/231))
- This is breaking beacuse `eslint-plugin-prettier` is a `peerDependency`.
- **(BREAKING)** Update minimium Node.js version to v14 ([#225](https://github.com/MetaMask/eslint-config/pull/225))
- Ignore rest siblings for `no-unused-vars` ([#213](https://github.com/MetaMask/eslint-config/pull/213))
- This makes the `no-unused-vars` rule more permissive

## [9.0.0]
### Added
- **BREAKING** Add JSDoc ESLint rules ([#203](https://github.com/MetaMask/eslint-config/pull/203))
Expand Down Expand Up @@ -116,7 +131,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Add base, TypeScript, and Jest configs (#3)

[Unreleased]: https://github.com/MetaMask/eslint-config/compare/v9.0.0...HEAD
[Unreleased]: https://github.com/MetaMask/eslint-config/compare/v10.0.0...HEAD
[10.0.0]: https://github.com/MetaMask/eslint-config/compare/v9.0.0...v10.0.0
[9.0.0]: https://github.com/MetaMask/eslint-config/compare/v8.0.0...v9.0.0
[8.0.0]: https://github.com/MetaMask/eslint-config/compare/v7.0.1...v8.0.0
[7.0.1]: https://github.com/MetaMask/eslint-config/compare/v7.0.0...v7.0.1
Expand Down
10 changes: 5 additions & 5 deletions packages/base/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metamask/eslint-config",
"version": "9.0.0",
"version": "10.0.0",
"description": "Shareable MetaMask ESLint config.",
"main": "src/index.js",
"publishConfig": {
Expand All @@ -27,17 +27,17 @@
},
"homepage": "https://github.com/MetaMask/eslint-config#readme",
"devDependencies": {
"eslint": "^7.23.0",
"eslint": "^8.21.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsdoc": "^39.2.9",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.2.1"
},
"peerDependencies": {
"eslint": "^7.23.0",
"eslint": "^8.21.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsdoc": "^39.2.9",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.2.1"
Expand Down
26 changes: 26 additions & 0 deletions packages/base/rules-snapshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,28 @@
"getter-return": "error",
"grouped-accessor-pairs": "error",
"guard-for-in": "error",
"id-denylist": [
"error",
"buf",
"cat",
"err",
"cb",
"cfg",
"hex",
"int",
"msg",
"num",
"opt",
"sig"
],
"id-length": [
"error",
{
"min": 2,
"properties": "never",
"exceptionPatterns": ["_", "a", "b", "i", "j", "k"]
}
],
"implicit-arrow-linebreak": "off",
"import/default": "error",
"import/export": "error",
Expand Down Expand Up @@ -261,6 +283,7 @@
"no-lone-blocks": "error",
"no-lonely-if": "error",
"no-loop-func": "error",
"no-loss-of-precision": "error",
"no-misleading-character-class": "error",
"no-mixed-operators": "off",
"no-mixed-spaces-and-tabs": "off",
Expand All @@ -277,6 +300,7 @@
"no-new-object": "error",
"no-new-symbol": "error",
"no-new-wrappers": "error",
"no-nonoctal-decimal-escape": "error",
"no-obj-calls": "error",
"no-octal": "error",
"no-octal-escape": "error",
Expand Down Expand Up @@ -345,6 +369,7 @@
"no-unreachable": "error",
"no-unsafe-finally": "error",
"no-unsafe-negation": "error",
"no-unsafe-optional-chaining": "error",
"no-unused-expressions": [
"error",
{
Expand All @@ -368,6 +393,7 @@
"functions": false
}
],
"no-useless-backreference": "error",
"no-useless-call": "error",
"no-useless-catch": "error",
"no-useless-computed-key": "error",
Expand Down
24 changes: 24 additions & 0 deletions packages/base/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,30 @@ module.exports = {
'func-name-matching': 'error',
'grouped-accessor-pairs': 'error',
'guard-for-in': 'error',
'id-denylist': [
// This sets this rule to 'error', the rest are the forbidden IDs.
'error',
// These are basically all useless contractions.
'buf',
'cat',
'err',
'cb',
'cfg',
'hex',
'int',
'msg',
'num',
'opt',
'sig',
],
'id-length': [
'error',
{
min: 2,
properties: 'never',
exceptionPatterns: ['_', 'a', 'b', 'i', 'j', 'k'],
},
],
'lines-between-class-members': 'error',
'max-statements-per-line': [
'error',
Expand Down
18 changes: 17 additions & 1 deletion packages/jest/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [10.0.0]
### Changed
- **(BREAKING)** Update ESLint from v7 to v8 ([#233](https://github.com/MetaMask/eslint-config/pull/233))
- This is breaking because `eslint` is a `peerDependency`.
- Four new rules have been added:
- [`no-loss-of-precision`](https://eslint.org/docs/latest/rules/no-loss-of-precision)
- [`no-nonoctal-decimal-escape`](https://eslint.org/docs/latest/rules/no-nonoctal-decimal-escape)
- [`no-unsafe-optional-chaining`](https://eslint.org/docs/latest/rules/no-unsafe-optional-chaining)
- [`no-useless-backreference`](https://eslint.org/docs/latest/rules/no-useless-backreference)
- **(BREAKING)** Bump eslint-plugin-jest to ^26.x ([#228](https://github.com/MetaMask/eslint-config/pull/228))
- This is breaking because `eslint-plugin-jest` is a `peerDependency`
- The rule [`jest/prefer-to-be`](https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-to-be.md) has replaced the old rules `jest/prefer-to-be-null` and `jest/prefer-to-be-undefined`. This is breaking because it is more broadly applicable than the two it replaces, and may force us to use `toBe` for all primatives (over `toBeEqual` or equivalent).
- Two rules were renamed (`jest/valid-describe` => `jest/valid-describe-callback`, and `jest/lowercase-name` => `jest/prefer-lowercase-title`)
- **(BREAKING)** Update minimium Node.js version to v14 ([#225](https://github.com/MetaMask/eslint-config/pull/225))

## [9.0.0]
### Added
- **BREAKING** Add JSDoc ESLint rules ([#203](https://github.com/MetaMask/eslint-config/pull/203))
Expand All @@ -31,7 +46,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- To continue extending this config, install this package and update your `.eslintrc.js` `extends` array to include `@metamask/eslint-config-jest` instead of `@metamask/eslint-config/jest`.
- Update `eslint` and other ESLint peer dependencies ([#151](https://github.com/MetaMask/eslint-config/pull/151))

[Unreleased]: https://github.com/MetaMask/eslint-config/compare/v9.0.0...HEAD
[Unreleased]: https://github.com/MetaMask/eslint-config/compare/v10.0.0...HEAD
[10.0.0]: https://github.com/MetaMask/eslint-config/compare/v9.0.0...v10.0.0
[9.0.0]: https://github.com/MetaMask/eslint-config/compare/v8.0.0...v9.0.0
[8.0.0]: https://github.com/MetaMask/eslint-config/compare/v7.0.0...v8.0.0
[7.0.0]: https://github.com/MetaMask/eslint-config/compare/v6.0.0...v7.0.0
Expand Down
17 changes: 11 additions & 6 deletions packages/jest/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metamask/eslint-config-jest",
"version": "9.0.0",
"version": "10.0.0",
"description": "Shareable MetaMask ESLint config for Jest.",
"main": "src/index.js",
"publishConfig": {
Expand All @@ -27,13 +27,18 @@
},
"homepage": "https://github.com/MetaMask/eslint-config#readme",
"devDependencies": {
"@metamask/eslint-config": "^9.0.0",
"eslint": "^7.23.0",
"eslint-plugin-jest": "^26.8.2"
"@metamask/eslint-config": "^10.0.0",
"eslint": "^8.21.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^26.8.2",
"eslint-plugin-jsdoc": "^39.2.9",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.2.1"
},
"peerDependencies": {
"@metamask/eslint-config": "^9.0.0",
"eslint": "^7.23.0",
"@metamask/eslint-config": "^10.0.0",
"eslint": "^8.21.0",
"eslint-plugin-jest": "^26.8.2"
}
}
19 changes: 18 additions & 1 deletion packages/mocha/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [10.0.0]
### Changed
- **(BREAKING)** Update ESLint from v7 to v8 ([#233](https://github.com/MetaMask/eslint-config/pull/233))
- This is breaking because `eslint` is a `peerDependency`.
- Four new rules have been added:
- [`no-loss-of-precision`](https://eslint.org/docs/latest/rules/no-loss-of-precision)
- [`no-nonoctal-decimal-escape`](https://eslint.org/docs/latest/rules/no-nonoctal-decimal-escape)
- [`no-unsafe-optional-chaining`](https://eslint.org/docs/latest/rules/no-unsafe-optional-chaining)
- [`no-useless-backreference`](https://eslint.org/docs/latest/rules/no-useless-backreference)
- **(BREAKING)** Update `eslint-plugin-mocha` from v8 to v10 ([#232](https://github.com/MetaMask/eslint-config/pull/232))
- This is breaking because `eslint-plugin-mocha` is a `peerDependency`.
- The rule [`mocha/no-empty-description`](https://github.com/lo1tuma/eslint-plugin-mocha/blob/master/docs/rules/no-empty-description.md) was added.
- **(BREAKING)** Update minimium Node.js version to v14 ([#225](https://github.com/MetaMask/eslint-config/pull/225))
- Update Mocha ecmaVersion ([#218](https://github.com/MetaMask/eslint-config/pull/218))
- This lets us use newer JavaScript features in our Mocha tests.

## [9.0.0]
### Added
- **BREAKING** Add JSDoc ESLint rules ([#203](https://github.com/MetaMask/eslint-config/pull/203))
Expand All @@ -32,7 +48,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- To continue extending this config, install this package and update your `.eslintrc.js` `extends` array to include `@metamask/eslint-config-mocha` instead of `@metamask/eslint-config/mocha`.
- Update `eslint` and other ESLint peer dependencies ([#151](https://github.com/MetaMask/eslint-config/pull/151))

[Unreleased]: https://github.com/MetaMask/eslint-config/compare/v9.0.0...HEAD
[Unreleased]: https://github.com/MetaMask/eslint-config/compare/v10.0.0...HEAD
[10.0.0]: https://github.com/MetaMask/eslint-config/compare/v9.0.0...v10.0.0
[9.0.0]: https://github.com/MetaMask/eslint-config/compare/v8.0.0...v9.0.0
[8.0.0]: https://github.com/MetaMask/eslint-config/compare/v7.0.0...v8.0.0
[7.0.0]: https://github.com/MetaMask/eslint-config/compare/v6.0.0...v7.0.0
Expand Down
17 changes: 11 additions & 6 deletions packages/mocha/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metamask/eslint-config-mocha",
"version": "9.0.0",
"version": "10.0.0",
"description": "Shareable MetaMask ESLint config for Mocha.",
"main": "src/index.js",
"publishConfig": {
Expand All @@ -27,13 +27,18 @@
},
"homepage": "https://github.com/MetaMask/eslint-config#readme",
"devDependencies": {
"@metamask/eslint-config": "^9.0.0",
"eslint": "^7.23.0",
"eslint-plugin-mocha": "^10.1.0"
"@metamask/eslint-config": "^10.0.0",
"eslint": "^8.21.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsdoc": "^39.2.9",
"eslint-plugin-mocha": "^10.1.0",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.2.1"
},
"peerDependencies": {
"@metamask/eslint-config": "^9.0.0",
"eslint": "^7.23.0",
"@metamask/eslint-config": "^10.0.0",
"eslint": "^8.21.0",
"eslint-plugin-mocha": "^10.1.0"
}
}
14 changes: 13 additions & 1 deletion packages/nodejs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [10.0.0]
### Changed
- **(BREAKING)** Update ESLint from v7 to v8 ([#233](https://github.com/MetaMask/eslint-config/pull/233))
- This is breaking because `eslint` is a `peerDependency`.
- Four new rules have been added:
- [`no-loss-of-precision`](https://eslint.org/docs/latest/rules/no-loss-of-precision)
- [`no-nonoctal-decimal-escape`](https://eslint.org/docs/latest/rules/no-nonoctal-decimal-escape)
- [`no-unsafe-optional-chaining`](https://eslint.org/docs/latest/rules/no-unsafe-optional-chaining)
- [`no-useless-backreference`](https://eslint.org/docs/latest/rules/no-useless-backreference)
- **(BREAKING)** Update minimium Node.js version to v14 ([#225](https://github.com/MetaMask/eslint-config/pull/225))

## [9.0.0]
### Added
- **BREAKING** Add JSDoc ESLint rules ([#203](https://github.com/MetaMask/eslint-config/pull/203))
Expand Down Expand Up @@ -39,7 +50,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- To continue extending this config, install this package and update your `.eslintrc.js` `extends` array to include `@metamask/eslint-config-nodejs` instead of `@metamask/eslint-config/nodejs`.
- Update `eslint` and other ESLint peer dependencies ([#151](https://github.com/MetaMask/eslint-config/pull/151))

[Unreleased]: https://github.com/MetaMask/eslint-config/compare/v9.0.0...HEAD
[Unreleased]: https://github.com/MetaMask/eslint-config/compare/v10.0.0...HEAD
[10.0.0]: https://github.com/MetaMask/eslint-config/compare/v9.0.0...v10.0.0
[9.0.0]: https://github.com/MetaMask/eslint-config/compare/v8.0.0...v9.0.0
[8.0.0]: https://github.com/MetaMask/eslint-config/compare/v7.0.1...v8.0.0
[7.0.1]: https://github.com/MetaMask/eslint-config/compare/v7.0.0...v7.0.1
Expand Down
17 changes: 11 additions & 6 deletions packages/nodejs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metamask/eslint-config-nodejs",
"version": "9.0.0",
"version": "10.0.0",
"description": "Shareable MetaMask ESLint config for Node.js.",
"main": "src/index.js",
"publishConfig": {
Expand All @@ -27,13 +27,18 @@
},
"homepage": "https://github.com/MetaMask/eslint-config#readme",
"devDependencies": {
"@metamask/eslint-config": "^9.0.0",
"eslint": "^7.23.0",
"eslint-plugin-node": "^11.1.0"
"@metamask/eslint-config": "^10.0.0",
"eslint": "^8.21.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsdoc": "^39.2.9",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.2.1"
},
"peerDependencies": {
"@metamask/eslint-config": "^9.0.0",
"eslint": "^7.23.0",
"@metamask/eslint-config": "^10.0.0",
"eslint": "^8.21.0",
"eslint-plugin-node": "^11.1.0"
}
}

0 comments on commit 597e584

Please sign in to comment.