2025-03-01 10:20:55 +01:00
|
|
|
import eslint from "@eslint/js";
|
|
|
|
import tseslint from "typescript-eslint";
|
2025-04-01 08:50:43 +02:00
|
|
|
import stylistic from "@stylistic/eslint-plugin";
|
|
|
|
|
|
|
|
|
|
|
|
// Go to https://eslint.style/rules/default/${rule_without_prefix} to check the rule details
|
|
|
|
const stylisticRules = {
|
|
|
|
"@stylistic/indent": [ "error", 4 ],
|
|
|
|
"@stylistic/quotes": [ "error", "double" ],
|
|
|
|
"@stylistic/semi": [ "error", "always" ],
|
|
|
|
"@stylistic/quote-props": [ "error", "consistent-as-needed" ],
|
|
|
|
"@stylistic/max-len": [ "error", { code: 200 } ],
|
|
|
|
"@stylistic/comma-dangle": [ "error", "never" ],
|
|
|
|
"@stylistic/linebreak-style": [ "error", "unix" ],
|
|
|
|
"@stylistic/array-bracket-spacing": [ "error", "always" ],
|
|
|
|
"@stylistic/object-curly-spacing": [ "error", "always" ]
|
|
|
|
};
|
2025-03-01 10:20:55 +01:00
|
|
|
|
|
|
|
export default tseslint.config(
|
|
|
|
eslint.configs.recommended,
|
|
|
|
tseslint.configs.recommended,
|
|
|
|
// consider using rules below, once we have a full TS codebase and can be more strict
|
|
|
|
// tseslint.configs.strictTypeChecked,
|
|
|
|
// tseslint.configs.stylisticTypeChecked,
|
2025-03-03 22:18:29 +01:00
|
|
|
// tseslint.configs.recommendedTypeChecked,
|
2025-03-01 10:20:55 +01:00
|
|
|
{
|
|
|
|
languageOptions: {
|
|
|
|
parserOptions: {
|
|
|
|
projectService: true,
|
|
|
|
tsconfigRootDir: import.meta.dirname
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
2025-04-01 08:50:43 +02:00
|
|
|
plugins: {
|
|
|
|
"@stylistic": stylistic
|
|
|
|
},
|
2025-03-01 10:20:55 +01:00
|
|
|
rules: {
|
|
|
|
// add rule overrides here
|
2025-03-03 22:46:05 +01:00
|
|
|
"no-undef": "off",
|
|
|
|
"no-unused-vars": "off",
|
|
|
|
"@typescript-eslint/no-unused-vars": [
|
|
|
|
"error",
|
|
|
|
{
|
|
|
|
"argsIgnorePattern": "^_",
|
|
|
|
"varsIgnorePattern": "^_",
|
|
|
|
}
|
2025-04-01 08:50:43 +02:00
|
|
|
],
|
|
|
|
...stylisticRules
|
2025-03-01 10:20:55 +01:00
|
|
|
}
|
2025-03-01 10:40:41 +01:00
|
|
|
},
|
|
|
|
{
|
2025-03-03 22:18:29 +01:00
|
|
|
ignores: [
|
|
|
|
"build/*",
|
|
|
|
"dist/*",
|
|
|
|
"docs/*",
|
|
|
|
"libraries/*",
|
|
|
|
"src/public/app-dist/*",
|
|
|
|
"src/public/app/doc_notes/*"
|
|
|
|
]
|
2025-03-01 10:20:55 +01:00
|
|
|
}
|
|
|
|
);
|