Skip to content

Commit ca14bf2

Browse files
committed
chore: update eslint and prettier
1 parent 5eb151c commit ca14bf2

File tree

3 files changed

+491
-390
lines changed

3 files changed

+491
-390
lines changed

eslint.config.js

+33-38
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
11
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 reactRefresh from "eslint-plugin-react-refresh";
7-
import reactHooks from "eslint-plugin-react-hooks";
8-
import unicorn from "eslint-plugin-unicorn";
2+
import eslint from "@eslint/js";
3+
import tseslint from "typescript-eslint";
4+
import reactPlugin from "eslint-plugin-react";
5+
import reactRefreshPlugin from "eslint-plugin-react-refresh";
6+
import reactHooksPlugin from "eslint-plugin-react-hooks";
7+
import unicornPlugin from "eslint-plugin-unicorn";
8+
import eslintConfigPrettier from "eslint-config-prettier";
99

10-
export default [
11-
js.configs.recommended,
10+
export default tseslint.config(
11+
eslint.configs.recommended,
12+
...tseslint.configs.recommended,
13+
unicornPlugin.configs["flat/recommended"],
1214
{
13-
ignores: ["**/dist", "**/results", "**/node_modules", "css", "**/csv_export.js"],
14-
},
15-
{
16-
plugins: { unicorn },
1715
rules: {
18-
...unicorn.configs.recommended.rules,
1916
// no:
2017
"unicorn/filename-case": "off",
2118
"unicorn/no-for-loop": "off",
@@ -43,17 +40,11 @@ export default [
4340
},
4441
languageOptions: { globals: { ...globals.node } },
4542
},
46-
{
47-
files: ["**/*.{ts,tsx}"],
48-
plugins: { "@typescript-eslint": ts },
49-
languageOptions: { parser: tsParser },
50-
rules: ts.configs["recommended"].rules,
51-
},
5243
/**
5344
* Webdriver
5445
*/
5546
{
56-
files: ["webdriver-ts/**/*.ts"],
47+
files: ["webdriver-ts/**/*.{js,cjs,ts}"],
5748
languageOptions: {
5849
parserOptions: { project: ["./webdriver-ts/tsconfig.eslint.json"] },
5950
},
@@ -68,27 +59,31 @@ export default [
6859
* Web
6960
*/
7061
{
71-
files: ["webdriver-ts-results/**/*"],
72-
rules: {
73-
"@typescript-eslint/no-loss-of-precision": "off",
74-
},
75-
},
76-
{
77-
files: ["webdriver-ts-results/src/**/*.{js,ts,jsx,tsx}"],
62+
files: ["webdriver-ts-results/**/*.{js,cjs,ts,jsx,tsx}"],
7863
plugins: {
79-
react,
80-
"react-refresh": reactRefresh,
81-
"react-hooks": reactHooks,
64+
react: reactPlugin,
65+
"react-refresh": reactRefreshPlugin,
66+
"react-hooks": reactHooksPlugin,
8267
},
8368
rules: {
84-
...react.configs.recommended.rules,
85-
...react.configs["jsx-runtime"].rules,
86-
...reactHooks.configs.recommended.rules,
87-
69+
...reactPlugin.configs.flat.recommended.rules,
70+
...reactPlugin.configs.flat["jsx-runtime"].rules,
71+
...reactHooksPlugin.configs.recommended.rules,
8872
"react/jsx-no-useless-fragment": "warn",
8973
"react-refresh/only-export-components": "warn",
9074
},
91-
settings: { react: { version: "detect" } },
92-
languageOptions: { globals: { ...globals.browser } },
75+
settings: {
76+
react: {
77+
version: "18.2",
78+
},
79+
},
80+
languageOptions: {
81+
...reactPlugin.configs.flat["jsx-runtime"].languageOptions,
82+
globals: { ...globals.browser },
83+
},
84+
},
85+
{
86+
ignores: ["**/node_modules/", "**/dist/", "**/results/", "css/", "**/csv_export.js"],
9387
},
94-
];
88+
eslintConfigPrettier
89+
);

0 commit comments

Comments
 (0)