eslint-config-matsuri 0.0.1 → 1.0.1-alpha-e60bde9.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/README.md +1 -1
- package/index.js +7 -0
- package/package.json +6 -2
- package/.eslintrc.js +0 -1
- package/.github/workflows/test.yml +0 -37
- package/tests/console.ts +0 -4
- package/tests/jsx-a11y-alt-text.tsx +0 -4
- package/tests/jsx-a11y-interactive-supports-focus.tsx +0 -19
- package/tests/mocks/deprecated-function.ts +0 -6
- package/tests/no-deprecated.ts +0 -5
- package/tests/no-unused-vars.ts +0 -31
- package/tests/react-self-closing-comp.tsx +0 -19
package/README.md
CHANGED
|
@@ -32,4 +32,4 @@ module.exports = config;
|
|
|
32
32
|
## Contributing
|
|
33
33
|
|
|
34
34
|
ルールの検証などを行いたい場合は、tests以下にファイルを配置してください。
|
|
35
|
-
Errorが出てほしい記述には、`// eslint-disable-next-line`コメントを付けておくことで、`
|
|
35
|
+
Errorが出てほしい記述には、`// eslint-disable-next-line`コメントを付けておくことで、`yarn test`コマンドで確認できるようになります。
|
package/index.js
CHANGED
|
@@ -30,6 +30,10 @@ const config = {
|
|
|
30
30
|
"plugin:jsx-a11y/recommended",
|
|
31
31
|
"prettier",
|
|
32
32
|
],
|
|
33
|
+
parser: "@typescript-eslint/parser",
|
|
34
|
+
parserOptions: {
|
|
35
|
+
project: "./tsconfig.json",
|
|
36
|
+
},
|
|
33
37
|
settings: {
|
|
34
38
|
react: {
|
|
35
39
|
version: "detect",
|
|
@@ -45,6 +49,7 @@ const config = {
|
|
|
45
49
|
"error",
|
|
46
50
|
{ vars: "all", argsIgnorePattern: "^_" },
|
|
47
51
|
],
|
|
52
|
+
"@typescript-eslint/strict-boolean-expressions": "error",
|
|
48
53
|
|
|
49
54
|
"react/self-closing-comp": [
|
|
50
55
|
"error",
|
|
@@ -54,9 +59,11 @@ const config = {
|
|
|
54
59
|
},
|
|
55
60
|
],
|
|
56
61
|
"react/prop-types": "off",
|
|
62
|
+
"react/display-name": "off",
|
|
57
63
|
"react-hooks/exhaustive-deps": "error",
|
|
58
64
|
|
|
59
65
|
"jsx-a11y/click-events-have-key-events": "off",
|
|
66
|
+
"jsx-a11y/no-autofocus": "off",
|
|
60
67
|
},
|
|
61
68
|
},
|
|
62
69
|
],
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-matsuri",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.1-alpha-e60bde9.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"index.js"
|
|
8
|
+
],
|
|
6
9
|
"scripts": {
|
|
7
10
|
"test": "eslint . --max-warnings 0"
|
|
8
11
|
},
|
|
@@ -15,6 +18,7 @@
|
|
|
15
18
|
"eslint": ">= 8"
|
|
16
19
|
},
|
|
17
20
|
"devDependencies": {
|
|
21
|
+
"@emotion/react": "^11.9.3",
|
|
18
22
|
"@types/react": "^18.0.14",
|
|
19
23
|
"eslint": "8.18.0",
|
|
20
24
|
"react": "^18.2.0",
|
|
@@ -22,7 +26,7 @@
|
|
|
22
26
|
},
|
|
23
27
|
"dependencies": {
|
|
24
28
|
"@typescript-eslint/eslint-plugin": "5.30.0",
|
|
25
|
-
"@typescript-eslint/parser": "5.
|
|
29
|
+
"@typescript-eslint/parser": "5.32.0",
|
|
26
30
|
"eslint-config-prettier": "8.5.0",
|
|
27
31
|
"eslint-import-resolver-typescript": "^3.2.4",
|
|
28
32
|
"eslint-plugin-css-reorder": "0.5.1",
|
package/.eslintrc.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require("./index");
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
name: Test
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: ["main"]
|
|
6
|
-
pull_request:
|
|
7
|
-
branches: ["main"]
|
|
8
|
-
|
|
9
|
-
jobs:
|
|
10
|
-
test:
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
|
|
13
|
-
strategy:
|
|
14
|
-
matrix:
|
|
15
|
-
node-version: [16]
|
|
16
|
-
|
|
17
|
-
steps:
|
|
18
|
-
- uses: actions/checkout@v3
|
|
19
|
-
- uses: pnpm/action-setup@v2.2.2
|
|
20
|
-
with:
|
|
21
|
-
version: 7
|
|
22
|
-
- name: Use Node.js ${{ matrix.node-version }}
|
|
23
|
-
uses: actions/setup-node@v3
|
|
24
|
-
with:
|
|
25
|
-
node-version: ${{ matrix.node-version }}
|
|
26
|
-
- name: Cache node_modules
|
|
27
|
-
id: node_modules_cache_id
|
|
28
|
-
uses: actions/cache@v2
|
|
29
|
-
with:
|
|
30
|
-
key: node-${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
|
|
31
|
-
path: |
|
|
32
|
-
node_modules
|
|
33
|
-
- name: Install dependencies
|
|
34
|
-
run: pnpm install --frozen-lockfile
|
|
35
|
-
env:
|
|
36
|
-
CI: true
|
|
37
|
-
- run: pnpm run test
|
package/tests/console.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export const Incorrect = () => (
|
|
2
|
-
// eslint-disable-next-line jsx-a11y/interactive-supports-focus
|
|
3
|
-
<div
|
|
4
|
-
onClick={(event) => {
|
|
5
|
-
window.alert(event.currentTarget);
|
|
6
|
-
}}
|
|
7
|
-
role="button"
|
|
8
|
-
/>
|
|
9
|
-
);
|
|
10
|
-
|
|
11
|
-
export const Correct = () => (
|
|
12
|
-
<div
|
|
13
|
-
onClick={(event) => {
|
|
14
|
-
window.alert(event.currentTarget);
|
|
15
|
-
}}
|
|
16
|
-
role="button"
|
|
17
|
-
tabIndex={0}
|
|
18
|
-
/>
|
|
19
|
-
);
|
package/tests/no-deprecated.ts
DELETED
package/tests/no-unused-vars.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
-
import React, { useState } from "react";
|
|
3
|
-
|
|
4
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5
|
-
export const MyComponent = ({ hoge }) => {
|
|
6
|
-
return "Hello, World";
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10
|
-
export const MyComponent2 = ({ hoge, ...props }) => {
|
|
11
|
-
return props;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export const MyComponent3 = ({ hoge: _hoge, ...props }) => {
|
|
15
|
-
return props;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
try {
|
|
19
|
-
1 + 1;
|
|
20
|
-
} catch (error) {
|
|
21
|
-
1 + 1;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
25
|
-
(function (foo, bar, baz, qux) {
|
|
26
|
-
return bar;
|
|
27
|
-
})();
|
|
28
|
-
|
|
29
|
-
(function (foo, bar, baz, qux) {
|
|
30
|
-
return qux;
|
|
31
|
-
})();
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export const ImaginaryChild = () => <div />;
|
|
2
|
-
|
|
3
|
-
export const IncorrectParentWithImaginaryChild = () => {
|
|
4
|
-
// eslint-disable-next-line react/self-closing-comp
|
|
5
|
-
return <ImaginaryChild></ImaginaryChild>;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export const NonImaginaryChild = ({ children }: { children?: string }) => (
|
|
9
|
-
<div>{children}</div>
|
|
10
|
-
);
|
|
11
|
-
|
|
12
|
-
export const CorrectParent = () => {
|
|
13
|
-
return <NonImaginaryChild>Hello</NonImaginaryChild>;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export const IncorrectParentWithNonImaginaryChild = () => {
|
|
17
|
-
// eslint-disable-next-line react/self-closing-comp
|
|
18
|
-
return <NonImaginaryChild></NonImaginaryChild>;
|
|
19
|
-
};
|