Skip to content

Commit bd663eb

Browse files
authored
Upgrade lint, next, react (#74)
* Upgrade lint + next * Run codemod for new prop changes * Upgrade react
1 parent 5c522d0 commit bd663eb

File tree

6 files changed

+1028
-551
lines changed

6 files changed

+1028
-551
lines changed

.eslintrc.json

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

eslint.config.mjs

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
import { defineConfig } from "eslint/config";
2+
import prettier from "eslint-plugin-prettier";
3+
import { fixupPluginRules } from "@eslint/compat";
4+
import globals from "globals";
5+
import tsParser from "@typescript-eslint/parser";
6+
import path from "node:path";
7+
import { fileURLToPath } from "node:url";
8+
import js from "@eslint/js";
9+
import { FlatCompat } from "@eslint/eslintrc";
10+
11+
const __filename = fileURLToPath(import.meta.url);
12+
const __dirname = path.dirname(__filename);
13+
const compat = new FlatCompat({
14+
baseDirectory: __dirname,
15+
recommendedConfig: js.configs.recommended,
16+
allConfig: js.configs.all
17+
});
18+
19+
export default defineConfig([{
20+
extends: compat.extends(
21+
'eslint:recommended',
22+
"next",
23+
"next/core-web-vitals",
24+
"plugin:@typescript-eslint/recommended",
25+
"plugin:prettier/recommended",
26+
"plugin:jsx-a11y/recommended",
27+
),
28+
29+
plugins: {
30+
prettier,
31+
},
32+
33+
languageOptions: {
34+
globals: {
35+
...globals.browser,
36+
...globals.node,
37+
React: "writable",
38+
},
39+
40+
parser: tsParser,
41+
ecmaVersion: 5,
42+
sourceType: "commonjs",
43+
44+
parserOptions: {
45+
project: "./tsconfig.json",
46+
tsconfigRootDir: "./",
47+
jsx: true,
48+
warnOnUnsupportedTypeScriptVersion: false,
49+
},
50+
},
51+
52+
settings: {
53+
"import/resolver": {
54+
typescript: {},
55+
},
56+
},
57+
58+
rules: {
59+
"import/order": ["error", {
60+
groups: ["builtin", "external", "internal"],
61+
62+
pathGroups: [{
63+
pattern: "react",
64+
group: "external",
65+
position: "before",
66+
}],
67+
68+
pathGroupsExcludedImportTypes: ["react"],
69+
"newlines-between": "always",
70+
71+
alphabetize: {
72+
order: "desc",
73+
caseInsensitive: true,
74+
},
75+
}],
76+
77+
"@typescript-eslint/no-unused-vars": ["error", {
78+
destructuredArrayIgnorePattern: "^_$",
79+
}],
80+
81+
"prettier/prettier": "error",
82+
},
83+
}]);

0 commit comments

Comments
 (0)