or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

active-rules.mddeprecated-rules.mdindex.mdplugin-configuration.mdrule-configuration.md
tile.json

deprecated-rules.mddocs/

Deprecated Rules

Seven rules that are deprecated and should no longer be used. These rules show deprecation warnings when used and redirect users to newer ESLint versions or alternative plugins that provide the same functionality.

Capabilities

array-bracket-spacing (Deprecated)

Use built-in array-bracket-spacing rule instead.

/**
 * Deprecated array-bracket-spacing rule
 * Shows deprecation warning when used
 * @type {Object}
 */
'array-bracket-spacing': {
  meta: {
    deprecated: true,
    schema: [{
      enum: ["always", "never"]
    }, {
      type: "object",
      properties: {
        singleValue: { type: "boolean" },
        objectsInArrays: { type: "boolean" },
        arraysInArrays: { type: "boolean" }
      },
      additionalProperties: false
    }]
  },
  create: Function // Shows deprecation warning
}

Deprecation: Use built-in array-bracket-spacing rule since ESLint v3.9.0.

Migration:

{
  "rules": {
    "babel/array-bracket-spacing": 0,
    "array-bracket-spacing": [2, "never"]
  }
}

arrow-parens (Deprecated)

Use built-in arrow-parens rule instead.

/**
 * Deprecated arrow-parens rule
 * @type {Function}
 */
'arrow-parens': deprecatedRuleWrapper

Deprecation: Use built-in arrow-parens rule since ESLint v3.10.0.

Migration:

{
  "rules": {
    "babel/arrow-parens": 0,
    "arrow-parens": [2, "as-needed"]
  }
}

flow-object-type (Deprecated)

Use flowtype/object-type-delimiter from eslint-plugin-flowtype instead.

/**
 * Deprecated flow-object-type rule
 * @type {Function}
 */
'flow-object-type': deprecatedRuleWrapper

Deprecation: Use flowtype/object-type-delimiter from eslint-plugin-flowtype since v2.23.0.

Migration:

{
  "plugins": ["flowtype"],
  "rules": {
    "babel/flow-object-type": 0,
    "flowtype/object-type-delimiter": [2, "comma"]
  }
}

func-params-comma-dangle (Deprecated)

Use built-in comma-dangle rule instead.

/**
 * Deprecated func-params-comma-dangle rule
 * @type {Function}
 */
'func-params-comma-dangle': deprecatedRuleWrapper

Deprecation: Use built-in comma-dangle rule since ESLint v3.8.0.

Migration:

{
  "rules": {
    "babel/func-params-comma-dangle": 0,
    "comma-dangle": [2, "always-multiline"]
  }
}

generator-star-spacing (Deprecated)

Use built-in generator-star-spacing rule instead.

/**
 * Deprecated generator-star-spacing rule
 * @type {Function}
 */
'generator-star-spacing': deprecatedRuleWrapper

Deprecation: Use built-in generator-star-spacing rule since ESLint v3.6.0.

Migration:

{
  "rules": {
    "babel/generator-star-spacing": 0,
    "generator-star-spacing": [2, {"before": false, "after": true}]
  }
}

object-shorthand (Deprecated)

Use built-in object-shorthand rule instead.

/**
 * Deprecated object-shorthand rule
 * @type {Function}
 */
'object-shorthand': deprecatedRuleWrapper

Deprecation: Use built-in object-shorthand rule since ESLint v0.20.0.

Migration:

{
  "rules": {
    "babel/object-shorthand": 0,
    "object-shorthand": [2, "always"]
  }
}

no-await-in-loop (Deprecated)

Use built-in no-await-in-loop rule instead.

/**
 * Deprecated no-await-in-loop rule
 * @type {Function}
 */
'no-await-in-loop': deprecatedRuleWrapper

Deprecation: Use built-in no-await-in-loop rule since ESLint v3.12.0.

Migration:

{
  "rules": {
    "babel/no-await-in-loop": 0,
    "no-await-in-loop": 2
  }
}

Deprecation Warning Pattern

All deprecated rules follow this pattern:

/**
 * Standard deprecation warning pattern
 * @param {string} ruleName - Name of the deprecated rule
 * @param {string} replacement - Recommended replacement
 * @returns {Object} Rule object that shows warning
 */
function createDeprecatedRule(ruleName, replacement) {
  var isWarnedForDeprecation = false;
  return {
    meta: { deprecated: true },
    create: function() {
      return {
        Program: function() {
          if (!isWarnedForDeprecation) {
            console.log(`The babel/${ruleName} rule is deprecated. Please use ${replacement} instead.`);
            isWarnedForDeprecation = true;
          }
        }
      };
    }
  };
}

Migration Guide

To migrate from deprecated rules:

  1. Remove deprecated babel rules from your ESLint configuration
  2. Add the recommended replacement rules with appropriate configurations
  3. Install additional plugins if needed (e.g., eslint-plugin-flowtype)
  4. Test your configuration to ensure the replacements work as expected

Example Migration:

// Before (using deprecated rules)
{
  "plugins": ["babel"],
  "rules": {
    "babel/array-bracket-spacing": [2, "never"],
    "babel/arrow-parens": [2, "as-needed"],
    "babel/comma-dangle": [2, "always"],
    "babel/generator-star-spacing": [2, {"before": false, "after": true}],
    "babel/object-shorthand": [2, "always"],
    "babel/no-await-in-loop": 2
  }
}

// After (using modern alternatives)
{
  "plugins": ["babel"],
  "rules": {
    "array-bracket-spacing": [2, "never"],
    "arrow-parens": [2, "as-needed"], 
    "comma-dangle": [2, "always"],
    "generator-star-spacing": [2, {"before": false, "after": true}],
    "object-shorthand": [2, "always"],
    "no-await-in-loop": 2
  }
}