79 lines
1.5 KiB
JavaScript
79 lines
1.5 KiB
JavaScript
const {defineConfig, globalIgnores} = require("eslint/config");
|
|
|
|
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,
|
|
});
|
|
const OFF = 0;
|
|
const ERROR = 2;
|
|
|
|
module.exports = defineConfig([
|
|
{
|
|
extends: compat.extends("eslint:recommended"),
|
|
|
|
languageOptions: {
|
|
ecmaVersion: 2020,
|
|
parserOptions: {},
|
|
|
|
globals: {
|
|
...globals.node,
|
|
hf: true,
|
|
},
|
|
},
|
|
|
|
rules: {
|
|
indent: OFF,
|
|
semi: ERROR,
|
|
|
|
quotes: [
|
|
ERROR,
|
|
"double",
|
|
{
|
|
avoidEscape: true,
|
|
allowTemplateLiterals: true,
|
|
},
|
|
],
|
|
|
|
"no-empty": ERROR,
|
|
"array-callback-return": ERROR,
|
|
"consistent-return": ERROR,
|
|
eqeqeq: OFF,
|
|
"prefer-const": ERROR,
|
|
"no-useless-assignment": OFF,
|
|
|
|
"no-unused-vars": [
|
|
ERROR,
|
|
{
|
|
args: "none",
|
|
varsIgnorePattern: "^_",
|
|
},
|
|
],
|
|
|
|
"no-console": OFF,
|
|
"no-debugger": OFF,
|
|
"require-atomic-updates": OFF,
|
|
},
|
|
},
|
|
globalIgnores([
|
|
"**/pnpm-debug.log",
|
|
"**/dist",
|
|
"**/.cache",
|
|
"**/.tern-port",
|
|
"**/config.json",
|
|
"**/package-lock.json",
|
|
"**/README.html",
|
|
"**/*~",
|
|
"**/\\#*\\#",
|
|
"**/node_modules",
|
|
"**/yarn-error.log",
|
|
"**/npm-error.log",
|
|
".vscode",
|
|
".idea",
|
|
]),
|
|
]);
|