forked from illionillion/react-read-nfc-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
66 lines (61 loc) · 1.76 KB
/
.eslintrc.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
module.exports = {
root: true,
env: { browser: true, es2021: true, node: true },
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
],
ignorePatterns: ["dist", "docs"],
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint", "react", "unused-imports", "react-refresh", "import"],
rules: {
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
"linebreak-style": ["error", "unix"],
quotes: ["error", "single"],
semi: ["error", "always"],
// no-mixed-spaces-and-tabsルールをoffに設定する
"no-mixed-spaces-and-tabs": "off",
// // インデントはスペースで統一
indent: ["error", 2, { SwitchCase: 1 }],
"import/order": [
"error",
{
"alphabetize": {
"order": "asc"
}
}
],
// // タブ文字は使用しない
// 'no-tabs': 'error',
// {'string'}のような波括弧を消す
'react/jsx-curly-brace-presence': 'error',
/**
* @description importが型のみの場合は、import typeを強制
*/
"@typescript-eslint/consistent-type-imports": "error",
/**
* 未使用のimport削除
*/
"unused-imports/no-unused-imports": "warn",
/**
* @description propsを自動でソート
* @see {@link https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-sort-props.md}
*/
"react/jsx-sort-props": [
"error",
{
callbacksLast: true,
shorthandFirst: true,
ignoreCase: true,
noSortAlphabetically: true,
reservedFirst: true,
},
],
},
};