Skip to content

Commit

Permalink
upgrade eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
ndittren committed Jul 19, 2024
1 parent 2f85513 commit 1e0f425
Show file tree
Hide file tree
Showing 4 changed files with 237 additions and 231 deletions.
47 changes: 0 additions & 47 deletions .eslintrc.js

This file was deleted.

53 changes: 53 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import security from "eslint-plugin-security";
import noUnsafeInnerhtml from "eslint-plugin-no-unsafe-innerhtml";
import globals from "globals";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default [
...compat.extends("eslint:recommended", "plugin:security/recommended-legacy"),
{
plugins: {
security,
"no-unsafe-innerhtml": noUnsafeInnerhtml,
},

languageOptions: {
globals: {
...globals.browser,
...globals.amd,
...globals.jquery,
_: true,
Backbone: true,
google: true,
},

ecmaVersion: 6,
sourceType: "module",
},

rules: {
indent: ["error", 4],
"linebreak-style": ["error", "unix"],

"no-unused-vars": ["error", {
vars: "all",
args: "none",
}],

quotes: ["error", "single"],
"security/detect-object-injection": "off",
semi: ["error", "always"],
},
},
];
Loading

0 comments on commit 1e0f425

Please sign in to comment.