Socket
Socket
Sign inDemoInstall

eslint-config-xo-typescript

Package Overview
Dependencies
Maintainers
1
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-config-xo-typescript - npm Package Compare versions

Comparing version 0.44.0 to 0.45.0

242

index.js

@@ -205,4 +205,68 @@ 'use strict';

],
'@typescript-eslint/member-ordering': 'error',
'@typescript-eslint/member-ordering': [
'error',
{
'default': [
'signature',
'public-static-field',
'public-static-method',
'protected-static-field',
'protected-static-method',
'private-static-field',
'private-static-method',
'static-field',
'static-method',
'public-decorated-field',
'public-instance-field',
'public-abstract-field',
'public-field',
'protected-decorated-field',
'protected-instance-field',
'protected-abstract-field',
'protected-field',
'private-decorated-field',
'private-instance-field',
'private-abstract-field',
'private-field',
'instance-field',
'abstract-field',
'decorated-field',
'field',
'public-constructor',
'protected-constructor',
'private-constructor',
'constructor',
'public-decorated-method',
'public-instance-method',
'public-abstract-method',
'public-method',
'protected-decorated-method',
'protected-instance-method',
'protected-abstract-method',
'protected-method',
'private-decorated-method',
'private-instance-method',
'private-abstract-method',
'private-method',
'instance-method',
'abstract-method',
'decorated-method',
'method'
]
}
],
// Disabled for now as it causes too many weird TypeScript issues. I'm not sure whether the problems are caused by bugs in TS or problems in my types.

@@ -214,73 +278,75 @@ // TODO: Try to re-enable this again in 2022.

camelcase: 'off',
// TODO: Enable this again when the following is fixed:
// Known issues:
// - https://github.com/typescript-eslint/typescript-eslint/issues/1485
// - https://github.com/typescript-eslint/typescript-eslint/issues/1484
// TODO: Prevent `_` prefix on private fields when TypeScript 3.8 is out.
// '@typescript-eslint/naming-convention': [
// 'error',
// {
// selector: 'default',
// format: [
// 'strictCamelCase'
// ],
// // We allow double underscope because of GraphQL type names and some React names.
// leadingUnderscore: 'allowSingleOrDouble',
// trailingUnderscore: 'allow',
// // Ignore `{'Retry-After': retryAfter}` type properties.
// filter: {
// regex: '[- ]',
// match: false
// }
// },
// {
// selector: 'typeLike',
// format: [
// 'StrictPascalCase'
// ]
// },
// {
// selector: 'variable',
// types: [
// 'boolean'
// ],
// format: [
// 'StrictPascalCase'
// ],
// prefix: [
// 'is',
// 'has',
// 'can',
// 'should',
// 'will',
// 'did'
// ]
// },
// {
// // Interface name should not be prefixed with `I`.
// selector: 'interface',
// filter: /^(?!I)[A-Z]/.source,
// format: [
// 'StrictPascalCase'
// ]
// },
// {
// // Type parameter name should either be `T` or a descriptive name.
// selector: 'typeParameter',
// filter: /^T$|^[A-Z][a-zA-Z]+$/.source,
// format: [
// 'StrictPascalCase'
// ]
// },
// // Allow these in non-camel-case when quoted.
// {
// selector: [
// 'classProperty',
// 'objectLiteralProperty'
// ],
// format: null,
// modifiers: [
// 'requiresQuotes'
// ]
// }
// ],
'@typescript-eslint/naming-convention': [
'error',
{
// selector: 'default',
// Note: Leaving out `parameter` and `typeProperty` because of the mentioned known issues.
selector: ['variable', 'function', 'classProperty', 'objectLiteralProperty', 'parameterProperty', 'classMethod', 'objectLiteralMethod', 'typeMethod', 'accessor', 'enumMember', 'class', 'interface', 'typeAlias', 'enum', 'typeParameter'],
format: [
'strictCamelCase'
],
// We allow double underscope because of GraphQL type names and some React names.
leadingUnderscore: 'allowSingleOrDouble',
trailingUnderscore: 'allow',
// Ignore `{'Retry-After': retryAfter}` type properties.
filter: {
regex: '[- ]',
match: false
}
},
{
selector: 'typeLike',
format: [
'StrictPascalCase'
]
},
{
selector: 'variable',
types: [
'boolean'
],
format: [
'StrictPascalCase'
],
prefix: [
'is',
'has',
'can',
'should',
'will',
'did'
]
},
{
// Interface name should not be prefixed with `I`.
selector: 'interface',
filter: /^(?!I)[A-Z]/.source,
format: [
'StrictPascalCase'
]
},
{
// Type parameter name should either be `T` or a descriptive name.
selector: 'typeParameter',
filter: /^T$|^[A-Z][a-zA-Z]+$/.source,
format: [
'StrictPascalCase'
]
},
// Allow these in non-camel-case when quoted.
{
selector: [
'classProperty',
'objectLiteralProperty'
],
format: null,
modifiers: [
'requiresQuotes'
]
}
],
'@typescript-eslint/no-base-to-string': 'error',

@@ -365,2 +431,3 @@ 'no-array-constructor': 'off',

'@typescript-eslint/no-meaningless-void-operator': 'error',
'@typescript-eslint/no-misused-new': 'error',

@@ -379,2 +446,3 @@ '@typescript-eslint/no-misused-promises': [

'@typescript-eslint/no-namespace': 'error',
'@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error',
'@typescript-eslint/no-non-null-asserted-optional-chain': 'error',

@@ -388,2 +456,16 @@

'@typescript-eslint/no-redeclare': 'error',
'no-restricted-imports': 'off',
'@typescript-eslint/no-restricted-imports': [
'error',
[
'error',
'domain',
'freelist',
'smalloc',
'punycode',
'sys',
'querystring',
'colors'
]
],
'@typescript-eslint/no-require-imports': 'error',

@@ -399,4 +481,6 @@ '@typescript-eslint/no-this-alias': [

'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
'no-constant-condition': 'off', // `no-unnecessary-condition` is essentially a stricter version of `no-constant-condition`.
// `no-unnecessary-condition` is essentially a stricter version of `no-constant-condition`, but that isn't currently enabled
'no-constant-condition': 'error',
// TODO: Try to enable this again in 2023 *if* the following are resolved:

@@ -409,2 +493,3 @@ // - https://github.com/microsoft/TypeScript/issues/13778 (otherwise, it will report on if checks for elements extracted from array)

// Also related: https://github.com/typescript-eslint/typescript-eslint/issues/1798
// Also disable `no-constant-condition` when this is enabled
// '@typescript-eslint/no-unnecessary-condition': 'error',

@@ -423,3 +508,6 @@

'@typescript-eslint/no-unsafe-call': 'error',
'@typescript-eslint/no-unsafe-member-access': 'error',
// Disabled until TypeScrpt supports the `node:` protocol.
// '@typescript-eslint/no-unsafe-member-access': 'error',
'@typescript-eslint/no-unsafe-return': 'error',

@@ -447,2 +535,11 @@ 'no-unused-expressions': 'off',

],
'padding-line-between-statements': 'off',
'@typescript-eslint/padding-line-between-statements': [
'error',
{
blankLine: 'always',
prev: 'multiline-block-like',
next: '*'
}
],
'@typescript-eslint/no-var-requires': 'error',

@@ -460,3 +557,4 @@ '@typescript-eslint/non-nullable-type-assertion-style': 'error',

// Disabled until https://github.com/typescript-eslint/typescript-eslint/issues/1758 is fixed. Currently, it's too difficult to accept `Map` as a parameter.
// TODO: Try to enable this again in 2023.
// Disabled for now as it's too annoying and will cause too much churn. It also has bugs: https://github.com/typescript-eslint/typescript-eslint/search?q=%22prefer-readonly-parameter-types%22+is:issue&state=open&type=issues
// '@typescript-eslint/prefer-readonly-parameter-types': [

@@ -463,0 +561,0 @@ // 'error',

{
"name": "eslint-config-xo-typescript",
"version": "0.44.0",
"version": "0.45.0",
"description": "ESLint shareable config for TypeScript to be used with eslint-config-xo",

@@ -50,4 +50,4 @@ "license": "MIT",

"devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.28.1",
"@typescript-eslint/parser": "^4.29.0",
"@typescript-eslint/eslint-plugin": "^4.32.0",
"@typescript-eslint/parser": "^4.32.0",
"ava": "^2.4.0",

@@ -58,3 +58,3 @@ "eslint": "^7.8.1",

"peerDependencies": {
"@typescript-eslint/eslint-plugin": ">=4.29.0",
"@typescript-eslint/eslint-plugin": ">=4.32.0",
"eslint": ">=7.32.0",

@@ -61,0 +61,0 @@ "typescript": ">=4.3"

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