Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 70fca79

Browse files
Added React version to eslint config file
1 parent 8743f53 commit 70fca79

File tree

1 file changed

+41
-32
lines changed

1 file changed

+41
-32
lines changed

‎eslint.config.js

Lines changed: 41 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { fixupPluginRules } from "@eslint/compat";
22
import { FlatCompat } from "@eslint/eslintrc";
33
import js from "@eslint/js";
44
import globals from "globals";
5-
import reactPlugin from 'eslint-plugin-react';
5+
import reactPlugin from "eslint-plugin-react";
66
import reactHooks from "eslint-plugin-react-hooks";
77
import reactRefresh from "eslint-plugin-react-refresh";
88
import tseslint from "typescript-eslint";
@@ -49,46 +49,55 @@ export default tseslint.config(
4949
alwaysTryTypes: true,
5050
},
5151
},
52+
react: {
53+
version: "detect",
54+
},
5255
},
5356
rules: {
5457
...reactHooks.configs.recommended.rules,
5558
"@typescript-eslint/no-empty-object-type": "off",
56-
"@typescript-eslint/no-unused-vars": ["error", {
57-
"argsIgnorePattern": "^_",
58-
"varsIgnorePattern": "^_",
59-
"caughtErrorsIgnorePattern": "^_"
60-
}],
61-
"import/order": ["error", {
62-
"groups": [
63-
"builtin",
64-
"external",
65-
"internal",
66-
["parent", "sibling"],
67-
"index",
68-
"object",
69-
"type",
70-
"unknown"
71-
],
72-
"pathGroups": [
73-
{
74-
"pattern": "@*",
75-
"group": "internal",
76-
"position": "after"
77-
}
78-
],
79-
"pathGroupsExcludedImportTypes": ["builtin", "internal"],
80-
"newlines-between": "always",
81-
"alphabetize": {
82-
"order": "asc",
83-
"caseInsensitive": true
84-
}
85-
}],
59+
"@typescript-eslint/no-unused-vars": [
60+
"error",
61+
{
62+
argsIgnorePattern: "^_",
63+
varsIgnorePattern: "^_",
64+
caughtErrorsIgnorePattern: "^_",
65+
},
66+
],
67+
"import/order": [
68+
"error",
69+
{
70+
groups: [
71+
"builtin",
72+
"external",
73+
"internal",
74+
["parent", "sibling"],
75+
"index",
76+
"object",
77+
"type",
78+
"unknown",
79+
],
80+
pathGroups: [
81+
{
82+
pattern: "@*",
83+
group: "internal",
84+
position: "after",
85+
},
86+
],
87+
pathGroupsExcludedImportTypes: ["builtin", "internal"],
88+
"newlines-between": "always",
89+
alphabetize: {
90+
order: "asc",
91+
caseInsensitive: true,
92+
},
93+
},
94+
],
8695
"react/react-in-jsx-scope": "off",
8796
"react-refresh/only-export-components": [
8897
"warn",
8998
{ allowConstantExport: true },
9099
],
91-
"semi": ["error", "always"],
100+
semi: ["error", "always"],
92101
},
93102
}
94103
);

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /