Skip to content

Configuration for rule "no-underscore-dangle" is invalid #290

Closed
@bouzuya

Description

@bouzuya

🐛 Bug Report

  • tslint-to-eslint-config version: 0.4.0
  • ESLint version: 6.7.2
  • Node version: 12.14.0

Actual Behavior

.eslintrc.js

module.exports = {
    ...
    "no-underscore-dangle": [
            "error",
            "off"
        ]
    ...
};
$ eslint index.ts
Error: .eslintrc.js:
        Configuration for rule "no-underscore-dangle" is invalid:
        Value "off" should be object.

Expected Behavior

module.exports = {
    ...
    "no-underscore-dangle": [
            "off"
        ]
    ...
};

Reproduction

#!/bin/bash
mkdir example
cd example/
node --version # v12.14.0
npm init -y
npm i -D \
  @typescript-eslint/parser@2.12.0 \
  @typescript-eslint/eslint-plugin@2.12.0 \
  eslint@6.7.2 \
  tslint@5.20.1 \
  typescript@3.7.3
cat <<EOS >tslint.json
{
  "rules": {
    "variable-name": [
      true,
      "check-format",
      "allow-leading-underscore"
    ]
  }
}
EOS
$(npm bin)/tsc --init
npx tslint-to-eslint-config@0.4.0

cat .eslintrc.js # generated
# module.exports = {
#     "env": {
#         "browser": true,
#         "es6": true
#     },
#     "parser": "@typescript-eslint/parser",
#     "parserOptions": {
#         "project": "tsconfig.json",
#         "sourceType": "module"
#     },
#     "plugins": [
#         "@typescript-eslint"
#     ],
#     "rules": {
#         "camelcase": "error",
#         "id-blacklist": "error",
#         "id-match": "error",
#         "no-underscore-dangle": [
#             "error",
#             "off"
#         ]
#     }
# };

# dummy source file
cat <<EOS >index.ts
function add(x: number, y: number) {
  return x + y;
}
EOS

$(npm bin)/eslint index.ts
# Error: .eslintrc.js:
#         Configuration for rule "no-underscore-dangle" is invalid:
#         Value "off" should be object.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions