sylvainpolletvillard / ObjectModel

Strong Dynamically Typed Object Modeling for JavaScript
http://objectmodel.js.org
MIT License
467 stars 30 forks source link

Multiple eslint errors with salesforce's LWC eslint config #181

Open thesunlover opened 3 weeks ago

thesunlover commented 3 weeks ago

There are multiple 'for-in's that trigger eslint errors for the built version of the library: 119:4 error The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype guard-for-in 162:4 error The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype guard-for-in replacing Object.keys(def).forEach(()=>{}) is going to iterate only on the actual properties on the 'def' object.

https://github.com/sylvainpolletvillard/ObjectModel/blob/e7f7a15d1d2f3c527364ee40b4c0b2815fb9b81c/src/object-model.js#L79

I have tried setting my eslint config simliar to the author's, but I still get the same errors


{
  "extends": [
    "eslint:recommended",
    "@salesforce/eslint-config-lwc/recommended",
    "@locker/eslint-config-locker"
  ],
    "env": {
        "browser": true,
        "node": true,
        "es6": true
    },
    "parserOptions": {
        "ecmaVersion": 2018,
        "sourceType": "module"
    },
    "rules": {
        "no-mixed-spaces-and-tabs": [
            "error",
            "smart-tabs"
        ],
        "no-console": "off"
    }
}