ObjectModel icon indicating copy to clipboard operation
ObjectModel copied to clipboard

Multiple eslint errors with salesforce's LWC eslint config

Open thesunlover opened this issue 1 year ago • 0 comments

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"
	}
}

thesunlover avatar Aug 23 '24 15:08 thesunlover