|
285 | 285 | }, |
286 | 286 | "additionalProperties": false |
287 | 287 | }, |
| 288 | + "AllowKind": { |
| 289 | + "description": "Kinds of functions that can be allowed to be empty.", |
| 290 | + "oneOf": [ |
| 291 | + { |
| 292 | + "description": "Allow empty regular functions.\n\n```js\nfunction foo() {}\n```", |
| 293 | + "type": "string", |
| 294 | + "enum": [ |
| 295 | + "functions" |
| 296 | + ], |
| 297 | + "markdownDescription": "Allow empty regular functions.\n\n```js\nfunction foo() {}\n```" |
| 298 | + }, |
| 299 | + { |
| 300 | + "description": "Allow empty arrow functions.\n\n```js\nconst foo = () => {};\n```", |
| 301 | + "type": "string", |
| 302 | + "enum": [ |
| 303 | + "arrowFunctions" |
| 304 | + ], |
| 305 | + "markdownDescription": "Allow empty arrow functions.\n\n```js\nconst foo = () => {};\n```" |
| 306 | + }, |
| 307 | + { |
| 308 | + "description": "Allow empty generator functions.\n\n```js\nfunction* foo() {}\n```", |
| 309 | + "type": "string", |
| 310 | + "enum": [ |
| 311 | + "generatorFunctions" |
| 312 | + ], |
| 313 | + "markdownDescription": "Allow empty generator functions.\n\n```js\nfunction* foo() {}\n```" |
| 314 | + }, |
| 315 | + { |
| 316 | + "description": "Allow empty methods.\n\n```js\nclass Foo {\nbar() {}\n}\n```", |
| 317 | + "type": "string", |
| 318 | + "enum": [ |
| 319 | + "methods" |
| 320 | + ], |
| 321 | + "markdownDescription": "Allow empty methods.\n\n```js\nclass Foo {\nbar() {}\n}\n```" |
| 322 | + }, |
| 323 | + { |
| 324 | + "description": "Allow empty generator methods.\n\n```js\nclass Foo {\n*bar() {}\n}\n```", |
| 325 | + "type": "string", |
| 326 | + "enum": [ |
| 327 | + "generatorMethods" |
| 328 | + ], |
| 329 | + "markdownDescription": "Allow empty generator methods.\n\n```js\nclass Foo {\n*bar() {}\n}\n```" |
| 330 | + }, |
| 331 | + { |
| 332 | + "description": "Allow empty getters.\n\n```js\nclass Foo {\nget bar() {}\n}\n```", |
| 333 | + "type": "string", |
| 334 | + "enum": [ |
| 335 | + "getters" |
| 336 | + ], |
| 337 | + "markdownDescription": "Allow empty getters.\n\n```js\nclass Foo {\nget bar() {}\n}\n```" |
| 338 | + }, |
| 339 | + { |
| 340 | + "description": "Allow empty setters.\n\n```js\nclass Foo {\nset bar(value) {}\n}\n```", |
| 341 | + "type": "string", |
| 342 | + "enum": [ |
| 343 | + "setters" |
| 344 | + ], |
| 345 | + "markdownDescription": "Allow empty setters.\n\n```js\nclass Foo {\nset bar(value) {}\n}\n```" |
| 346 | + }, |
| 347 | + { |
| 348 | + "description": "Allow empty constructors.\n\n```js\nclass Foo {\nconstructor() {}\n}\n```", |
| 349 | + "type": "string", |
| 350 | + "enum": [ |
| 351 | + "constructors" |
| 352 | + ], |
| 353 | + "markdownDescription": "Allow empty constructors.\n\n```js\nclass Foo {\nconstructor() {}\n}\n```" |
| 354 | + }, |
| 355 | + { |
| 356 | + "description": "Allow empty async functions.\n\n```js\nasync function foo() {}\n```", |
| 357 | + "type": "string", |
| 358 | + "enum": [ |
| 359 | + "asyncFunctions" |
| 360 | + ], |
| 361 | + "markdownDescription": "Allow empty async functions.\n\n```js\nasync function foo() {}\n```" |
| 362 | + }, |
| 363 | + { |
| 364 | + "description": "Allow empty async methods.\n\n```js\nclass Foo {\nasync bar() {}\n}\n```", |
| 365 | + "type": "string", |
| 366 | + "enum": [ |
| 367 | + "asyncMethods" |
| 368 | + ], |
| 369 | + "markdownDescription": "Allow empty async methods.\n\n```js\nclass Foo {\nasync bar() {}\n}\n```" |
| 370 | + }, |
| 371 | + { |
| 372 | + "description": "Allow empty private constructors.\n\n```ts\nclass Foo {\nprivate constructor() {}\n}\n```", |
| 373 | + "type": "string", |
| 374 | + "enum": [ |
| 375 | + "privateConstructors" |
| 376 | + ], |
| 377 | + "markdownDescription": "Allow empty private constructors.\n\n```ts\nclass Foo {\nprivate constructor() {}\n}\n```" |
| 378 | + }, |
| 379 | + { |
| 380 | + "description": "Allow empty protected constructors.\n\n```ts\nclass Foo {\nprotected constructor() {}\n}\n```", |
| 381 | + "type": "string", |
| 382 | + "enum": [ |
| 383 | + "protectedConstructors" |
| 384 | + ], |
| 385 | + "markdownDescription": "Allow empty protected constructors.\n\n```ts\nclass Foo {\nprotected constructor() {}\n}\n```" |
| 386 | + }, |
| 387 | + { |
| 388 | + "description": "Allow empty decorated functions.\n\n```js\nclass Foo {\n@decorator()\nbar() {}\n}\n```", |
| 389 | + "type": "string", |
| 390 | + "enum": [ |
| 391 | + "decoratedFunctions" |
| 392 | + ], |
| 393 | + "markdownDescription": "Allow empty decorated functions.\n\n```js\nclass Foo {\n@decorator()\nbar() {}\n}\n```" |
| 394 | + }, |
| 395 | + { |
| 396 | + "description": "Allow empty override methods.\n\n```ts\nclass Foo extends Base {\noverride bar() {}\n}\n```", |
| 397 | + "type": "string", |
| 398 | + "enum": [ |
| 399 | + "overrideMethods" |
| 400 | + ], |
| 401 | + "markdownDescription": "Allow empty override methods.\n\n```ts\nclass Foo extends Base {\noverride bar() {}\n}\n```" |
| 402 | + } |
| 403 | + ], |
| 404 | + "markdownDescription": "Kinds of functions that can be allowed to be empty." |
| 405 | + }, |
288 | 406 | "AllowWarnDeny": { |
289 | 407 | "oneOf": [ |
290 | 408 | { |
|
2902 | 3020 | "$ref": "#/definitions/RuleNoConfig" |
2903 | 3021 | }, |
2904 | 3022 | "no-empty-function": { |
2905 | | - "$ref": "#/definitions/DummyRule" |
| 3023 | + "anyOf": [ |
| 3024 | + { |
| 3025 | + "$ref": "#/definitions/AllowWarnDeny" |
| 3026 | + }, |
| 3027 | + { |
| 3028 | + "type": "array", |
| 3029 | + "items": [ |
| 3030 | + { |
| 3031 | + "$ref": "#/definitions/AllowWarnDeny" |
| 3032 | + }, |
| 3033 | + { |
| 3034 | + "$ref": "#/definitions/NoEmptyFunctionConfig" |
| 3035 | + } |
| 3036 | + ], |
| 3037 | + "maxItems": 2, |
| 3038 | + "minItems": 1 |
| 3039 | + } |
| 3040 | + ] |
2906 | 3041 | }, |
2907 | 3042 | "no-empty-pattern": { |
2908 | 3043 | "anyOf": [ |
|
9564 | 9699 | }, |
9565 | 9700 | "additionalProperties": false |
9566 | 9701 | }, |
| 9702 | + "NoEmptyFunctionConfig": { |
| 9703 | + "type": "object", |
| 9704 | + "properties": { |
| 9705 | + "allow": { |
| 9706 | + "description": "Types of functions that are allowed to be empty.\n\nBy default, no function kinds are allowed to be empty, but this option can be used to\npermit specific kinds of functions.\n\nExample:\n```json\n{\n\"no-empty-function\": [\"error\", { \"allow\": [\"constructors\"] }]\n}\n```", |
| 9707 | + "type": "array", |
| 9708 | + "items": { |
| 9709 | + "$ref": "#/definitions/AllowKind" |
| 9710 | + }, |
| 9711 | + "markdownDescription": "Types of functions that are allowed to be empty.\n\nBy default, no function kinds are allowed to be empty, but this option can be used to\npermit specific kinds of functions.\n\nExample:\n```json\n{\n\"no-empty-function\": [\"error\", { \"allow\": [\"constructors\"] }]\n}\n```" |
| 9712 | + } |
| 9713 | + }, |
| 9714 | + "additionalProperties": false |
| 9715 | + }, |
9567 | 9716 | "NoEmptyInterface": { |
9568 | 9717 | "type": "object", |
9569 | 9718 | "properties": { |
|
0 commit comments