EclipseFdn / eclipsefdn-github-sync

This toolset is responsible for synchronizing committers, contributors and settings across all Eclipse Foundation GitHub repositories and organizations.
Eclipse Public License 2.0
0 stars 7 forks source link

Investigate Strongloop eslint config #88

Closed autumnfound closed 4 years ago

autumnfound commented 4 years ago

In a recent patch, ESLint was added to provide better assurance of quality while building and running the script. To more quickly configure it, a configuration set was used to quickstart the linting configuration. The configuration should be more thoroughly checked to ensure that it meets our quality standards and conventions.

autumnfound commented 4 years ago

Looking into the Strongloop configuration, there is a mix of stylistic rule activations and some additional restrictions around some good practices in the node JS and ECMA.

Additionally, I've added the following rules:

Suggested final configuation:

{
    "extends": [
    "eslint:recommended",
        "strongloop"
    ],
    "env": {
        "node": true,
        "es2017": true,
        "browser": false
    },
    "parser": "babel-eslint",
    "ignorePatterns": [
        "test/*.js",
        "**/vendor/*.js"
    ],
    "rules": {
        "max-len": [1, 140, 2],
        "eqeqeq": 1,
        "complexity": [
            "error"
        ],
        "default-param-last": [
            "error"
        ],
        "no-magic-numbers": [
            "error",
            {
                "ignore": [-1, 0],
                "ignoreArrayIndexes": true
            }
        ],
        "arrow-parens": [
            "error",
            "as-needed"
        ]
    }
}