Skip to content

Replace tslint.json with tslint.js or tslint.yaml #12

@seanf

Description

@seanf

I don't like config formats which don't support comments, and although tslint supports comments in the configuration file tslint.json, it's not strictly JSON and so github highlights comments in all red. So I'd like to use another option.

Option 1, JavaScript: tslint.js:

module.exports = {
    "defaultSeverity": "error",
    "extends": [
        "tslint:recommended"
    ],
    "jsRules": {},
    "rules": {
        "no-any": true,
        // TODO perhaps we *should* use the 'I' prefix?
        "interface-name": [true, "never-prefix"],
        "no-unused-expression": [true, "allow-fast-null-checks"]
    },
    "rulesDirectory": []
}

Or option 2, YAML: tslint.yaml:

defaultSeverity: error
extends:
    - 'tslint:recommended'
jsRules:
rules:
    no-any: true
    # TODO perhaps we *should* use the 'I' prefix?
    interface-name: [true, never-prefix]
    no-unused-expression: [true, allow-fast-null-checks]
rulesDirectory: []

I prefer option 2, but I know YAML can be a bit of an adjustment, so let me know what you think, @BANG88 .

EDIT: yaml uses # for comments, not //

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions