Reviewed-on: #1 Co-authored-by: Timo Behrendt <t.behrendt@t00n.de> Co-committed-by: Timo Behrendt <t.behrendt@t00n.de>
86 lines
1.8 KiB
JavaScript
86 lines
1.8 KiB
JavaScript
import pluginJs from "@eslint/js";
|
|
import importPlugin from "eslint-plugin-import";
|
|
import prettier from "eslint-plugin-prettier";
|
|
import securityPlugin from "eslint-plugin-security";
|
|
import unicornPlugin from "eslint-plugin-unicorn";
|
|
import globals from "globals";
|
|
import tsPlugin from "typescript-eslint";
|
|
|
|
/** @type {import('eslint').Linter.Config[]} */
|
|
export default [
|
|
{
|
|
ignores: [
|
|
"node_modules/**",
|
|
"dist/**",
|
|
"build/**",
|
|
"coverage/**",
|
|
"*.min.js",
|
|
"src/gen/**", // Exclude generated API files
|
|
],
|
|
},
|
|
securityPlugin.configs.recommended,
|
|
{
|
|
files: ["src/**/*.ts"],
|
|
},
|
|
{
|
|
languageOptions: { globals: globals.node },
|
|
},
|
|
{
|
|
rules: {
|
|
"no-restricted-syntax": ["off", "ForOfStatement"],
|
|
"no-console": ["error"],
|
|
"no-duplicate-imports": "error",
|
|
"prefer-template": "error",
|
|
quotes: ["error", "double", { avoidEscape: true }],
|
|
},
|
|
},
|
|
{
|
|
plugins: {
|
|
prettier,
|
|
},
|
|
rules: {
|
|
"prettier/prettier": [
|
|
1,
|
|
{
|
|
endOfLine: "lf",
|
|
printWidth: 180,
|
|
semi: true,
|
|
singleQuote: false,
|
|
tabWidth: 2,
|
|
trailingComma: "es5",
|
|
},
|
|
],
|
|
},
|
|
},
|
|
{
|
|
plugins: {
|
|
unicorn: unicornPlugin,
|
|
},
|
|
rules: {
|
|
"unicorn/empty-brace-spaces": "off",
|
|
"unicorn/no-null": "off",
|
|
},
|
|
},
|
|
{
|
|
plugins: {
|
|
import: importPlugin,
|
|
},
|
|
rules: {
|
|
"import/order": [
|
|
"error",
|
|
{
|
|
groups: ["builtin", "external", "internal", "parent", "sibling", "index", "object", "type"],
|
|
"newlines-between": "always",
|
|
alphabetize: {
|
|
order: "asc",
|
|
caseInsensitive: true,
|
|
},
|
|
},
|
|
],
|
|
"import/no-duplicates": "error",
|
|
},
|
|
},
|
|
pluginJs.configs.recommended,
|
|
...tsPlugin.configs.recommended,
|
|
];
|