mirror of
https://github.com/zadam/trilium.git
synced 2025-12-12 10:24:23 +01:00
chore(eslint): integrate playwright e2e
This commit is contained in:
parent
21079335e7
commit
912f14549c
@ -1,15 +0,0 @@
|
|||||||
import playwright from "eslint-plugin-playwright";
|
|
||||||
import baseConfig from "../../eslint.config.mjs";
|
|
||||||
|
|
||||||
export default [
|
|
||||||
playwright.configs["flat/recommended"],
|
|
||||||
...baseConfig,
|
|
||||||
{
|
|
||||||
files: [
|
|
||||||
"**/*.ts",
|
|
||||||
"**/*.js"
|
|
||||||
],
|
|
||||||
// Override or add rules here
|
|
||||||
rules: {}
|
|
||||||
}
|
|
||||||
];
|
|
||||||
@ -4,19 +4,10 @@ import eslint from '@eslint/js';
|
|||||||
import { defineConfig, globalIgnores } from 'eslint/config';
|
import { defineConfig, globalIgnores } from 'eslint/config';
|
||||||
import tseslint from 'typescript-eslint';
|
import tseslint from 'typescript-eslint';
|
||||||
import simpleImportSort from "eslint-plugin-simple-import-sort";
|
import simpleImportSort from "eslint-plugin-simple-import-sort";
|
||||||
|
import playwright from "eslint-plugin-playwright";
|
||||||
|
import tsParser from "@typescript-eslint/parser";
|
||||||
|
|
||||||
export default defineConfig(
|
const mainConfig = defineConfig(
|
||||||
globalIgnores([
|
|
||||||
".cache",
|
|
||||||
"tmp",
|
|
||||||
"**/dist",
|
|
||||||
"**/out-tsc",
|
|
||||||
"apps/edit-docs/demo/*",
|
|
||||||
"docs/*",
|
|
||||||
"apps/web-clipper/lib/*",
|
|
||||||
// TODO: check if we want to format packages here as well - for now skipping it
|
|
||||||
"packages/*",
|
|
||||||
]),
|
|
||||||
eslint.configs.recommended,
|
eslint.configs.recommended,
|
||||||
tseslint.configs.recommended,
|
tseslint.configs.recommended,
|
||||||
// consider using rules below, once we have a full TS codebase and can be more strict
|
// consider using rules below, once we have a full TS codebase and can be more strict
|
||||||
@ -32,24 +23,53 @@ export default defineConfig(
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
plugins: {
|
|
||||||
"simple-import-sort": simpleImportSort
|
|
||||||
},
|
|
||||||
|
|
||||||
rules: {
|
rules: {
|
||||||
"no-undef": "off",
|
"no-undef": "off",
|
||||||
"no-unused-vars": "off",
|
"no-unused-vars": "off",
|
||||||
|
|
||||||
"@typescript-eslint/no-unused-vars": [
|
"@typescript-eslint/no-unused-vars": [
|
||||||
"error",
|
"error",
|
||||||
{
|
{
|
||||||
argsIgnorePattern: "^_",
|
argsIgnorePattern: "^_",
|
||||||
varsIgnorePattern: "^_"
|
varsIgnorePattern: "^_"
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
plugins: {
|
||||||
|
"simple-import-sort": simpleImportSort
|
||||||
|
},
|
||||||
|
|
||||||
|
rules: {
|
||||||
"simple-import-sort/imports": "error",
|
"simple-import-sort/imports": "error",
|
||||||
"simple-import-sort/exports": "error"
|
"simple-import-sort/exports": "error"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const playwrightConfig = {
|
||||||
|
files: [
|
||||||
|
"apps/server-e2e/src/**/*.spec.ts",
|
||||||
|
"apps/desktop/e2e/**/*.spec.ts"
|
||||||
|
],
|
||||||
|
plugins: { playwright },
|
||||||
|
// Override or add rules here
|
||||||
|
rules: { ...playwright.configs["flat/recommended"].rules, },
|
||||||
|
languageOptions: { parser: tsParser },
|
||||||
|
};
|
||||||
|
|
||||||
|
export default defineConfig(
|
||||||
|
globalIgnores([
|
||||||
|
".cache",
|
||||||
|
"tmp",
|
||||||
|
"**/dist",
|
||||||
|
"**/out-tsc",
|
||||||
|
"apps/edit-docs/demo/*",
|
||||||
|
"docs/*",
|
||||||
|
"apps/web-clipper/lib/*",
|
||||||
|
// TODO: check if we want to format packages here as well - for now skipping it
|
||||||
|
"packages/*",
|
||||||
|
]),
|
||||||
|
...mainConfig,
|
||||||
|
playwrightConfig
|
||||||
|
);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user