JaBa/eslint.config.js

64 lines
2.1 KiB
JavaScript
Raw Normal View History

2024-12-05 19:16:01 +05:00
import globals from "globals";
import pluginJs from "@eslint/js";
2025-01-12 01:02:14 +05:00
import tsParser from "@typescript-eslint/parser";
2024-12-05 19:16:01 +05:00
import stylisticJs from "@stylistic/eslint-plugin-js";
2025-01-12 01:02:14 +05:00
import tsPlugin from "@typescript-eslint/eslint-plugin";
2024-12-05 19:16:01 +05:00
/** @type {import("eslint").Linter.Config[]} */
export default [
pluginJs.configs.recommended,
{
2025-01-12 01:02:14 +05:00
files: ["**/*.ts"],
ignores: ["**/*.d.ts", "dist"],
2024-12-05 19:16:01 +05:00
languageOptions: {
globals: globals.node,
ecmaVersion: "latest",
sourceType: "module",
2025-01-12 01:02:14 +05:00
parser: tsParser,
2024-12-05 19:16:01 +05:00
},
plugins: {
2025-01-12 01:02:14 +05:00
"@typescript-eslint": tsPlugin,
2024-12-05 19:16:01 +05:00
"@stylistic/js": stylisticJs,
},
rules: {
2025-01-12 01:02:14 +05:00
"no-unused-vars": [
"error",
{
argsIgnorePattern: "^_", // Игнорировать переменные, начинающиеся с _
varsIgnorePattern: "^_", // Игнорировать переменные, начинающиеся с _
ignoreRestSiblings: true, // Игнорировать неиспользуемые параметры в деструктуризации
},
],
2024-12-05 19:16:01 +05:00
"arrow-body-style": ["error", "as-needed"],
camelcase: "error",
2024-12-05 20:15:07 +05:00
curly: ["error", "multi-line"],
2024-12-05 19:16:01 +05:00
eqeqeq: ["error", "always"],
"no-console": "off",
"no-var": "error",
"prefer-const": "error",
yoda: "error",
"@stylistic/js/arrow-spacing": ["error", { before: true, after: true }],
"@stylistic/js/comma-dangle": ["error", "always-multiline"],
"@stylistic/js/comma-spacing": ["error", { before: false, after: true }],
"@stylistic/js/comma-style": ["error", "last"],
"@stylistic/js/dot-location": ["error", "property"],
"@stylistic/js/keyword-spacing": ["error", { before: true, after: true }],
"@stylistic/js/no-multi-spaces": "error",
"@stylistic/js/no-multiple-empty-lines": [
"error",
{
max: 2,
maxEOF: 1,
maxBOF: 0,
},
],
"@stylistic/js/no-trailing-spaces": ["error"],
"@stylistic/js/object-curly-spacing": ["error", "always"],
"@stylistic/js/quotes": ["error", "double"],
"@stylistic/js/indent": ["error", "tab"],
"@stylistic/js/semi": ["error", "always"],
"@stylistic/js/space-infix-ops": "error",
},
},
];