Skip to content

Commit e1e626d

Browse files
feat: Upgrade lint libraries and dependencies (#59)
* feat: Upgrade lint libraries and dependencies I've upgraded all lint-related libraries and their dependencies to their latest versions. I also migrated the ESLint configuration to the new eslint.config.mjs format. Then, I fixed all linting issues after the upgrades. Finally, I verified that all packages are up to date using `npm outdated`. * Review feedback * Review feedback --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
1 parent cf9f3df commit e1e626d

File tree

6 files changed

+554
-558
lines changed

6 files changed

+554
-558
lines changed

.eslintrc

Lines changed: 0 additions & 56 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
import { defineConfig } from "eslint/config";
2+
import { fixupConfigRules, fixupPluginRules } from "@eslint/compat";
3+
import prettier from "eslint-plugin-prettier";
4+
import _import from "eslint-plugin-import";
5+
import globals from "globals";
6+
import tsParser from "@typescript-eslint/parser";
7+
import path from "node:path";
8+
import { fileURLToPath } from "node:url";
9+
import js from "@eslint/js";
10+
import { FlatCompat } from "@eslint/eslintrc";
11+
12+
const FILE_NAME = fileURLToPath(import.meta.url);
13+
const DIRECTORY_NAME = path.dirname(FILE_NAME);
14+
const compat = new FlatCompat({
15+
baseDirectory: DIRECTORY_NAME,
16+
recommendedConfig: js.configs.recommended,
17+
allConfig: js.configs.all
18+
});
19+
20+
export default defineConfig([{
21+
extends: fixupConfigRules(compat.extends(
22+
"plugin:react/recommended",
23+
"plugin:react-hooks/recommended",
24+
"plugin:@typescript-eslint/recommended",
25+
"plugin:prettier/recommended",
26+
)),
27+
plugins: {
28+
prettier: fixupPluginRules(prettier),
29+
import: fixupPluginRules(_import),
30+
},
31+
languageOptions: {
32+
globals: {
33+
...globals.browser,
34+
...globals.node,
35+
React: "writable",
36+
},
37+
parser: tsParser,
38+
ecmaVersion: 5,
39+
sourceType: "commonjs",
40+
parserOptions: {
41+
jsx: true,
42+
useJSXTextNode: true,
43+
},
44+
},
45+
settings: {
46+
react: {
47+
version: "detect",
48+
},
49+
},
50+
rules: {
51+
"react-hooks/rules-of-hooks": "error",
52+
"react-hooks/exhaustive-deps": "error",
53+
"react/react-in-jsx-scope": "off",
54+
"@typescript-eslint/explicit-function-return-type": "off",
55+
"@typescript-eslint/explicit-module-boundary-types": "off",
56+
"@typescript-eslint/ban-ts-comment": "off",
57+
"react/prop-types": "off",
58+
"import/order": ["error", {
59+
groups: ["builtin", "external", "internal"],
60+
pathGroups: [{
61+
pattern: "react",
62+
group: "external",
63+
position: "before",
64+
}],
65+
pathGroupsExcludedImportTypes: ["react"],
66+
"newlines-between": "always",
67+
alphabetize: {
68+
order: "asc",
69+
caseInsensitive: true,
70+
},
71+
}],
72+
"prettier/prettier": "error",
73+
},
74+
}]);

0 commit comments

Comments
 (0)