Skip to content

Commit 3431954

Browse files
committed
fix(deps): deps
1 parent 70c9f1a commit 3431954

File tree

7 files changed

+11565
-6547
lines changed

7 files changed

+11565
-6547
lines changed

.eslintignore

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

.eslintrc

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

.eslintrc.js

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
module.exports = {
2+
root: true,
3+
extends: [
4+
'next/core-web-vitals',
5+
'eslint:recommended',
6+
'plugin:react/recommended',
7+
'plugin:@typescript-eslint/recommended',
8+
'plugin:prettier/recommended',
9+
'plugin:storybook/recommended',
10+
'prettier',
11+
],
12+
plugins: [
13+
'react',
14+
'@typescript-eslint',
15+
'react-hooks',
16+
'eslint-plugin-import-helpers',
17+
'testing-library',
18+
],
19+
overrides: [
20+
// Only uses Testing Library lint rules in test files
21+
{
22+
files: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
23+
extends: ['plugin:testing-library/react'],
24+
},
25+
],
26+
parser: '@typescript-eslint/parser',
27+
parserOptions: {
28+
ecmaFeatures: {
29+
jsx: true,
30+
},
31+
ecmaVersion: 11,
32+
sourceType: 'module',
33+
},
34+
settings: {
35+
react: {
36+
version: 'detect',
37+
},
38+
},
39+
env: {
40+
es6: true,
41+
browser: true,
42+
jest: true,
43+
node: true,
44+
},
45+
rules: {
46+
'react-hooks/rules-of-hooks': 2,
47+
'react-hooks/exhaustive-deps': 1,
48+
'newline-before-return': 2,
49+
'react/prop-types': 0,
50+
'react/react-in-jsx-scope': 0,
51+
'import-helpers/order-imports': [
52+
2,
53+
{
54+
newlinesBetween: 'always',
55+
groups: [
56+
['/^next/', 'module'],
57+
'/^@/styles/',
58+
'/^@/components/',
59+
'/^@/lib/',
60+
['parent', 'sibling', 'index'],
61+
],
62+
alphabetize: {
63+
order: 'asc',
64+
ignoreCase: true,
65+
},
66+
},
67+
],
68+
'@typescript-eslint/no-unused-vars': [
69+
2,
70+
{
71+
argsIgnorePattern: '^_',
72+
},
73+
],
74+
'no-console': [
75+
2,
76+
{
77+
allow: ['warn', 'error'],
78+
},
79+
],
80+
},
81+
};

eslint.config.mjs

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
import react from "eslint-plugin-react";
2+
import typescriptEslint from "@typescript-eslint/eslint-plugin";
3+
import reactHooks from "eslint-plugin-react-hooks";
4+
import importHelpers from "eslint-plugin-import-helpers";
5+
import testingLibrary from "eslint-plugin-testing-library";
6+
import { fixupPluginRules } from "@eslint/compat";
7+
import globals from "globals";
8+
import tsParser from "@typescript-eslint/parser";
9+
import path from "node:path";
10+
import { fileURLToPath } from "node:url";
11+
import js from "@eslint/js";
12+
import { FlatCompat } from "@eslint/eslintrc";
13+
14+
const __filename = fileURLToPath(import.meta.url);
15+
const __dirname = path.dirname(__filename);
16+
const compat = new FlatCompat({
17+
baseDirectory: __dirname,
18+
recommendedConfig: js.configs.recommended,
19+
allConfig: js.configs.all
20+
});
21+
22+
export default [...compat.extends(
23+
"next/core-web-vitals",
24+
"eslint:recommended",
25+
"plugin:react/recommended",
26+
"plugin:@typescript-eslint/recommended",
27+
"plugin:prettier/recommended",
28+
"plugin:storybook/recommended",
29+
"prettier",
30+
), {
31+
plugins: {
32+
react,
33+
"@typescript-eslint": typescriptEslint,
34+
"react-hooks": reactHooks,
35+
"import-helpers": importHelpers,
36+
"testing-library": testingLibrary,
37+
},
38+
39+
languageOptions: {
40+
globals: {
41+
...globals.browser,
42+
...globals.jest,
43+
...globals.node,
44+
},
45+
46+
parser: tsParser,
47+
ecmaVersion: 11,
48+
sourceType: "module",
49+
50+
parserOptions: {
51+
ecmaFeatures: {
52+
jsx: true,
53+
},
54+
},
55+
},
56+
57+
settings: {
58+
react: {
59+
version: "detect",
60+
},
61+
},
62+
63+
rules: {
64+
"react-hooks/rules-of-hooks": 2,
65+
"react-hooks/exhaustive-deps": 1,
66+
"newline-before-return": 2,
67+
"react/prop-types": 0,
68+
"react/react-in-jsx-scope": 0,
69+
70+
"import-helpers/order-imports": [2, {
71+
newlinesBetween: "always",
72+
73+
groups: [
74+
["/^next/", "module"],
75+
"/^@/styles/",
76+
"/^@/components/",
77+
"/^@/lib/",
78+
["parent", "sibling", "index"],
79+
],
80+
81+
alphabetize: {
82+
order: "asc",
83+
ignoreCase: true,
84+
},
85+
}],
86+
87+
"@typescript-eslint/no-unused-vars": [2, {
88+
argsIgnorePattern: "^_",
89+
}],
90+
91+
"no-console": [2, {
92+
allow: ["warn", "error"],
93+
}],
94+
},
95+
}, ...compat.extends("plugin:testing-library/react").map(config => ({
96+
...config,
97+
files: ["**/__tests__/**/*.[jt]s?(x)", "**/?(*.)+(spec|test).[jt]s?(x)"],
98+
}))];

next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/// <reference types="next/image-types/global" />
33

44
// NOTE: This file should not be edited
5-
// see https://nextjs.org/docs/basic-features/typescript for more information.
5+
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.

0 commit comments

Comments
 (0)