Skip to content

Commit

Permalink
eslint: Upgrade to 9.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan committed Nov 2, 2024
1 parent f10cfa0 commit 8138f97
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 54 deletions.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

50 changes: 0 additions & 50 deletions .eslintrc.json

This file was deleted.

61 changes: 61 additions & 0 deletions eslint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
const react = require("eslint-plugin-react");
const globals = require("globals");
const js = require("@eslint/js");

const {
FlatCompat,
} = require("@eslint/eslintrc");

const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

module.exports = [{
ignores: ["**/.eslintrc.js", "admin/words.js"],
}, ...compat.extends("eslint:recommended", "plugin:react/recommended"), {
plugins: {
react,
},

languageOptions: {
globals: {
...globals.node,
...globals.mocha,
},

ecmaVersion: 2020,
sourceType: "commonjs",

parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},

settings: {
react: {
version: "detect",
},
},

rules: {
indent: ["error", 4, {
SwitchCase: 1,
}],

"no-console": "off",

"no-unused-vars": ["error", {
ignoreRestSiblings: true,
argsIgnorePattern: "^_",
}],

"no-var": "error",
"no-trailing-spaces": "error",
"prefer-const": "error",
semi: ["error", "always"],
},
}];
2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ class Signifylights extends utils.Adapter {
this.timeoutList = {};

callback();
} catch (e) {
} catch {
callback();
}
}
Expand Down
4 changes: 4 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
"@alcalzone/release-script-plugin-iobroker": "^3.7.2",
"@alcalzone/release-script-plugin-license": "^3.7.0",
"@alcalzone/release-script-plugin-manual-review": "^3.5.9",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.14.0",
"@iobroker/adapter-dev": "^1.2.0",
"@iobroker/adapter-react": "^2.2.4",
"@iobroker/testing": "^4.1.3",
Expand Down Expand Up @@ -78,7 +80,7 @@
"test:integration": "mocha test/integration --exit",
"test": "npm run test:js && npm run test:package",
"check": "tsc --noEmit -p tsconfig.check.json",
"lint": "eslint --ext .js,.jsx .",
"lint": "eslint",
"translate": "translate-adapter",
"release": "release-script"
},
Expand Down

0 comments on commit 8138f97

Please sign in to comment.