|
| 1 | +import globals from "globals"; |
| 2 | +import js from "@eslint/js"; |
| 3 | +import ts from "@typescript-eslint/eslint-plugin"; |
| 4 | +import tsParser from "@typescript-eslint/parser"; |
| 5 | +import react from "eslint-plugin-react"; |
| 6 | +import reactHooks from "eslint-plugin-react-hooks"; |
| 7 | + |
| 8 | +export default [ |
| 9 | + js.configs.recommended, |
| 10 | + { |
| 11 | + ignores: [ |
| 12 | + "**/dist", |
| 13 | + "**/results", |
| 14 | + "**/node_modules", |
| 15 | + "css", |
| 16 | + "**/csv_export.js", |
| 17 | + ], |
| 18 | + }, |
| 19 | + { |
| 20 | + files: ["**/*.{ts,tsx}"], |
| 21 | + plugins: { "@typescript-eslint": ts }, |
| 22 | + languageOptions: { parser: tsParser }, |
| 23 | + rules: ts.configs["recommended"].rules, |
| 24 | + }, |
| 25 | + /** |
| 26 | + * Root |
| 27 | + */ |
| 28 | + { |
| 29 | + files: ["*.js", "utils/**/*", "cli/**/*.js"], |
| 30 | + languageOptions: { globals: { ...globals.node } }, |
| 31 | + }, |
| 32 | + /** |
| 33 | + * Server |
| 34 | + */ |
| 35 | + { |
| 36 | + files: ["server/**/*"], |
| 37 | + languageOptions: { globals: { ...globals.node } }, |
| 38 | + }, |
| 39 | + /** |
| 40 | + * Webdriver |
| 41 | + */ |
| 42 | + { |
| 43 | + files: ["webdriver-ts/**/*.ts"], |
| 44 | + languageOptions: { |
| 45 | + parserOptions: { project: ["./webdriver-ts/tsconfig.eslint.json"] }, |
| 46 | + globals: { ...globals.node }, |
| 47 | + }, |
| 48 | + rules: { |
| 49 | + "no-unused-vars": "off", |
| 50 | + "@typescript-eslint/no-explicit-any": "off", |
| 51 | + "@typescript-eslint/no-unused-vars": "off", |
| 52 | + "require-await": "error", |
| 53 | + "@typescript-eslint/no-floating-promises": "error", |
| 54 | + }, |
| 55 | + }, |
| 56 | + /** |
| 57 | + * Web |
| 58 | + */ |
| 59 | + { |
| 60 | + files: ["webdriver-ts-results/**/*.tsx"], |
| 61 | + plugins: { |
| 62 | + react, |
| 63 | + "react-hooks": reactHooks, |
| 64 | + }, |
| 65 | + rules: { |
| 66 | + ...react.configs.recommended.rules, |
| 67 | + ...reactHooks.configs.recommended.rules, |
| 68 | + }, |
| 69 | + settings: { react: { version: "detect" } }, |
| 70 | + languageOptions: { globals: { ...globals.browser } }, |
| 71 | + }, |
| 72 | + { |
| 73 | + files: ["webdriver-ts-results/**/*"], |
| 74 | + languageOptions: { globals: { ...globals.browser, ...globals.node } }, |
| 75 | + rules: { |
| 76 | + "@typescript-eslint/no-loss-of-precision": "off", |
| 77 | + }, |
| 78 | + }, |
| 79 | +]; |
0 commit comments