-
Couldn't load subscription status.
- Fork 100
Closed
Labels
good first issueGood for newcomers; welcome aboard!Good for newcomers; welcome aboard!status: accepting prsPlease, send in a PR to resolve this! ✨Please, send in a PR to resolve this! ✨type: bugSomething isn't workingSomething isn't working
Description
🐛 Bug Report
tslint-to-eslint-configversion: 0.4.0- ESLint version: 6.7.2
- Node version: 12.14.0
It was not fixed in #273 .
Actual Behavior
tslint.json
{
"rules": {
"space-before-function-paren": [
true,
{
"anonymous": "never",
"asyncArrow": "always",
"constructor": "never",
"method": "never",
"named": "never"
}
]
}
}
.eslintrc.js
module.exports = {
...
"rules": {
"space-before-function-paren": [
"error",
{
"anonymous": "never",
"asyncArrow": "always",
"constructor": "never",
"method": "never",
"named": "never"
}
...
};
eslint index.ts
Error: .eslintrc.js:
Configuration for rule "space-before-function-paren" is invalid:
Value {"anonymous":"never","asyncArrow":"always","constructor":"never","method":"never","named":"never"} should be equal to one of the allowed values.
Value {"anonymous":"never","asyncArrow":"always","constructor":"never","method":"never","named":"never"} should NOT have additional properties.
Value {"anonymous":"never","asyncArrow":"always","constructor":"never","method":"never","named":"never"} should match exactly one schema in oneOf.
Expected Behavior
module.exports = {
...
"rules": {
"space-before-function-paren": [
"error",
{
"anonymous": "never",
"asyncArrow": "always",
"named": "never"
}
...
};
Reproduction
#!/bin/bash -x
mkdir example
cd example/
node --version # v12.14.0
npm init -y
npm i -D \
@typescript-eslint/[email protected] \
@typescript-eslint/[email protected] \
[email protected] \
[email protected] \
[email protected]
cat <<EOS >tslint.json
{
"rules": {
"space-before-function-paren": [
true,
{
"anonymous": "never",
"asyncArrow": "always",
"constructor": "never",
"method": "never",
"named": "never"
}
]
}
}
EOS
$(npm bin)/tsc --init
npx [email protected]
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": {
# "space-before-function-paren": [
# "error",
# {
# "anonymous": "never",
# "asyncArrow": "always",
# "constructor": "never",
# "method": "never",
# "named": "never"
# }
# ]
# }
# };
# dummy source file
echo 'function add(x: number, y: number) { return x + y; }' > index.ts
$(npm bin)/eslint index.ts
# Error: .eslintrc.js:
# Configuration for rule "space-before-function-paren" is invalid:
# Value {"anonymous":"never","asyncArrow":"always","constructor":"never","method":"never","named":"never"} should be equal to one of the allowed values.
# Value {"anonymous":"never","asyncArrow":"always","constructor":"never","method":"never","named":"never"} should NOT have additional properties.
# Value {"anonymous":"never","asyncArrow":"always","constructor":"never","method":"never","named":"never"} should match exactly one schema in oneOf.
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomers; welcome aboard!Good for newcomers; welcome aboard!status: accepting prsPlease, send in a PR to resolve this! ✨Please, send in a PR to resolve this! ✨type: bugSomething isn't workingSomething isn't working