⬅️ Back to Table of Contents
📄 no-empty-object-type.ts
📊 Analysis Summary
Metric |
Count |
🔧 Functions |
33 |
📦 Imports |
3 |
📊 Variables & Constants |
4 |
📑 Type Aliases |
4 |
📚 Table of Contents
🛠️ File Location:
📂 packages/eslint-plugin/src/rules/no-empty-object-type.ts
📦 Imports
Name |
Source |
TSESLint |
@typescript-eslint/utils |
AST_NODE_TYPES |
@typescript-eslint/utils |
createRule |
../util |
Variables & Constants
Name |
Type |
Kind |
Value |
Exported |
allowWithNameTester |
RegExp |
const |
`allowWithName |
|
? new RegExp(allowWithName, 'u') |
|
|
|
|
: undefined` |
✗ |
|
|
|
extend |
any |
const |
node.extends |
✗ |
typeParam |
any |
const |
`node.typeParameters |
|
? context.sourceCode.getText(node.typeParameters) |
|
|
|
|
: ''` |
✗ |
|
|
|
typeParam |
any |
const |
`node.typeParameters |
|
? context.sourceCode.getText(node.typeParameters) |
|
|
|
|
: ''` |
✗ |
|
|
|
Functions
noEmptyMessage(emptyType: string): string
Code
(emptyType: string): string =>
[
`${emptyType} allows any non-nullish value, including literals like \`0\` and \`""\`.`,
"- If that's what you want, disable this lint rule with an inline comment or configure the '{{ option }}' rule option.",
'- If you want a type meaning "any object", you probably want `object` instead.',
'- If you want a type meaning "any value", you probably want `unknown` instead.',
].join('\n')
- Parameters:
emptyType: string
- Return Type:
string
- Calls:
[
${emptyType} allows any non-nullish value, including literals like `0` and `""`.,
"- If that's what you want, disable this lint rule with an inline comment or configure the '{{ option }}' rule option.",
'- If you want a type meaning "any object", you probably want
objectinstead.',
'- If you want a type meaning "any value", you probably want
unknowninstead.',
].join
fix(fixer: any): TSESLint.RuleFix
Code
(fixer): TSESLint.RuleFix =>
fixer.replaceText(node, replacement)
- Parameters:
fixer: any
- Return Type:
TSESLint.RuleFix
- Calls:
fixer.replaceText
fix(fixer: any): TSESLint.RuleFix
Code
(fixer): TSESLint.RuleFix =>
fixer.replaceText(node, replacement)
- Parameters:
fixer: any
- Return Type:
TSESLint.RuleFix
- Calls:
fixer.replaceText
fix(fixer: any): TSESLint.RuleFix
Code
(fixer): TSESLint.RuleFix =>
fixer.replaceText(node, replacement)
- Parameters:
fixer: any
- Return Type:
TSESLint.RuleFix
- Calls:
fixer.replaceText
fix(fixer: any): TSESLint.RuleFix
Code
(fixer): TSESLint.RuleFix =>
fixer.replaceText(node, replacement)
- Parameters:
fixer: any
- Return Type:
TSESLint.RuleFix
- Calls:
fixer.replaceText
fix(fixer: any): TSESLint.RuleFix
Code
(fixer): TSESLint.RuleFix =>
fixer.replaceText(node, replacement)
- Parameters:
fixer: any
- Return Type:
TSESLint.RuleFix
- Calls:
fixer.replaceText
fix(fixer: any): TSESLint.RuleFix
Code
(fixer): TSESLint.RuleFix =>
fixer.replaceText(node, replacement)
- Parameters:
fixer: any
- Return Type:
TSESLint.RuleFix
- Calls:
fixer.replaceText
fix(fixer: any): TSESLint.RuleFix
Code
(fixer): TSESLint.RuleFix =>
fixer.replaceText(node, replacement)
- Parameters:
fixer: any
- Return Type:
TSESLint.RuleFix
- Calls:
fixer.replaceText
fix(fixer: any): TSESLint.RuleFix
Code
(fixer): TSESLint.RuleFix =>
fixer.replaceText(node, replacement)
- Parameters:
fixer: any
- Return Type:
TSESLint.RuleFix
- Calls:
fixer.replaceText
fix(fixer: any): TSESLint.RuleFix
Code
(fixer): TSESLint.RuleFix =>
fixer.replaceText(node, replacement)
- Parameters:
fixer: any
- Return Type:
TSESLint.RuleFix
- Calls:
fixer.replaceText
fix(fixer: any): TSESLint.RuleFix
Code
(fixer): TSESLint.RuleFix =>
fixer.replaceText(node, replacement)
- Parameters:
fixer: any
- Return Type:
TSESLint.RuleFix
- Calls:
fixer.replaceText
fix(fixer: any): TSESLint.RuleFix
Code
(fixer): TSESLint.RuleFix =>
fixer.replaceText(node, replacement)
- Parameters:
fixer: any
- Return Type:
TSESLint.RuleFix
- Calls:
fixer.replaceText
fix(fixer: any): TSESLint.RuleFix
Code
(fixer): TSESLint.RuleFix =>
fixer.replaceText(node, replacement)
- Parameters:
fixer: any
- Return Type:
TSESLint.RuleFix
- Calls:
fixer.replaceText
fix(fixer: any): TSESLint.RuleFix
Code
(fixer): TSESLint.RuleFix =>
fixer.replaceText(node, replacement)
- Parameters:
fixer: any
- Return Type:
TSESLint.RuleFix
- Calls:
fixer.replaceText
fix(fixer: any): TSESLint.RuleFix
Code
(fixer): TSESLint.RuleFix =>
fixer.replaceText(node, replacement)
- Parameters:
fixer: any
- Return Type:
TSESLint.RuleFix
- Calls:
fixer.replaceText
fix(fixer: any): TSESLint.RuleFix
Code
(fixer): TSESLint.RuleFix =>
fixer.replaceText(node, replacement)
- Parameters:
fixer: any
- Return Type:
TSESLint.RuleFix
- Calls:
fixer.replaceText
fix(fixer: any): TSESLint.RuleFix
Code
(fixer): TSESLint.RuleFix =>
fixer.replaceText(node, replacement)
- Parameters:
fixer: any
- Return Type:
TSESLint.RuleFix
- Calls:
fixer.replaceText
fix(fixer: any): TSESLint.RuleFix
Code
(fixer): TSESLint.RuleFix =>
fixer.replaceText(node, replacement)
- Parameters:
fixer: any
- Return Type:
TSESLint.RuleFix
- Calls:
fixer.replaceText
fix(fixer: any): TSESLint.RuleFix
Code
(fixer): TSESLint.RuleFix =>
fixer.replaceText(node, replacement)
- Parameters:
fixer: any
- Return Type:
TSESLint.RuleFix
- Calls:
fixer.replaceText
fix(fixer: any): TSESLint.RuleFix
Code
(fixer): TSESLint.RuleFix =>
fixer.replaceText(node, replacement)
- Parameters:
fixer: any
- Return Type:
TSESLint.RuleFix
- Calls:
fixer.replaceText
fix(fixer: any): TSESLint.RuleFix
Code
(fixer): TSESLint.RuleFix =>
fixer.replaceText(node, replacement)
- Parameters:
fixer: any
- Return Type:
TSESLint.RuleFix
- Calls:
fixer.replaceText
fix(fixer: any): TSESLint.RuleFix
Code
(fixer): TSESLint.RuleFix =>
fixer.replaceText(node, replacement)
- Parameters:
fixer: any
- Return Type:
TSESLint.RuleFix
- Calls:
fixer.replaceText
fix(fixer: any): TSESLint.RuleFix
Code
(fixer): TSESLint.RuleFix =>
fixer.replaceText(node, replacement)
- Parameters:
fixer: any
- Return Type:
TSESLint.RuleFix
- Calls:
fixer.replaceText
fix(fixer: any): TSESLint.RuleFix
Code
(fixer): TSESLint.RuleFix =>
fixer.replaceText(node, replacement)
- Parameters:
fixer: any
- Return Type:
TSESLint.RuleFix
- Calls:
fixer.replaceText
fix(fixer: any): TSESLint.RuleFix
Code
(fixer): TSESLint.RuleFix =>
fixer.replaceText(node, replacement)
- Parameters:
fixer: any
- Return Type:
TSESLint.RuleFix
- Calls:
fixer.replaceText
fix(fixer: any): TSESLint.RuleFix
Code
(fixer): TSESLint.RuleFix =>
fixer.replaceText(node, replacement)
- Parameters:
fixer: any
- Return Type:
TSESLint.RuleFix
- Calls:
fixer.replaceText
fix(fixer: any): TSESLint.RuleFix
Code
(fixer): TSESLint.RuleFix =>
fixer.replaceText(node, replacement)
- Parameters:
fixer: any
- Return Type:
TSESLint.RuleFix
- Calls:
fixer.replaceText
fix(fixer: any): TSESLint.RuleFix
Code
(fixer): TSESLint.RuleFix =>
fixer.replaceText(node, replacement)
- Parameters:
fixer: any
- Return Type:
TSESLint.RuleFix
- Calls:
fixer.replaceText
fix(fixer: any): TSESLint.RuleFix
Code
(fixer): TSESLint.RuleFix =>
fixer.replaceText(node, replacement)
- Parameters:
fixer: any
- Return Type:
TSESLint.RuleFix
- Calls:
fixer.replaceText
fix(fixer: any): TSESLint.RuleFix
Code
(fixer): TSESLint.RuleFix =>
fixer.replaceText(node, replacement)
- Parameters:
fixer: any
- Return Type:
TSESLint.RuleFix
- Calls:
fixer.replaceText
fix(fixer: any): TSESLint.RuleFix
Code
(fixer): TSESLint.RuleFix =>
fixer.replaceText(node, replacement)
- Parameters:
fixer: any
- Return Type:
TSESLint.RuleFix
- Calls:
fixer.replaceText
fix(fixer: any): TSESLint.RuleFix
Code
(fixer): TSESLint.RuleFix =>
fixer.replaceText(node, replacement)
- Parameters:
fixer: any
- Return Type:
TSESLint.RuleFix
- Calls:
fixer.replaceText
fix(fixer: any): TSESLint.RuleFix
Code
(fixer): TSESLint.RuleFix =>
fixer.replaceText(node, replacement)
- Parameters:
fixer: any
- Return Type:
TSESLint.RuleFix
- Calls:
fixer.replaceText
Type Aliases
AllowInterfaces
type AllowInterfaces = 'always' | 'never' | 'with-single-extends';
AllowObjectTypes
type AllowObjectTypes = 'always' | 'never';
Options
type Options = [
{
allowInterfaces?: AllowInterfaces;
allowObjectTypes?: AllowObjectTypes;
allowWithName?: string;
},
];
MessageIds
type MessageIds = | 'noEmptyInterface'
| 'noEmptyInterfaceWithSuper'
| 'noEmptyObject'
| 'replaceEmptyInterface'
| 'replaceEmptyInterfaceWithSuper'
| 'replaceEmptyObjectType';