diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index cf6b185..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1,36 +0,0 @@ -module.exports = { - 'env': { - 'es6': true, - 'node': true - }, - 'extends': [ - 'eslint:recommended' - ], - 'globals': { - 'Atomics': 'readonly', - 'SharedArrayBuffer': 'readonly' - }, - 'parserOptions': { - 'ecmaVersion': 2018, - 'sourceType': 'module' - }, - 'rules': { - 'indent': [ - 'error', - 4 - ], - 'linebreak-style': [ - 'error', - 'unix' - ], - 'quotes': [ - 'error', - 'single' - ], - 'semi': [ - 'error', - 'always' - ], - 'no-console': 'off' - } -}; diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..fbb20d9 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,23 @@ +{ + "env": { + "es6": true, + "node": true + }, + "plugins": ["json"], + "extends": ["eslint:recommended", "plugin:json/recommended"], + "globals": { + "Atomics": "readonly", + "SharedArrayBuffer": "readonly" + }, + "parserOptions": { + "ecmaVersion": 2018, + "sourceType": "module" + }, + "rules": { + "indent": ["error", 4], + "linebreak-style": ["error", "unix"], + "quotes": ["error", "single"], + "semi": ["error", "always"], + "no-console": "off" + } +} diff --git a/package.json b/package.json index cf74a53..136e69e 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,8 @@ "description": "A homebridge plugin to control my blinds", "main": "index.js", "scripts": { - "format": "prettier --write config.schema.json *.js", - "lint": "eslint *.js", + "format": "prettier --write config.schema.json .eslintrc.json *.js", + "lint": "eslint *.js *.json", "test": "echo \"Error: no test specified\" && exit" }, "keywords": [ @@ -40,6 +40,7 @@ }, "devDependencies": { "eslint": "^7.4.0", + "eslint-plugin-json": "^2.1.1", "prettier": "^2.0.5", "rimraf": "^3.0.2" }