Skip to content

Commit

Permalink
upgrade eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
ndittren committed Jul 18, 2024
1 parent b97c950 commit 1ed6d8b
Show file tree
Hide file tree
Showing 4 changed files with 360 additions and 452 deletions.
64 changes: 0 additions & 64 deletions .eslintrc.js

This file was deleted.

79 changes: 79 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import security from "eslint-plugin-security";
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,
},

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

ecmaVersion: 6,
sourceType: "script",
},

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

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

quotes: ["error", "single"],
semi: ["error", "always"],

"max-len": [2, {
code: 80,
tabWidth: 4,
ignoreUrls: true,
}],

"space-before-function-paren": ["error", "never"],
"space-in-parens": ["error", "never"],
"no-trailing-spaces": ["error"],

"key-spacing": ["error", {
beforeColon: false,
}],

"func-call-spacing": ["error", "never"],
"security/detect-buffer-noassert": 1,
"security/detect-child-process": 1,
"security/detect-disable-mustache-escape": 1,
"security/detect-eval-with-expression": 1,
"security/detect-new-buffer": 1,
"security/detect-no-csrf-before-method-override": 1,
"security/detect-non-literal-fs-filename": 1,
"security/detect-non-literal-regexp": 1,
"security/detect-non-literal-require": 0,
"security/detect-object-injection": 0,
"security/detect-possible-timing-attacks": 1,
"security/detect-pseudoRandomBytes": 1,
"security/detect-unsafe-regex": 1,
},
},
];
Loading

0 comments on commit 1ed6d8b

Please sign in to comment.