Socket
Socket
Sign inDemoInstall

@metamask/eslint-config-typescript

Package Overview
Dependencies
Maintainers
9
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@metamask/eslint-config-typescript - npm Package Compare versions

Comparing version 9.0.1 to 12.0.0

67

CHANGELOG.md

@@ -9,2 +9,48 @@ # Changelog

## [12.0.0]
### Added
- **BREAKING:** Add rule to enforce generic parameters have a length of at least 3 characters ([#292](https://github.com/MetaMask/eslint-config/pull/292))
- **BREAKING:** Enable `@typescript-eslint/consistent-type-imports` rule ([#284](https://github.com/MetaMask/eslint-config/pull/284))
- **BREAKING:** Enable `@typescript-eslint/prefer-enum-initializers` rule ([#269](https://github.com/MetaMask/eslint-config/pull/269))
### Changed
- **BREAKING:** Update peer dependency `@metamask/eslint-config` to v12
- Disable naming convention for properties that require quotes ([#293](https://github.com/MetaMask/eslint-config/pull/293))
## [11.1.0]
### Changed
- Exclude test files from package ([#266](https://github.com/MetaMask/eslint-config/pull/266))
## [11.0.2]
### Changed
- Allow async functions without any 'await' ([#262](https://github.com/MetaMask/eslint-config/pull/262))
- Allow parameters to use PascalCase ([#264](https://github.com/MetaMask/eslint-config/pull/264))
## [11.0.0]
### Added
- **BREAKING:** Add rules that require type information ([#250](https://github.com/MetaMask/eslint-config/pull/250))
- This requires setting some parser options. See the README for more details.
- **BREAKING:** Bump all ESLint dependencies to the latest version ([#252](https://github.com/MetaMask/eslint-config/pull/252))
- This includes peer dependencies.
- **BREAKING:** Forbid TypeScript's private modifier in favour of hash names ([#244](https://github.com/MetaMask/eslint-config/pull/244))
## [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 `@typescript-eslint` parser and plugin ([#230](https://github.com/MetaMask/eslint-config/pull/230))
- This is breaking because these two packages are `peerDependencies`
- There are two new rules:
- [`@typescript-eslint/no-loss-of-precision`](https://typescript-eslint.io/rules/no-loss-of-precision)
- [`@typescript-eslint/no-unnecessary-type-constraint`](https://typescript-eslint.io/rules/no-unnecessary-type-constraint).
- **BREAKING:** Update minimium Node.js version to v14 ([#225](https://github.com/MetaMask/eslint-config/pull/225))
- **BREAKING:** Forbid TypeScript interfaces ([#216](https://github.com/MetaMask/eslint-config/pull/216))
- 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.1]

@@ -17,6 +63,6 @@ ### Changed

### 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))
### Changed
- **BREAKING** Disable `no-throw-literal` and enable `@typescript-eslint/no-throw-literal` ([#201](https://github.com/MetaMask/eslint-config/pull/201))
- **BREAKING:** Disable `no-throw-literal` and enable `@typescript-eslint/no-throw-literal` ([#201](https://github.com/MetaMask/eslint-config/pull/201))
- This rule requires type information, which requires [additional project setup](https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/TYPED_LINTING.md).

@@ -26,2 +72,4 @@ - Note: This change has been undone in v9.0.1. You can ignore this change if you're updating to v9.0.1 or greater.

## [8.0.0]
### Changed
- **BREAKING:** The peer dependency `@metamask/eslint-config` has been updated from v7 to v8.

@@ -36,3 +84,3 @@ ## [7.0.1]

### Changed
- **(BREAKING)** Update `@typescript/no-shadow` config ([#168](https://github.com/MetaMask/eslint-config/pull/168))
- **BREAKING:** Update `@typescript/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))

@@ -48,5 +96,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 `es2020`/`11` ([#150](https://github.com/MetaMask/eslint-config/pull/150))
- **(BREAKING)** Enable all rules recommended by the `@typescript-eslint` plugin ([#156](https://github.com/MetaMask/eslint-config/pull/156))
- **BREAKING:** Set minimum Node.js version to `^12.0.0` ([#144](https://github.com/MetaMask/eslint-config/pull/144))
- **BREAKING:** Set ECMAScript version to `es2020`/`11` ([#150](https://github.com/MetaMask/eslint-config/pull/150))
- **BREAKING:** Enable all rules recommended by the `@typescript-eslint` plugin ([#156](https://github.com/MetaMask/eslint-config/pull/156))
- This amounted to setting the following core ESLint rules to `error`:

@@ -63,3 +111,8 @@ - [no-var](https://eslint.org/docs/7.0.0/rules/no-var)

[Unreleased]: https://github.com/MetaMask/eslint-config/compare/v9.0.1...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.0...v11.0.2
[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.1...v10.0.0
[9.0.1]: https://github.com/MetaMask/eslint-config/compare/v9.0.0...v9.0.1

@@ -66,0 +119,0 @@ [9.0.0]: https://github.com/MetaMask/eslint-config/compare/v8.0.0...v9.0.0

67

package.json
{
"name": "@metamask/eslint-config-typescript",
"version": "9.0.1",
"version": "12.0.0",
"description": "Shareable MetaMask ESLint config for TypeScript.",
"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,20 +14,40 @@ "type": "git",

"license": "MIT",
"bugs": {
"url": "https://github.com/MetaMask/eslint-config/issues"
"main": "src/index.js",
"files": [
"src/",
"!src/**/*.test.js",
"!src/**/__test__"
],
"scripts": {
"lint:changelog": "auto-changelog validate",
"publish": "npm publish",
"test": "eslint ."
},
"homepage": "https://github.com/MetaMask/eslint-config#readme",
"devDependencies": {
"@metamask/eslint-config": "^9.0.0",
"@typescript-eslint/eslint-plugin": "^4.20.0",
"@typescript-eslint/parser": "^4.20.0",
"eslint": "^7.23.0",
"typescript": "^4.0.7"
"@metamask/auto-changelog": "^3.0.0",
"@metamask/eslint-config": "^12.0.0",
"@typescript-eslint/eslint-plugin": "^5.42.1",
"@typescript-eslint/parser": "^5.42.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",
"prettier": "^2.7.1",
"typescript": "~4.8.4"
},
"peerDependencies": {
"@metamask/eslint-config": "^9.0.0",
"@typescript-eslint/eslint-plugin": "^4.20.0",
"@typescript-eslint/parser": "^4.20.0",
"eslint": "^7.23.0",
"typescript": "^4.0.7"
"@metamask/eslint-config": "^12.0.0",
"@typescript-eslint/eslint-plugin": "^5.42.1",
"@typescript-eslint/parser": "^5.42.1",
"eslint": "^8.27.0",
"typescript": "~4.8.4"
},
"engines": {
"node": ">=14.0.0"
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
}
}
}

@@ -9,13 +9,13 @@ # `@metamask/eslint-config-typescript`

yarn add --dev \
@metamask/eslint-config@^9.0.0 \
@metamask/eslint-config-typescript@^9.0.1 \
@typescript-eslint/eslint-plugin@^4.20.0 \
@typescript-eslint/parser@^4.20.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 \
@metamask/eslint-config-typescript@^12.0.0 \
@typescript-eslint/eslint-plugin@^5.42.1 \
@typescript-eslint/parser@^5.42.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
```

@@ -45,3 +45,9 @@

],
// This is required for rules that use type information.
// See here for more information: https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/TYPED_LINTING.md
parserOptions: {
tsconfigRootDir: __dirname,
},
};
```

@@ -18,2 +18,8 @@ module.exports = {

sourceType: 'module',
// This enables support for linting rules that require type information. We
// assume that the project has a `tsconfig.json` file in the directory where
// ESLint is being run.
tsconfigRootDir: process.cwd(),
project: ['./tsconfig.json'],
},

@@ -25,2 +31,3 @@

'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:import/typescript',

@@ -39,4 +46,4 @@ ],

'@typescript-eslint/consistent-type-assertions': 'error',
'@typescript-eslint/consistent-type-definitions': 'error',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/no-explicit-any': 'off',

@@ -57,5 +64,107 @@ '@typescript-eslint/no-namespace': [

'error',
{ vars: 'all', args: 'all', argsIgnorePattern: '[_]+' },
{
vars: 'all',
args: 'all',
argsIgnorePattern: '[_]+',
ignoreRestSiblings: true,
},
],
// Recommended rules that require type information
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
// Recommended rules that we do not want to use
'@typescript-eslint/require-await': 'off',
// Our rules that require type information
'@typescript-eslint/consistent-type-exports': 'error',
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'default',
format: ['camelCase'],
leadingUnderscore: 'allow',
trailingUnderscore: 'forbid',
},
{
selector: 'enumMember',
format: ['PascalCase'],
},
{
selector: 'interface',
format: ['PascalCase'],
custom: {
regex: '^I[A-Z]',
match: false,
},
},
{
selector: 'objectLiteralMethod',
format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
},
{
selector: 'objectLiteralProperty',
format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
},
{
selector: 'typeLike',
format: ['PascalCase'],
},
{
selector: 'typeParameter',
format: ['PascalCase'],
custom: {
regex: '^.{3,}',
match: true,
},
},
{
selector: 'variable',
format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
leadingUnderscore: 'allow',
},
{
selector: 'parameter',
format: ['camelCase', 'PascalCase'],
leadingUnderscore: 'allow',
},
{
selector: [
'classProperty',
'objectLiteralProperty',
'typeProperty',
'classMethod',
'objectLiteralMethod',
'typeMethod',
'accessor',
'enumMember',
],
format: null,
modifiers: ['requiresQuotes'],
},
],
'@typescript-eslint/no-meaningless-void-operator': 'error',
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
'@typescript-eslint/no-unnecessary-qualifier': 'error',
'@typescript-eslint/no-unnecessary-type-arguments': 'error',
'@typescript-eslint/prefer-enum-initializers': 'error',
'@typescript-eslint/prefer-includes': 'error',
'@typescript-eslint/prefer-nullish-coalescing': 'error',
'@typescript-eslint/prefer-readonly': 'error',
'@typescript-eslint/prefer-reduce-type-parameter': 'error',
'@typescript-eslint/prefer-string-starts-ends-with': 'error',
'@typescript-eslint/promise-function-async': 'error',
'@typescript-eslint/restrict-template-expressions': [
'error',
{
allowBoolean: true,
allowNumber: true,
},
],
'@typescript-eslint/switch-exhaustiveness-check': 'error',
'default-param-last': 'off',

@@ -68,3 +177,3 @@ '@typescript-eslint/default-param-last': 'error',

'no-throw-literal': 'off',
// '@typescript-eslint/no-throw-literal' is left disabled because it requires type information
'@typescript-eslint/no-throw-literal': 'error',

@@ -99,3 +208,13 @@ 'no-unused-expressions': 'off',

'jsdoc/valid-types': 'off',
// Prefer hash names over TypeScript's `private` modifier.
'no-restricted-syntax': [
'error',
{
selector:
"PropertyDefinition[accessibility='private'], MethodDefinition[accessibility='private'], TSParameterProperty[accessibility='private']",
message: 'Use a hash name instead.',
},
],
},
};
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