@slashnephy/eslint-config 2.3.204 → 3.0.2
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/README.md +20 -6
- package/package.json +24 -40
- package/src/base/common.js +37 -0
- package/src/base/common.ts +42 -0
- package/src/base/graphql.js +41 -8
- package/src/base/graphql.ts +48 -15
- package/src/base/javascript.js +155 -70
- package/src/base/javascript.ts +218 -180
- package/src/base/package.json.js +15 -0
- package/src/base/package.json.ts +16 -0
- package/src/base/typescript.js +90 -46
- package/src/base/typescript.ts +229 -212
- package/src/base/yaml.js +19 -14
- package/src/base/yaml.ts +23 -16
- package/src/environments/cloudflareWorkers.js +9 -0
- package/src/environments/cloudflareWorkers.ts +10 -0
- package/src/environments/node.js +50 -0
- package/src/environments/node.ts +55 -0
- package/src/{presets → environments}/userscript.js +10 -5
- package/src/{presets → environments}/userscript.ts +10 -7
- package/src/frameworks/jest.js +10 -0
- package/src/frameworks/jest.ts +11 -0
- package/src/frameworks/next.js.js +24 -0
- package/src/frameworks/next.js.ts +25 -0
- package/src/frameworks/react.js +128 -0
- package/src/frameworks/react.ts +134 -0
- package/src/frameworks/relay.js +13 -0
- package/src/frameworks/relay.ts +14 -0
- package/src/frameworks/storybook.js +7 -0
- package/src/frameworks/storybook.ts +8 -0
- package/src/frameworks/vite.js +7 -0
- package/src/frameworks/vite.ts +8 -0
- package/src/frameworks/vitest.js +20 -0
- package/src/frameworks/vitest.ts +21 -0
- package/src/index.js +60 -102
- package/src/index.ts +65 -130
- package/src/framework/emotion.js +0 -17
- package/src/framework/emotion.ts +0 -20
- package/src/framework/jest.js +0 -14
- package/src/framework/jest.ts +0 -17
- package/src/framework/next.js.js +0 -14
- package/src/framework/next.js.ts +0 -13
- package/src/framework/react.js +0 -79
- package/src/framework/react.ts +0 -98
- package/src/framework/relay.js +0 -9
- package/src/framework/relay.ts +0 -10
- package/src/framework/vite.js +0 -8
- package/src/framework/vite.ts +0 -8
- package/src/framework/vitest.js +0 -6
- package/src/framework/vitest.ts +0 -9
- package/src/presets/a11y.js +0 -28
- package/src/presets/a11y.ts +0 -27
- package/src/presets/allow-default-export.js +0 -8
- package/src/presets/allow-default-export.ts +0 -9
- package/src/presets/build-configuration.js +0 -12
- package/src/presets/build-configuration.ts +0 -13
- package/src/presets/node.js +0 -7
- package/src/presets/node.ts +0 -8
- package/src/presets/package.json.js +0 -17
- package/src/presets/package.json.ts +0 -17
- package/src/presets/style.js +0 -23
- package/src/presets/style.ts +0 -39
package/src/index.ts
CHANGED
|
@@ -1,135 +1,70 @@
|
|
|
1
|
-
import
|
|
1
|
+
import tseslint from 'typescript-eslint'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
import '
|
|
5
|
-
import {
|
|
3
|
+
import { common } from './base/common.js'
|
|
4
|
+
import { graphql } from './base/graphql.js'
|
|
5
|
+
import { javaScript } from './base/javascript.js'
|
|
6
|
+
import { packageJson } from './base/package.json.js'
|
|
7
|
+
import { typeScript } from './base/typescript.js'
|
|
8
|
+
import { yaml } from './base/yaml.js'
|
|
9
|
+
import { cloudflareWorkers } from './environments/cloudflareWorkers.js'
|
|
10
|
+
import { node } from './environments/node.js'
|
|
11
|
+
import { userScript } from './environments/userscript.js'
|
|
12
|
+
import { jest } from './frameworks/jest.js'
|
|
13
|
+
import { nextJs } from './frameworks/next.js.js'
|
|
14
|
+
import { react } from './frameworks/react.js'
|
|
15
|
+
import { relay } from './frameworks/relay.js'
|
|
16
|
+
import { storybook } from './frameworks/storybook.js'
|
|
17
|
+
import { vite } from './frameworks/vite.js'
|
|
18
|
+
import { vitest } from './frameworks/vitest.js'
|
|
6
19
|
|
|
7
|
-
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type -- 将来のために予約してある
|
|
21
|
+
type Options = {}
|
|
8
22
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
extends: resolve(__dirname, 'base/javascript.js'),
|
|
26
|
-
processor: '@graphql-eslint/graphql',
|
|
27
|
-
},
|
|
28
|
-
// TypeScript
|
|
29
|
-
{
|
|
30
|
-
files: '**/*.{ts,mts,cts,tsx}',
|
|
31
|
-
extends: [resolve(__dirname, 'base/typescript.js')],
|
|
32
|
-
},
|
|
33
|
-
// GraphQL
|
|
34
|
-
{
|
|
35
|
-
files: '**/*.{graphql,graphqls,gql}',
|
|
36
|
-
extends: [resolve(__dirname, 'base/graphql.js')],
|
|
37
|
-
},
|
|
38
|
-
// YAML
|
|
39
|
-
{
|
|
40
|
-
files: '**/*.{yml,yaml}',
|
|
41
|
-
extends: resolve(__dirname, 'base/yaml.js'),
|
|
42
|
-
},
|
|
23
|
+
export function config(_options?: Options, ...overrides: tseslint.ConfigWithExtends[]): tseslint.ConfigArray {
|
|
24
|
+
return tseslint.config(
|
|
25
|
+
// ベース
|
|
26
|
+
[
|
|
27
|
+
common,
|
|
28
|
+
// JavaScript
|
|
29
|
+
javaScript,
|
|
30
|
+
// TypeScript
|
|
31
|
+
typeScript,
|
|
32
|
+
// GraphQL
|
|
33
|
+
graphql,
|
|
34
|
+
// YAML
|
|
35
|
+
yaml,
|
|
36
|
+
// package.json
|
|
37
|
+
packageJson,
|
|
38
|
+
],
|
|
43
39
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
},
|
|
62
|
-
// Next.js
|
|
63
|
-
{
|
|
64
|
-
files: [
|
|
65
|
-
// Pages Router
|
|
66
|
-
'**/pages/**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx}',
|
|
67
|
-
// App Router
|
|
68
|
-
'**/app/**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx}',
|
|
69
|
-
],
|
|
70
|
-
extends: resolve(__dirname, 'framework/next.js.js'),
|
|
71
|
-
},
|
|
72
|
-
// Emotion
|
|
73
|
-
{
|
|
74
|
-
files: '**/*.{jsx,tsx}',
|
|
75
|
-
extends: resolve(__dirname, 'framework/emotion.js'),
|
|
76
|
-
},
|
|
77
|
-
// jest / vitest
|
|
78
|
-
{
|
|
79
|
-
files: [
|
|
80
|
-
'**/*.test.{js,mjs,cjs,jsx,ts,mts,cts,tsx}',
|
|
81
|
-
'**/test/**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx}',
|
|
82
|
-
],
|
|
83
|
-
extends: [
|
|
84
|
-
resolve(__dirname, 'framework/jest.js'),
|
|
85
|
-
resolve(__dirname, 'framework/vitest.js'),
|
|
86
|
-
],
|
|
87
|
-
},
|
|
40
|
+
// フレームワーク
|
|
41
|
+
[
|
|
42
|
+
// React
|
|
43
|
+
react,
|
|
44
|
+
// Next.js
|
|
45
|
+
nextJs,
|
|
46
|
+
// Vite
|
|
47
|
+
vite,
|
|
48
|
+
// Relay
|
|
49
|
+
relay,
|
|
50
|
+
// Storybook
|
|
51
|
+
storybook,
|
|
52
|
+
// Jest
|
|
53
|
+
jest,
|
|
54
|
+
// Vitest
|
|
55
|
+
vitest,
|
|
56
|
+
],
|
|
88
57
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
// Cloudflare Worker
|
|
103
|
-
{
|
|
104
|
-
files: ['**/src/worker.{js,ts}', '**/functions/**/*.{js,ts}'],
|
|
105
|
-
extends: resolve(__dirname, 'presets/allow-default-export.js'),
|
|
106
|
-
},
|
|
107
|
-
// ビルドツールの構成ファイル
|
|
108
|
-
{
|
|
109
|
-
files: [
|
|
110
|
-
'**/{webpack,rollup,vite,postcss,next}.config.{js,mjs,cjs,ts,mts,cts}',
|
|
111
|
-
'**/codegen.{js,mjs,cjs,ts,mts,cts}',
|
|
112
|
-
],
|
|
113
|
-
extends: [
|
|
114
|
-
resolve(__dirname, 'presets/allow-default-export.js'),
|
|
115
|
-
resolve(__dirname, 'presets/build-configuration.js'),
|
|
116
|
-
resolve(__dirname, 'presets/node.js'),
|
|
117
|
-
],
|
|
118
|
-
},
|
|
119
|
-
// package.json
|
|
120
|
-
{
|
|
121
|
-
files: '**/package.json',
|
|
122
|
-
extends: resolve(__dirname, 'presets/package.json.js'),
|
|
123
|
-
},
|
|
124
|
-
// UserScript
|
|
125
|
-
{
|
|
126
|
-
files: '**/*.user.js',
|
|
127
|
-
extends: resolve(__dirname, 'presets/userscript.js'),
|
|
128
|
-
},
|
|
129
|
-
// コーディングスタイル
|
|
130
|
-
{
|
|
131
|
-
files: '**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx}',
|
|
132
|
-
extends: resolve(__dirname, 'presets/style.js'),
|
|
133
|
-
},
|
|
134
|
-
],
|
|
135
|
-
} satisfies Linter.Config
|
|
58
|
+
// 環境
|
|
59
|
+
[
|
|
60
|
+
// Node.js
|
|
61
|
+
node,
|
|
62
|
+
// Cloudflare Worker
|
|
63
|
+
cloudflareWorkers,
|
|
64
|
+
// UserScript
|
|
65
|
+
userScript,
|
|
66
|
+
],
|
|
67
|
+
|
|
68
|
+
...overrides,
|
|
69
|
+
)
|
|
70
|
+
}
|
package/src/framework/emotion.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
module.exports = {
|
|
4
|
-
plugins: ['@emotion', 'css-reorder'],
|
|
5
|
-
rules: {
|
|
6
|
-
'@emotion/pkg-renaming': 'error',
|
|
7
|
-
'@emotion/styled-import': 'error',
|
|
8
|
-
'@emotion/syntax-preference': 'error',
|
|
9
|
-
'css-reorder/property-reorder': 'error',
|
|
10
|
-
'react/no-unknown-property': [
|
|
11
|
-
'error',
|
|
12
|
-
{
|
|
13
|
-
ignore: ['css'],
|
|
14
|
-
},
|
|
15
|
-
],
|
|
16
|
-
},
|
|
17
|
-
};
|
package/src/framework/emotion.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { Linter } from 'eslint'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Emotion 関連の eslint プリセット
|
|
5
|
-
*/
|
|
6
|
-
module.exports = {
|
|
7
|
-
plugins: ['@emotion', 'css-reorder'],
|
|
8
|
-
rules: {
|
|
9
|
-
'@emotion/pkg-renaming': 'error',
|
|
10
|
-
'@emotion/styled-import': 'error',
|
|
11
|
-
'@emotion/syntax-preference': 'error',
|
|
12
|
-
'css-reorder/property-reorder': 'error',
|
|
13
|
-
'react/no-unknown-property': [
|
|
14
|
-
'error',
|
|
15
|
-
{
|
|
16
|
-
ignore: ['css'],
|
|
17
|
-
},
|
|
18
|
-
],
|
|
19
|
-
},
|
|
20
|
-
} satisfies Linter.Config
|
package/src/framework/jest.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
module.exports = {
|
|
4
|
-
plugins: ['jest'],
|
|
5
|
-
extends: [
|
|
6
|
-
'plugin:jest/recommended',
|
|
7
|
-
'plugin:jest/style',
|
|
8
|
-
'plugin:jest-formatting/recommended',
|
|
9
|
-
],
|
|
10
|
-
env: {
|
|
11
|
-
'jest/globals': true,
|
|
12
|
-
},
|
|
13
|
-
rules: {},
|
|
14
|
-
};
|
package/src/framework/jest.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { Linter } from 'eslint'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* jest 関連の eslint プリセット
|
|
5
|
-
*/
|
|
6
|
-
module.exports = {
|
|
7
|
-
plugins: ['jest'],
|
|
8
|
-
extends: [
|
|
9
|
-
'plugin:jest/recommended',
|
|
10
|
-
'plugin:jest/style',
|
|
11
|
-
'plugin:jest-formatting/recommended',
|
|
12
|
-
],
|
|
13
|
-
env: {
|
|
14
|
-
'jest/globals': true,
|
|
15
|
-
},
|
|
16
|
-
rules: {},
|
|
17
|
-
} satisfies Linter.Config
|
package/src/framework/next.js.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const eslint_config_next_1 = __importDefault(require("eslint-config-next"));
|
|
7
|
-
module.exports = {
|
|
8
|
-
extends: ['plugin:@next/next/recommended'],
|
|
9
|
-
rules: {
|
|
10
|
-
...eslint_config_next_1.default.rules,
|
|
11
|
-
'import/no-default-export': 'off',
|
|
12
|
-
'react-refresh/only-export-components': 'off',
|
|
13
|
-
},
|
|
14
|
-
};
|
package/src/framework/next.js.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import next from 'eslint-config-next'
|
|
2
|
-
|
|
3
|
-
import type { Linter } from 'eslint'
|
|
4
|
-
|
|
5
|
-
// https://github.com/vercel/next.js/blob/canary/packages/eslint-config-next/index.js
|
|
6
|
-
module.exports = {
|
|
7
|
-
extends: ['plugin:@next/next/recommended'],
|
|
8
|
-
rules: {
|
|
9
|
-
...next.rules,
|
|
10
|
-
'import/no-default-export': 'off',
|
|
11
|
-
'react-refresh/only-export-components': 'off',
|
|
12
|
-
},
|
|
13
|
-
} satisfies Linter.Config
|
package/src/framework/react.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
module.exports = {
|
|
4
|
-
extends: ['plugin:react/recommended', 'plugin:react/jsx-runtime'],
|
|
5
|
-
plugins: ['react-hooks'],
|
|
6
|
-
parserOptions: {
|
|
7
|
-
ecmaFeatures: {
|
|
8
|
-
jsx: true,
|
|
9
|
-
},
|
|
10
|
-
jsxPragma: 'React',
|
|
11
|
-
lib: ['dom'],
|
|
12
|
-
},
|
|
13
|
-
env: {
|
|
14
|
-
browser: true,
|
|
15
|
-
node: true,
|
|
16
|
-
},
|
|
17
|
-
settings: {
|
|
18
|
-
react: {
|
|
19
|
-
version: 'detect',
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
rules: {
|
|
23
|
-
'react/jsx-boolean-value': 'error',
|
|
24
|
-
'react/jsx-curly-brace-presence': 'error',
|
|
25
|
-
'react/self-closing-comp': [
|
|
26
|
-
'error',
|
|
27
|
-
{
|
|
28
|
-
component: true,
|
|
29
|
-
html: true,
|
|
30
|
-
},
|
|
31
|
-
],
|
|
32
|
-
'react/jsx-pascal-case': 'error',
|
|
33
|
-
'react-hooks/rules-of-hooks': 'error',
|
|
34
|
-
'react-hooks/exhaustive-deps': [
|
|
35
|
-
'warn',
|
|
36
|
-
{
|
|
37
|
-
additionalHooks: '(useRecoilCallback|useRecoilTransaction_UNSTABLE)',
|
|
38
|
-
},
|
|
39
|
-
],
|
|
40
|
-
'react/jsx-handler-names': 'error',
|
|
41
|
-
'react/hook-use-state': 'error',
|
|
42
|
-
'react/jsx-fragments': 'error',
|
|
43
|
-
'react/prefer-stateless-function': 'error',
|
|
44
|
-
'react/jsx-sort-props': [
|
|
45
|
-
'error',
|
|
46
|
-
{
|
|
47
|
-
callbacksLast: true,
|
|
48
|
-
shorthandFirst: true,
|
|
49
|
-
multiline: 'last',
|
|
50
|
-
reservedFirst: true,
|
|
51
|
-
},
|
|
52
|
-
],
|
|
53
|
-
'react/jsx-filename-extension': [
|
|
54
|
-
'error',
|
|
55
|
-
{
|
|
56
|
-
extensions: ['.jsx', '.tsx'],
|
|
57
|
-
},
|
|
58
|
-
],
|
|
59
|
-
'react/jsx-props-no-spreading': 'off',
|
|
60
|
-
'react/jsx-no-useless-fragment': 'off',
|
|
61
|
-
'react/require-default-props': 'off',
|
|
62
|
-
'react/jsx-no-bind': 'warn',
|
|
63
|
-
'react/function-component-definition': [
|
|
64
|
-
'error',
|
|
65
|
-
{
|
|
66
|
-
namedComponents: 'function-declaration',
|
|
67
|
-
unnamedComponents: 'arrow-function',
|
|
68
|
-
},
|
|
69
|
-
],
|
|
70
|
-
},
|
|
71
|
-
overrides: [
|
|
72
|
-
{
|
|
73
|
-
files: '**/*.jsx',
|
|
74
|
-
rules: {
|
|
75
|
-
'react/prop-types': 'error',
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
],
|
|
79
|
-
};
|
package/src/framework/react.ts
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import type { Linter } from 'eslint'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* React 関連の eslint プリセット
|
|
5
|
-
*/
|
|
6
|
-
module.exports = {
|
|
7
|
-
extends: ['plugin:react/recommended', 'plugin:react/jsx-runtime'],
|
|
8
|
-
plugins: ['react-hooks'],
|
|
9
|
-
parserOptions: {
|
|
10
|
-
ecmaFeatures: {
|
|
11
|
-
jsx: true,
|
|
12
|
-
},
|
|
13
|
-
jsxPragma: 'React',
|
|
14
|
-
lib: ['dom'],
|
|
15
|
-
},
|
|
16
|
-
env: {
|
|
17
|
-
browser: true,
|
|
18
|
-
node: true,
|
|
19
|
-
},
|
|
20
|
-
settings: {
|
|
21
|
-
react: {
|
|
22
|
-
version: 'detect',
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
rules: {
|
|
26
|
-
// <div flag={true} /> 👉 <div flag />
|
|
27
|
-
'react/jsx-boolean-value': 'error',
|
|
28
|
-
// <div value={'test'} /> 👉 <div value='test' />
|
|
29
|
-
'react/jsx-curly-brace-presence': 'error',
|
|
30
|
-
// <div></div> 👉 <div />
|
|
31
|
-
'react/self-closing-comp': [
|
|
32
|
-
'error',
|
|
33
|
-
{
|
|
34
|
-
component: true,
|
|
35
|
-
html: true,
|
|
36
|
-
},
|
|
37
|
-
],
|
|
38
|
-
// コンポーネント名を PascalCase に強制
|
|
39
|
-
'react/jsx-pascal-case': 'error',
|
|
40
|
-
// https://recoiljs.org/docs/introduction/installation/#eslint
|
|
41
|
-
'react-hooks/rules-of-hooks': 'error',
|
|
42
|
-
'react-hooks/exhaustive-deps': [
|
|
43
|
-
'warn',
|
|
44
|
-
{
|
|
45
|
-
additionalHooks: '(useRecoilCallback|useRecoilTransaction_UNSTABLE)',
|
|
46
|
-
},
|
|
47
|
-
],
|
|
48
|
-
// ハンドラーの名前規則
|
|
49
|
-
'react/jsx-handler-names': 'error',
|
|
50
|
-
// useState の分解宣言 & setXXX という名前を強制
|
|
51
|
-
'react/hook-use-state': 'error',
|
|
52
|
-
// <React.Fragment /> 👉 </>
|
|
53
|
-
'react/jsx-fragments': 'error',
|
|
54
|
-
// ステートレス関数を優先
|
|
55
|
-
'react/prefer-stateless-function': 'error',
|
|
56
|
-
// props を並び替える
|
|
57
|
-
'react/jsx-sort-props': [
|
|
58
|
-
'error',
|
|
59
|
-
{
|
|
60
|
-
callbacksLast: true,
|
|
61
|
-
shorthandFirst: true,
|
|
62
|
-
multiline: 'last',
|
|
63
|
-
reservedFirst: true,
|
|
64
|
-
},
|
|
65
|
-
],
|
|
66
|
-
// JSX を .tsx でも使えるように
|
|
67
|
-
'react/jsx-filename-extension': [
|
|
68
|
-
'error',
|
|
69
|
-
{
|
|
70
|
-
extensions: ['.jsx', '.tsx'],
|
|
71
|
-
},
|
|
72
|
-
],
|
|
73
|
-
// props に対してスプレッド演算子を使えるように
|
|
74
|
-
'react/jsx-props-no-spreading': 'off',
|
|
75
|
-
// <></> を使えるように
|
|
76
|
-
'react/jsx-no-useless-fragment': 'off',
|
|
77
|
-
// defaultProps を使わない
|
|
78
|
-
'react/require-default-props': 'off',
|
|
79
|
-
// useCallback でコールバックを宣言させる
|
|
80
|
-
'react/jsx-no-bind': 'warn',
|
|
81
|
-
// コンポーネントの宣言を function Component() {} に強制
|
|
82
|
-
'react/function-component-definition': [
|
|
83
|
-
'error',
|
|
84
|
-
{
|
|
85
|
-
namedComponents: 'function-declaration',
|
|
86
|
-
unnamedComponents: 'arrow-function',
|
|
87
|
-
},
|
|
88
|
-
],
|
|
89
|
-
},
|
|
90
|
-
overrides: [
|
|
91
|
-
{
|
|
92
|
-
files: '**/*.jsx',
|
|
93
|
-
rules: {
|
|
94
|
-
'react/prop-types': 'error',
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
],
|
|
98
|
-
} satisfies Linter.Config
|
package/src/framework/relay.js
DELETED
package/src/framework/relay.ts
DELETED
package/src/framework/vite.js
DELETED
package/src/framework/vite.ts
DELETED
package/src/framework/vitest.js
DELETED
package/src/framework/vitest.ts
DELETED
package/src/presets/a11y.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_a11y_1 = __importDefault(require("eslint-config-airbnb/rules/react-a11y"));
|
|
7
|
-
module.exports = {
|
|
8
|
-
extends: ['plugin:jsx-a11y/recommended'],
|
|
9
|
-
plugins: ['jsx-a11y'],
|
|
10
|
-
parserOptions: {
|
|
11
|
-
ecmaFeatures: {
|
|
12
|
-
jsx: true,
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
rules: {
|
|
16
|
-
...react_a11y_1.default.rules,
|
|
17
|
-
'jsx-a11y/alt-text': [
|
|
18
|
-
'warn',
|
|
19
|
-
{
|
|
20
|
-
elements: ['img', 'object', 'area', 'input[type="image"]'],
|
|
21
|
-
img: ['Image'],
|
|
22
|
-
object: [],
|
|
23
|
-
area: [],
|
|
24
|
-
'input[type="image"]': [],
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
|
-
},
|
|
28
|
-
};
|
package/src/presets/a11y.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// @ts-expect-error Linter.Config
|
|
2
|
-
import airbnb from 'eslint-config-airbnb/rules/react-a11y'
|
|
3
|
-
|
|
4
|
-
import type { Linter } from 'eslint'
|
|
5
|
-
|
|
6
|
-
module.exports = {
|
|
7
|
-
extends: ['plugin:jsx-a11y/recommended'],
|
|
8
|
-
plugins: ['jsx-a11y'],
|
|
9
|
-
parserOptions: {
|
|
10
|
-
ecmaFeatures: {
|
|
11
|
-
jsx: true,
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
rules: {
|
|
15
|
-
...airbnb.rules,
|
|
16
|
-
'jsx-a11y/alt-text': [
|
|
17
|
-
'warn',
|
|
18
|
-
{
|
|
19
|
-
elements: ['img', 'object', 'area', 'input[type="image"]'],
|
|
20
|
-
img: ['Image'],
|
|
21
|
-
object: [],
|
|
22
|
-
area: [],
|
|
23
|
-
'input[type="image"]': [],
|
|
24
|
-
},
|
|
25
|
-
],
|
|
26
|
-
},
|
|
27
|
-
} satisfies Linter.Config
|
package/src/presets/node.js
DELETED