Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(rules)!: no use of deprecated rules #1572

Merged
merged 1 commit into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ Read about the `project` option [here](https://github.com/typescript-eslint/type

There are [some more `parserOptions`](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/README.md#configuration) you may care about.

# No formatting rules

This config does provide formatting related rules.
Please use a formatter, instead.

# Example command line usage:

```
Expand Down
112 changes: 3 additions & 109 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,7 @@ const rules = {
}
}
}],
'@typescript-eslint/block-spacing': ['error', 'always'],
'@typescript-eslint/brace-style': ['error', '1tbs', { allowSingleLine: true }],
'@typescript-eslint/class-literal-property-style': ['error', 'fields'],
'@typescript-eslint/comma-dangle': ['error', {
arrays: 'never',
objects: 'never',
imports: 'never',
exports: 'never',
functions: 'never',
enums: 'ignore',
generics: 'ignore',
tuples: 'ignore'
}],
'@typescript-eslint/comma-spacing': ['error', { before: false, after: true }],
'@typescript-eslint/consistent-generic-constructors': ['error', 'constructor'],
'@typescript-eslint/consistent-indexed-object-style': ['error', 'record'],
'@typescript-eslint/consistent-type-assertions': [
Expand Down Expand Up @@ -111,51 +98,6 @@ const rules = {
allowTypedFunctionExpressions: true,
allowDirectConstAssertionInArrowFunctions: true
}],
'@typescript-eslint/func-call-spacing': ['error', 'never'],
'@typescript-eslint/indent': ['error', 2, {
SwitchCase: 1,
VariableDeclarator: 1,
outerIIFEBody: 1,
MemberExpression: 1,
FunctionDeclaration: { parameters: 1, body: 1 },
FunctionExpression: { parameters: 1, body: 1 },
CallExpression: { arguments: 1 },
ArrayExpression: 1,
ObjectExpression: 1,
ImportDeclaration: 1,
flatTernaryExpressions: false,
ignoreComments: false,
ignoredNodes: [
'TemplateLiteral *',
'JSXElement',
'JSXElement > *',
'JSXAttribute',
'JSXIdentifier',
'JSXNamespacedName',
'JSXMemberExpression',
'JSXSpreadAttribute',
'JSXExpressionContainer',
'JSXOpeningElement',
'JSXClosingElement',
'JSXFragment',
'JSXOpeningFragment',
'JSXClosingFragment',
'JSXText',
'JSXEmptyExpression',
'JSXSpreadChild'
],
offsetTernaryExpressions: true
}],
'@typescript-eslint/key-spacing': ['error', { beforeColon: false, afterColon: true }],
'@typescript-eslint/keyword-spacing': ['error', { before: true, after: true }],
'@typescript-eslint/lines-between-class-members': ['error', 'always', { exceptAfterOverload: true, exceptAfterSingleLine: true }],
'@typescript-eslint/member-delimiter-style': [
'error',
{
multiline: { delimiter: 'none' },
singleline: { delimiter: 'comma', requireLast: false }
}
],
'@typescript-eslint/method-signature-style': ['error'],
'@typescript-eslint/naming-convention': ['error', {
selector: 'variableLike',
Expand All @@ -170,7 +112,6 @@ const rules = {
'@typescript-eslint/no-dynamic-delete': ['error'],
'@typescript-eslint/no-empty-interface': ['error', { allowSingleExtends: true }],
'@typescript-eslint/no-extra-non-null-assertion': ['error'],
'@typescript-eslint/no-extra-parens': ['error', 'functions'],
'@typescript-eslint/no-extraneous-class': ['error', { allowWithDecorator: true }],
'@typescript-eslint/no-floating-promises': ['error'],
'@typescript-eslint/no-for-in-array': ['error'],
Expand All @@ -184,7 +125,6 @@ const rules = {
'@typescript-eslint/no-non-null-assertion': ['error'],
'@typescript-eslint/no-redeclare': ['error', { builtinGlobals: false }],
'@typescript-eslint/no-this-alias': ['error', { allowDestructuring: true }],
'@typescript-eslint/no-throw-literal': ['error'],
'@typescript-eslint/no-unnecessary-boolean-literal-compare': ['error'],
'@typescript-eslint/no-unnecessary-type-assertion': ['error'],
'@typescript-eslint/no-unnecessary-type-constraint': ['error'],
Expand All @@ -211,7 +151,7 @@ const rules = {
'@typescript-eslint/no-useless-constructor': ['error'],
'@typescript-eslint/no-var-requires': ['error'],
'@typescript-eslint/non-nullable-type-assertion-style': ['error'],
'@typescript-eslint/object-curly-spacing': ['error', 'always'],
'@typescript-eslint/only-throw-error': ['error', { allowThrowingAny: false, allowThrowingUnknown: false }],
'@typescript-eslint/prefer-function-type': ['error'],
'@typescript-eslint/prefer-includes': ['error'],
'@typescript-eslint/prefer-nullish-coalescing': ['error', { ignoreConditionalTests: false, ignoreMixedLogicalExpressions: false }],
Expand All @@ -222,15 +162,10 @@ const rules = {
'@typescript-eslint/prefer-return-this-type': ['error'],
'@typescript-eslint/prefer-ts-expect-error': ['error'],
'@typescript-eslint/promise-function-async': ['error'],
'@typescript-eslint/quotes': ['error', 'single', { avoidEscape: true, allowTemplateLiterals: false }],
'@typescript-eslint/require-array-sort-compare': ['error', { ignoreStringArrays: true }],
'@typescript-eslint/restrict-plus-operands': ['error', { skipCompoundAssignments: false }],
'@typescript-eslint/restrict-template-expressions': ['error', { allowNumber: true }],
'@typescript-eslint/return-await': ['error', 'always'],
'@typescript-eslint/semi': ['error', 'never'],
'@typescript-eslint/space-before-blocks': ['error', 'always'],
'@typescript-eslint/space-before-function-paren': ['error', 'always'],
'@typescript-eslint/space-infix-ops': ['error'],
'@typescript-eslint/strict-boolean-expressions': ['error', {
allowString: false,
allowNumber: false,
Expand All @@ -241,29 +176,19 @@ const rules = {
allowAny: false
}],
'@typescript-eslint/triple-slash-reference': ['error', { lib: 'never', path: 'never', types: 'never' }],
'@typescript-eslint/type-annotation-spacing': ['error'],
'@typescript-eslint/unbound-method': ['error', { ignoreStatic: false }],

'accessor-pairs': ['error', { setWithoutGet: true, getWithoutSet: false, enforceForClassMembers: true }],
'array-bracket-spacing': ['error', 'never'],
'array-callback-return': ['error', {
allowImplicit: false,
allowVoid: false,
checkForEach: false
}],
'arrow-spacing': ['error', { before: true, after: true }],
'comma-style': ['error', 'last'],
'computed-property-spacing': ['error', 'never', { enforceForClassMembers: true }],
'constructor-super': ['error'],
curly: ['error', 'multi-line'],
'default-case-last': ['error'],
'dot-location': ['error', 'property'],
'eol-last': ['error'],
eqeqeq: ['error', 'always', { null: 'ignore' }],
'generator-star-spacing': ['error', { before: true, after: true }],
'multiline-ternary': ['error', 'always-multiline'],
'new-cap': ['error', { newIsCap: true, capIsNew: false, properties: true }],
'new-parens': ['error'],
'no-async-promise-executor': ['error'],
'no-caller': ['error'],
'no-case-declarations': ['error'],
Expand All @@ -288,7 +213,6 @@ const rules = {
'no-extra-bind': ['error'],
'no-extra-boolean-cast': ['error'],
'no-fallthrough': ['error'],
'no-floating-decimal': ['error'],
'no-func-assign': ['error'],
'no-global-assign': ['error'],
'no-import-assign': ['error'],
Expand All @@ -300,24 +224,13 @@ const rules = {
'no-misleading-character-class': ['error'],
'no-prototype-builtins': ['error'],
'no-useless-catch': ['error'],
'no-mixed-operators': ['error', {
groups: [
['==', '!=', '===', '!==', '>', '>=', '<', '<='],
['&&', '||'],
['in', 'instanceof']
],
allowSamePrecedence: true
}],
'no-mixed-spaces-and-tabs': ['error'],
'no-multi-spaces': ['error'],
'no-multi-str': ['error'],
'no-multiple-empty-lines': ['error', { max: 1, maxBOF: 0, maxEOF: 0 }],
'no-new': ['error'],
'no-new-func': ['error'],
'no-new-object': ['error'],
'no-new-symbol': ['error'],
'no-new-wrappers': ['error'],
'no-obj-calls': ['error'],
'no-object-constructor': ['error'],
'no-octal': ['error'],
'no-octal-escape': ['error'],
'no-proto': ['error'],
Expand All @@ -328,10 +241,9 @@ const rules = {
'no-sequences': ['error'],
'no-shadow-restricted-names': ['error'],
'no-sparse-arrays': ['error'],
'no-tabs': ['error'],
'no-template-curly-in-string': ['error'],
'no-this-before-super': ['error'],
'no-trailing-spaces': ['error'],
'no-throw-literal': ['off'],
'no-undef-init': ['error'],
'no-unexpected-multiline': ['error'],
'no-unmodified-loop-condition': ['error'],
Expand All @@ -347,36 +259,18 @@ const rules = {
'no-useless-return': ['error'],
'no-var': ['warn'],
'no-void': ['error', { allowAsStatement: true }],
'no-whitespace-before-property': ['error'],
'no-with': ['error'],
'object-curly-newline': ['error', { multiline: true, consistent: true }],
'object-property-newline': ['error', { allowMultiplePropertiesPerLine: true, allowAllPropertiesOnSameLine: false }],
'object-shorthand': ['warn', 'properties'],
'one-var': ['error', { initialized: 'never' }],
'operator-linebreak': ['error', 'after', { overrides: { '?': 'before', ':': 'before', '|>': 'before' } }],
'padded-blocks': ['error', { blocks: 'never', switches: 'never', classes: 'never' }],
'prefer-const': ['error', { destructuring: 'all', ignoreReadBeforeAssign: false }],
'prefer-regex-literals': ['error', { disallowRedundantWrapping: true }],
'quote-props': ['error', 'as-needed'],
'rest-spread-spacing': ['error', 'never'],
'semi-spacing': ['error', { before: false, after: true }],
'space-in-parens': ['error', 'never'],
'space-unary-ops': ['error', { words: true, nonwords: false }],
'spaced-comment': ['error', 'always', {
line: { markers: ['*package', '!', '/', ',', '='] },
block: { balanced: true, markers: ['*package', '!', ',', ':', '::', 'flow-include'], exceptions: ['*'] }
}],
'symbol-description': ['error'],
'template-curly-spacing': ['error', 'never'],
'template-tag-spacing': ['error', 'never'],
'unicode-bom': ['error', 'never'],
'use-isnan': ['error', {
enforceForSwitchCase: true,
enforceForIndexOf: true
}],
'valid-typeof': ['error', { requireStringLiterals: true }],
'wrap-iife': ['error', 'any', { functionPrototypeMethods: true }],
'yield-star-spacing': ['error', 'both'],
yoda: ['error', 'never'],

'import/export': ['error'],
Expand Down
Loading