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: deprecate multiline-comment-style & line-comment-position #18435

Merged
merged 4 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 12 additions & 14 deletions docs/src/_data/rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -633,13 +633,6 @@
"fixable": false,
"hasSuggestions": false
},
{
"name": "multiline-comment-style",
"description": "Enforce a particular style for multiline comments",
"recommended": false,
"fixable": true,
"hasSuggestions": false
},
{
"name": "new-cap",
"description": "Require constructor names to begin with a capital letter",
Expand Down Expand Up @@ -1384,13 +1377,6 @@
}
],
"layout": [
{
"name": "line-comment-position",
"description": "Enforce position of line comments",
"recommended": false,
"fixable": false,
"hasSuggestions": false
},
{
"name": "unicode-bom",
"description": "Require or disallow Unicode byte order mark (BOM)",
Expand Down Expand Up @@ -1567,6 +1553,12 @@
"fixable": true,
"hasSuggestions": false
},
{
"name": "line-comment-position",
"replacedBy": [],
"fixable": false,
"hasSuggestions": false
},
{
"name": "linebreak-style",
"replacedBy": [],
Expand Down Expand Up @@ -1605,6 +1597,12 @@
"fixable": false,
"hasSuggestions": false
},
{
"name": "multiline-comment-style",
"replacedBy": [],
"fixable": true,
"hasSuggestions": false
},
{
"name": "multiline-ternary",
"replacedBy": [],
Expand Down
4 changes: 4 additions & 0 deletions docs/src/_data/rules_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,8 @@
"fixable": "whitespace"
},
"line-comment-position": {
"deprecated": true,
"replacedBy": [],
"type": "layout",
"docs": {
"description": "Enforce position of line comments",
Expand Down Expand Up @@ -669,6 +671,8 @@
}
},
"multiline-comment-style": {
"deprecated": true,
"replacedBy": [],
"type": "suggestion",
"docs": {
"description": "Enforce a particular style for multiline comments",
Expand Down
1 change: 1 addition & 0 deletions docs/src/rules/line-comment-position.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ title: line-comment-position
rule_type: layout
---

This rule was **deprecated** in ESLint v9.3.0.
aladdin-add marked this conversation as resolved.
Show resolved Hide resolved

Line comments can be positioned above or beside code. This rule helps teams maintain a consistent style.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/rules/multiline-comment-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: multiline-comment-style
rule_type: suggestion
---


This rule was **deprecated** in ESLint v9.3.0.

Many style guides require a particular style for comments that span multiple lines. For example, some style guides prefer the use of a single block comment for multiline comments, whereas other style guides prefer consecutive line comments.

Expand Down
3 changes: 3 additions & 0 deletions lib/rules/line-comment-position.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/**
* @fileoverview Rule to enforce the position of line comments
* @author Alberto Rodríguez
* @deprecated in ESLint v9.3.0
*/
"use strict";

Expand All @@ -13,6 +14,8 @@ const astUtils = require("./utils/ast-utils");
/** @type {import('../shared/types').Rule} */
module.exports = {
meta: {
deprecated: true,
replacedBy: [],
type: "layout",

docs: {
Expand Down
4 changes: 3 additions & 1 deletion lib/rules/multiline-comment-style.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/**
* @fileoverview enforce a particular style for multiline comments
* @author Teddy Katz
* @deprecated in ESLint v9.3.0
*/
"use strict";

Expand All @@ -13,8 +14,9 @@ const astUtils = require("./utils/ast-utils");
/** @type {import('../shared/types').Rule} */
module.exports = {
meta: {
deprecated: true,
replacedBy: [],
type: "suggestion",

docs: {
description: "Enforce a particular style for multiline comments",
recommended: false,
Expand Down
2 changes: 0 additions & 2 deletions packages/js/src/configs/eslint-all.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ module.exports = Object.freeze({
"id-length": "error",
"id-match": "error",
"init-declarations": "error",
"line-comment-position": "error",
"logical-assignment-operators": "error",
"max-classes-per-file": "error",
"max-depth": "error",
Expand All @@ -53,7 +52,6 @@ module.exports = Object.freeze({
"max-nested-callbacks": "error",
"max-params": "error",
"max-statements": "error",
"multiline-comment-style": "error",
"new-cap": "error",
"no-alert": "error",
"no-array-constructor": "error",
Expand Down