Socket
Socket
Sign inDemoInstall

@metamask/eslint-config

Package Overview
Dependencies
Maintainers
9
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@metamask/eslint-config - npm Package Compare versions

Comparing version 9.0.0 to 12.0.0

src/environment.json

80

CHANGELOG.md

@@ -9,9 +9,57 @@ # Changelog

## [12.0.0]
### Added
- **BREAKING:** Add `eslint-plugin-promise` peer dependency, and enable `no-multiple-resolved` ([#287](https://github.com/MetaMask/eslint-config/pull/287))
## [11.1.0]
### Changed
- Exclude test files from package ([#266](https://github.com/MetaMask/eslint-config/pull/266))
## [11.0.2]
### Changed
- Stop requiring newlines between multiline blocks/expressions ([#263](https://github.com/MetaMask/eslint-config/pull/263))
## [11.0.1]
### Fixed
- Enable function expressions again ([#258](https://github.com/MetaMask/eslint-config/pull/258))
- We didn't realize this rule would disallow class methods, even class constructors. This was too disruptive.
## [11.0.0]
### Added
- **BREAKING:** Enable id-denylist and id-length in base config ([#200](https://github.com/MetaMask/eslint-config/pull/200))
- **BREAKING:** Add rules for hybrid Node.js and browser environments ([#242](https://github.com/MetaMask/eslint-config/pull/242))
- The base config now only allows globals and modules that are available in both Node.js and browsers.
- This adds a new `@metamask/eslint-config-browser` package, to be used in browser-only environments.
- The `@metamask/eslint-config-nodejs` package has been updated to allow Node.js-only globals and modules.
### Changed
- **BREAKING:** Remove no-undef in favour of custom environments configuration ([#254](https://github.com/MetaMask/eslint-config/pull/254))
- **BREAKING:** Bump all ESLint dependencies to the latest version ([#252](https://github.com/MetaMask/eslint-config/pull/252))
- This includes peer dependencies.
- **BREAKING:** Automatically sort imports ([#248](https://github.com/MetaMask/eslint-config/pull/248))
- **BREAKING:** Disable more undesired syntax ([#207](https://github.com/MetaMask/eslint-config/pull/207))
- This disables the `with` statement, function expressions, and the `in` operator.
## [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))
- **BREAKING:** Add JSDoc ESLint rules ([#203](https://github.com/MetaMask/eslint-config/pull/203))
## [8.0.0]
### Changed
- **(BREAKING)** Require newlines between multiline blocks and expressions ([#197](https://github.com/MetaMask/eslint-config/pull/197))
- **BREAKING:** Require newlines between multiline blocks and expressions ([#197](https://github.com/MetaMask/eslint-config/pull/197))

@@ -28,4 +76,4 @@ ## [7.0.1]

### Changed
- **(BREAKING)** Update Prettier `quoteProps` rule to `as-needed` ([#181](https://github.com/MetaMask/eslint-config/pull/181))
- **(BREAKING)** Update ESLint `no-shadow` config ([#168](https://github.com/MetaMask/eslint-config/pull/168))
- **BREAKING:** Update Prettier `quoteProps` rule to `as-needed` ([#181](https://github.com/MetaMask/eslint-config/pull/181))
- **BREAKING:** Update ESLint `no-shadow` config ([#168](https://github.com/MetaMask/eslint-config/pull/168))
- Use recommended `eslint-plugin-import` rule sets ([#184](https://github.com/MetaMask/eslint-config/pull/184))

@@ -38,5 +86,5 @@ - This only removed or disabled rules, and is not breaking.

### Changed
- **(BREAKING)** Set minimum Node.js version to `^12.0.0` ([#144](https://github.com/MetaMask/eslint-config/pull/144))
- **(BREAKING)** Set ECMAScript version to `es2017`/`8` ([#150](https://github.com/MetaMask/eslint-config/pull/150))
- **(BREAKING)** Add the [Prettier](https://prettier.io) ESLint plugin and extend the recommended Prettier ESLint config ([#96](https://github.com/MetaMask/eslint-config/pull/96))
- **BREAKING:** Set minimum Node.js version to `^12.0.0` ([#144](https://github.com/MetaMask/eslint-config/pull/144))
- **BREAKING:** Set ECMAScript version to `es2017`/`8` ([#150](https://github.com/MetaMask/eslint-config/pull/150))
- **BREAKING:** Add the [Prettier](https://prettier.io) ESLint plugin and extend the recommended Prettier ESLint config ([#96](https://github.com/MetaMask/eslint-config/pull/96))
- See [here](https://github.com/prettier/eslint-plugin-prettier/blob/d993f24/eslint-plugin-prettier.js#L62-L73) for the `eslint-plugin-prettier` rules and [here](https://github.com/prettier/eslint-config-prettier/blob/abf3ba1/index.js) for the rules of `eslint-config-prettier`, which the plugin extends.

@@ -47,3 +95,3 @@ - The rules of this config should otherwise be unchanged.

### Removed
- **(BREAKING)** All configs except the base config ([#141](https://github.com/MetaMask/eslint-config/pull/141))
- **BREAKING:** All configs except the base config ([#141](https://github.com/MetaMask/eslint-config/pull/141))
- All configs are now published as separate packages, and must be extended by referencing their package names:

@@ -58,5 +106,5 @@ - [`@metamask/eslint-config`](https://npmjs.com/package/@metamask/eslint-config) (the base config)

### Changed
- **(BREAKING)** Enable `semi` in base config ([#101](https://github.com/MetaMask/eslint-config/pull/101))
- **(BREAKING)** Disallow spaces before parentheses of named functions ([#101](https://github.com/MetaMask/eslint-config/pull/101))
- **(BREAKING)** Upgrade to TypeScript v4 and corresponding `@typescript-eslint` dependencies ([#79](https://github.com/MetaMask/eslint-config/pull/79), [#80](https://github.com/MetaMask/eslint-config/pull/80), [#103](https://github.com/MetaMask/eslint-config/pull/103))
- **BREAKING:** Enable `semi` in base config ([#101](https://github.com/MetaMask/eslint-config/pull/101))
- **BREAKING:** Disallow spaces before parentheses of named functions ([#101](https://github.com/MetaMask/eslint-config/pull/101))
- **BREAKING:** Upgrade to TypeScript v4 and corresponding `@typescript-eslint` dependencies ([#79](https://github.com/MetaMask/eslint-config/pull/79), [#80](https://github.com/MetaMask/eslint-config/pull/80), [#103](https://github.com/MetaMask/eslint-config/pull/103))

@@ -70,3 +118,3 @@ ## [4.1.0] - 2020-10-21

### Changed
- **(BREAKING)** Update to ESLint v7 (#46, #58, #62, #63)
- **BREAKING:** Update to ESLint v7 (#46, #58, #62, #63)
- Relax `member-delimiter-style` for TypeScript ([#68](https://github.com/MetaMask/eslint-config/pull/68))

@@ -125,3 +173,9 @@ - Disable `space-before-function-paren` for TypeScript ([#65](https://github.com/MetaMask/eslint-config/pull/65))

[Unreleased]: https://github.com/MetaMask/eslint-config/compare/v9.0.0...HEAD
[Unreleased]: https://github.com/MetaMask/eslint-config/compare/v12.0.0...HEAD
[12.0.0]: https://github.com/MetaMask/eslint-config/compare/v11.1.0...v12.0.0
[11.1.0]: https://github.com/MetaMask/eslint-config/compare/v11.0.2...v11.1.0
[11.0.2]: https://github.com/MetaMask/eslint-config/compare/v11.0.1...v11.0.2
[11.0.1]: https://github.com/MetaMask/eslint-config/compare/v11.0.0...v11.0.1
[11.0.0]: https://github.com/MetaMask/eslint-config/compare/v10.0.0...v11.0.0
[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

@@ -128,0 +182,0 @@ [8.0.0]: https://github.com/MetaMask/eslint-config/compare/v7.0.1...v8.0.0

67

package.json
{
"name": "@metamask/eslint-config",
"version": "9.0.0",
"version": "12.0.0",
"description": "Shareable MetaMask ESLint config.",
"main": "src/index.js",
"publishConfig": {
"registry": "https://registry.npmjs.org/",
"access": "public"
"homepage": "https://github.com/MetaMask/eslint-config#readme",
"bugs": {
"url": "https://github.com/MetaMask/eslint-config/issues"
},
"files": [
"src/"
],
"engines": {
"node": ">=12.0.0"
},
"scripts": {
"test": "eslint .",
"publish": "npm publish"
},
"repository": {

@@ -25,22 +14,38 @@ "type": "git",

"license": "MIT",
"bugs": {
"url": "https://github.com/MetaMask/eslint-config/issues"
"main": "src/index.js",
"files": [
"src/",
"!src/**/*.test.js"
],
"scripts": {
"lint:changelog": "auto-changelog validate",
"publish": "npm publish",
"test": "eslint ."
},
"homepage": "https://github.com/MetaMask/eslint-config#readme",
"devDependencies": {
"eslint": "^7.23.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsdoc": "^36.1.0",
"eslint-plugin-prettier": "^3.3.1",
"prettier": "^2.2.1"
"@metamask/auto-changelog": "^3.0.0",
"eslint": "^8.27.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsdoc": "^39.6.2",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-promise": "^6.1.1",
"prettier": "^2.7.1"
},
"peerDependencies": {
"eslint": "^7.23.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsdoc": "^36.1.0",
"eslint-plugin-prettier": "^3.3.1",
"prettier": "^2.2.1"
"eslint": "^8.27.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsdoc": "^39.6.2",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-promise": "^6.1.1",
"prettier": "^2.7.1"
},
"engines": {
"node": ">=14.0.0"
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
}
}
}

@@ -11,9 +11,10 @@ # `@metamask/eslint-config`

yarn add --dev \
@metamask/eslint-config@^9.0.0 \
eslint@^7.23.0 \
eslint-config-prettier@^8.1.0 \
eslint-plugin-import@^2.22.1 \
eslint-plugin-jsdoc@^36.1.0 \
eslint-plugin-prettier@^3.3.1 \
prettier@^2.2.1
@metamask/eslint-config@^12.0.0 \
eslint@^8.27.0 \
eslint-config-prettier@^8.5.0 \
eslint-plugin-import@^2.26.0 \
eslint-plugin-jsdoc@^39.6.2 \
eslint-plugin-prettier@^4.2.1 \
eslint-plugin-promise@^6.1.1 \
prettier@^2.7.1
```

@@ -20,0 +21,0 @@

@@ -0,1 +1,3 @@

const environmentRules = require('./environment.json');
module.exports = {

@@ -21,3 +23,3 @@ env: {

plugins: ['jsdoc', 'prettier'],
plugins: ['jsdoc', 'prettier', 'promise'],

@@ -31,2 +33,4 @@ extends: [

rules: {
...environmentRules,
/* Prettier rules */

@@ -53,5 +57,2 @@ 'prettier/prettier': [

// Not required by prettier, but potentially gotchas.
'no-restricted-syntax': ['error', 'SequenceExpression'],
/* Core rules */

@@ -77,2 +78,26 @@ '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',

@@ -142,3 +167,19 @@ 'max-statements-per-line': [

'no-proto': 'error',
'no-restricted-globals': ['error', 'event'],
'no-restricted-syntax': [
'error',
{
selector: 'WithStatement',
message: 'With statements are not allowed',
},
{
selector: `BinaryExpression[operator='in']`,
message: 'The "in" operator is not allowed',
},
// Sequence expressions have potential gotchas with Prettier, and are also
// weird!
{
selector: 'SequenceExpression',
message: 'Sequence expressions are not allowed',
},
],
'no-return-assign': ['error', 'except-parens'],

@@ -171,2 +212,3 @@ 'no-script-url': 'error',

argsIgnorePattern: '[_]+',
ignoreRestSiblings: true,
},

@@ -208,7 +250,2 @@ ],

},
{
blankLine: 'always',
prev: ['multiline-block-like', 'multiline-expression'],
next: ['multiline-block-like', 'multiline-expression'],
},
],

@@ -280,2 +317,3 @@ 'prefer-const': 'error',

'import/no-named-default': 'error',
'import/no-nodejs-modules': 'error',
'import/no-self-import': 'error',

@@ -297,3 +335,26 @@ 'import/no-unassigned-import': 'error',

'import/no-webpack-loader-syntax': 'error',
'import/order': 'error',
'import/order': [
'error',
{
// This means that there will always be a newline between the import
// groups as defined below.
'newlines-between': 'always',
groups: [
// "builtin" is Node.js modules that are built into the runtime, and
// "external" is everything else from node_modules.
['builtin', 'external'],
// "internal" is unused, but could be used for absolute imports from
// the project root.
['internal', 'parent', 'sibling', 'index'],
],
// Alphabetically sort the imports within each group.
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
'import/unambiguous': 'error',

@@ -345,3 +406,5 @@

'jsdoc/valid-types': 'error',
'promise/no-multiple-resolved': 'error',
},
};
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc