Skip to content

Commit

Permalink
updateES-Lint config
Browse files Browse the repository at this point in the history
  • Loading branch information
DutchmanNL committed Oct 26, 2024
1 parent 189bb45 commit 0a9b22b
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
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 [{
ignores: ["**/.prettierrc.js", "**/.eslintrc.js"],
}, ...compat.extends("eslint:recommended"), {
plugins: {},

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

ecmaVersion: 2020,
sourceType: "commonjs",
},

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

"no-console": "off",

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

"no-var": "error",
"no-trailing-spaces": "error",
"prefer-const": "error",

quotes: ["error", "single", {
avoidEscape: true,
allowTemplateLiterals: true,
}],

semi: ["error", "always"],
},
}];

0 comments on commit 0a9b22b

Please sign in to comment.