Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
553 views
in Technique[技术] by (71.8m points)

tslint 或者eslint怎样覆盖配置?

{
    // "extends": "tslint:recommended"
    "rules": {
        "ordered-imports": [
            false
        ],
        "import-name": [false],
        "prefer-array-literal": [false],
        "indent": [false, "tab"]
    },
    "extends": ["tslint-config-airbnb","tslint-react"]
}

这是我的tslint的配置。但是代码里面都是1个tab的缩进。 问如何覆盖extends里面的配置呢?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

虽然是个很老的问题了,不过我最近刚好遇到,在此回答,希望对后来遇到这个问题的有帮助。
"ter-indent"就是tslint里面规定indent的。

{
    "extends": "tslint-config-standard",
    "globals": {
        "require": true
    },
    "rules": {
        "no-consecutive-blank-lines": false,
        "ter-indent": [
            true,
            4,
            {
                "SwitchCase": 1
            }
        ],
        "space-before-function-paren": [false]
    }
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...