eslint-config-matsuri 2.1.0 → 2.1.1-alpha-bd9aeba.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +149 -128
- package/package.json +3 -1
package/index.js
CHANGED
|
@@ -1,148 +1,169 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
extends: ["eslint:recommended"],
|
|
14
|
-
plugins: ["sort-imports-es6-autofix"],
|
|
15
|
-
rules: {
|
|
16
|
-
"no-console": ["error", { allow: ["error"] }],
|
|
17
|
-
eqeqeq: ["error", "always"],
|
|
1
|
+
import globals from "globals";
|
|
2
|
+
import js from "@eslint/js";
|
|
3
|
+
import pluginCssReorder from "eslint-plugin-css-reorder";
|
|
4
|
+
import pluginJsxA11y from "eslint-plugin-jsx-a11y";
|
|
5
|
+
import pluginPrettier from "eslint-config-prettier";
|
|
6
|
+
import pluginReact from "eslint-plugin-react";
|
|
7
|
+
import pluginReactHooks from "eslint-plugin-react-hooks";
|
|
8
|
+
import pluginSortImports from "eslint-plugin-sort-imports-es6-autofix";
|
|
9
|
+
import pluginUnusedImport from "eslint-plugin-unused-imports";
|
|
10
|
+
import ts from "@typescript-eslint/eslint-plugin";
|
|
11
|
+
import tsParser from "@typescript-eslint/parser";
|
|
18
12
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
13
|
+
/** @type { import("eslint").Linter.FlatConfig[] } */
|
|
14
|
+
const config = [
|
|
15
|
+
{
|
|
16
|
+
linterOptions: {
|
|
17
|
+
reportUnusedDisableDirectives: true,
|
|
18
|
+
},
|
|
19
|
+
languageOptions: {
|
|
20
|
+
ecmaVersion: 12,
|
|
21
|
+
globals: {
|
|
22
|
+
...globals.commonjs,
|
|
23
|
+
...globals.es2021,
|
|
24
|
+
...globals.node,
|
|
28
25
|
},
|
|
29
|
-
|
|
26
|
+
},
|
|
27
|
+
plugins: {
|
|
28
|
+
"sort-imports-es6-autofix": pluginSortImports,
|
|
29
|
+
},
|
|
30
|
+
rules: {
|
|
31
|
+
...js.configs.recommended.rules,
|
|
32
|
+
"no-console": ["error", { allow: ["error"] }],
|
|
33
|
+
eqeqeq: ["error", "always"],
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* eslint-plugin-sort-imports-es6-autofix
|
|
37
|
+
*/
|
|
38
|
+
"sort-imports-es6-autofix/sort-imports-es6": [
|
|
39
|
+
2,
|
|
40
|
+
{
|
|
41
|
+
ignoreCase: false,
|
|
42
|
+
ignoreMemberSort: false,
|
|
43
|
+
memberSyntaxSortOrder: ["none", "all", "multiple", "single"],
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
},
|
|
30
47
|
},
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
browser
|
|
36
|
-
es2021
|
|
48
|
+
{
|
|
49
|
+
files: ["**/*.ts", "**/*.tsx"],
|
|
50
|
+
languageOptions: {
|
|
51
|
+
globals: {
|
|
52
|
+
...globals.browser,
|
|
53
|
+
...globals.es2021,
|
|
54
|
+
React: true,
|
|
37
55
|
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"plugin:react-hooks/recommended",
|
|
47
|
-
"plugin:react/jsx-runtime",
|
|
48
|
-
"plugin:@typescript-eslint/recommended-type-checked",
|
|
49
|
-
"plugin:@typescript-eslint/stylistic-type-checked",
|
|
50
|
-
"plugin:jsx-a11y/recommended",
|
|
51
|
-
"prettier",
|
|
52
|
-
],
|
|
53
|
-
parser: "@typescript-eslint/parser",
|
|
54
|
-
settings: {
|
|
55
|
-
react: {
|
|
56
|
-
version: "detect",
|
|
57
|
-
},
|
|
56
|
+
parser: tsParser,
|
|
57
|
+
parserOptions: {
|
|
58
|
+
project: true,
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
settings: {
|
|
62
|
+
react: {
|
|
63
|
+
version: "detect",
|
|
58
64
|
},
|
|
59
|
-
|
|
60
|
-
|
|
65
|
+
},
|
|
66
|
+
plugins: {
|
|
67
|
+
"@typescript-eslint": ts,
|
|
68
|
+
"unused-imports": pluginUnusedImport,
|
|
69
|
+
"css-reorder": pluginCssReorder,
|
|
70
|
+
"jsx-a11y": pluginJsxA11y,
|
|
71
|
+
react: pluginReact,
|
|
72
|
+
"react-hooks": pluginReactHooks,
|
|
73
|
+
},
|
|
74
|
+
rules: {
|
|
75
|
+
...pluginReact.configs.recommended.rules,
|
|
76
|
+
...pluginReactHooks.configs.recommended.rules,
|
|
77
|
+
...pluginReact.configs["jsx-runtime"].rules,
|
|
78
|
+
...ts.configs["recommended-type-checked"].rules,
|
|
79
|
+
...ts.configs["stylistic-type-checked"].rules,
|
|
80
|
+
...pluginJsxA11y.configs.recommended.rules,
|
|
81
|
+
...pluginPrettier.rules,
|
|
82
|
+
"css-reorder/property-reorder": "error",
|
|
61
83
|
|
|
62
|
-
|
|
84
|
+
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
63
85
|
|
|
64
|
-
|
|
86
|
+
"@typescript-eslint/no-empty-interface": "off",
|
|
65
87
|
|
|
66
|
-
|
|
88
|
+
"@typescript-eslint/no-non-null-assertion": "error",
|
|
67
89
|
|
|
68
|
-
|
|
90
|
+
"@typescript-eslint/consistent-type-exports": "error",
|
|
69
91
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
},
|
|
88
|
-
VFC: {
|
|
89
|
-
message: "Use React.FC instead.",
|
|
90
|
-
fixWith: "React.FC",
|
|
91
|
-
},
|
|
92
|
+
"@typescript-eslint/strict-boolean-expressions": [
|
|
93
|
+
"error",
|
|
94
|
+
{
|
|
95
|
+
allowString: true,
|
|
96
|
+
allowNullableObject: true,
|
|
97
|
+
allowNullableBoolean: true,
|
|
98
|
+
allowNullableString: true,
|
|
99
|
+
allowAny: true,
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
"@typescript-eslint/ban-types": [
|
|
103
|
+
"error",
|
|
104
|
+
{
|
|
105
|
+
types: {
|
|
106
|
+
"React.VFC": {
|
|
107
|
+
message: "Use React.FC instead.",
|
|
108
|
+
fixWith: "React.FC",
|
|
92
109
|
},
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Allow `() => Promise<void>` in JSX event handler.
|
|
98
|
-
* @see https://github.com/typescript-eslint/typescript-eslint/blob/f373fac1dd0150273d98cee5bed606bbd3f55e4b/packages/eslint-plugin/docs/rules/no-misused-promises.md#checksvoidreturn
|
|
99
|
-
*/
|
|
100
|
-
"@typescript-eslint/no-misused-promises": [
|
|
101
|
-
"error",
|
|
102
|
-
{
|
|
103
|
-
checksVoidReturn: {
|
|
104
|
-
attributes: false,
|
|
110
|
+
VFC: {
|
|
111
|
+
message: "Use React.FC instead.",
|
|
112
|
+
fixWith: "React.FC",
|
|
105
113
|
},
|
|
106
114
|
},
|
|
107
|
-
|
|
115
|
+
},
|
|
116
|
+
],
|
|
108
117
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
118
|
+
/**
|
|
119
|
+
* Allow `() => Promise<void>` in JSX event handler.
|
|
120
|
+
* @see https://github.com/typescript-eslint/typescript-eslint/blob/f373fac1dd0150273d98cee5bed606bbd3f55e4b/packages/eslint-plugin/docs/rules/no-misused-promises.md#checksvoidreturn
|
|
121
|
+
*/
|
|
122
|
+
"@typescript-eslint/no-misused-promises": [
|
|
123
|
+
"error",
|
|
124
|
+
{
|
|
125
|
+
checksVoidReturn: {
|
|
126
|
+
attributes: false,
|
|
114
127
|
},
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
"react/display-name": "off",
|
|
118
|
-
// For emotion and its css prop
|
|
119
|
-
"react/no-unknown-property": ["error", { ignore: ["css"] }],
|
|
120
|
-
"react-hooks/exhaustive-deps": "error",
|
|
128
|
+
},
|
|
129
|
+
],
|
|
121
130
|
|
|
122
|
-
|
|
123
|
-
"
|
|
131
|
+
"react/self-closing-comp": [
|
|
132
|
+
"error",
|
|
133
|
+
{
|
|
134
|
+
component: true,
|
|
135
|
+
html: true,
|
|
136
|
+
},
|
|
137
|
+
],
|
|
138
|
+
"react/prop-types": "off",
|
|
139
|
+
"react/display-name": "off",
|
|
140
|
+
// For emotion and its css prop
|
|
141
|
+
"react/no-unknown-property": ["error", { ignore: ["css"] }],
|
|
142
|
+
"react-hooks/exhaustive-deps": "error",
|
|
124
143
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
"jsx-a11y/media-has-caption": "off",
|
|
144
|
+
"jsx-a11y/click-events-have-key-events": "off",
|
|
145
|
+
"jsx-a11y/no-autofocus": "off",
|
|
128
146
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
147
|
+
// 当社のサービスでは、ユーザーがアップロードした動画を表示することが主であり、
|
|
148
|
+
// 字幕を付加することはあまり想定されず、無意味なtrack要素の挿入を招くため無効化する
|
|
149
|
+
"jsx-a11y/media-has-caption": "off",
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* settings for unused-imports
|
|
153
|
+
*/
|
|
154
|
+
"@typescript-eslint/no-unused-vars": "off",
|
|
155
|
+
"unused-imports/no-unused-imports": "error",
|
|
156
|
+
"unused-imports/no-unused-vars": [
|
|
157
|
+
"error",
|
|
158
|
+
{
|
|
159
|
+
vars: "all",
|
|
160
|
+
varsIgnorePattern: "^_",
|
|
161
|
+
args: "after-used",
|
|
162
|
+
argsIgnorePattern: "^_",
|
|
163
|
+
},
|
|
164
|
+
],
|
|
144
165
|
},
|
|
145
|
-
|
|
146
|
-
|
|
166
|
+
},
|
|
167
|
+
];
|
|
147
168
|
|
|
148
|
-
|
|
169
|
+
export default config;
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-matsuri",
|
|
3
|
-
"version": "2.1.0",
|
|
3
|
+
"version": "2.1.1-alpha-bd9aeba.0",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"description": "",
|
|
5
6
|
"main": "index.js",
|
|
6
7
|
"files": [
|
|
@@ -25,6 +26,7 @@
|
|
|
25
26
|
"typescript": "5.1.6"
|
|
26
27
|
},
|
|
27
28
|
"dependencies": {
|
|
29
|
+
"@eslint/js": "8.53.0",
|
|
28
30
|
"@typescript-eslint/eslint-plugin": "6.2.1",
|
|
29
31
|
"@typescript-eslint/parser": "6.2.1",
|
|
30
32
|
"eslint-config-prettier": "8.8.0",
|