eslint-config-matsuri 0.0.2 → 1.1.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 +29 -3
- package/package.json +14 -9
- package/.eslintrc.js +0 -1
- package/.github/dependabot.yml +0 -9
- package/.github/workflows/test.yml +0 -34
- 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/index.js
CHANGED
|
@@ -20,7 +20,7 @@ const config = {
|
|
|
20
20
|
browser: true,
|
|
21
21
|
es2021: true,
|
|
22
22
|
},
|
|
23
|
-
plugins: ["css-reorder", "import", "jsx-a11y"],
|
|
23
|
+
plugins: ["css-reorder", "import", "jsx-a11y", "unused-imports"],
|
|
24
24
|
extends: [
|
|
25
25
|
"plugin:react/recommended",
|
|
26
26
|
"plugin:react-hooks/recommended",
|
|
@@ -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",
|
|
@@ -41,9 +45,16 @@ const config = {
|
|
|
41
45
|
"css-reorder/property-reorder": "error",
|
|
42
46
|
|
|
43
47
|
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
44
|
-
|
|
48
|
+
|
|
49
|
+
"@typescript-eslint/strict-boolean-expressions": [
|
|
45
50
|
"error",
|
|
46
|
-
{
|
|
51
|
+
{
|
|
52
|
+
allowString: true,
|
|
53
|
+
allowNullableObject: true,
|
|
54
|
+
allowNullableBoolean: true,
|
|
55
|
+
allowNullableString: true,
|
|
56
|
+
allowAny: true,
|
|
57
|
+
},
|
|
47
58
|
],
|
|
48
59
|
|
|
49
60
|
"react/self-closing-comp": [
|
|
@@ -59,6 +70,21 @@ const config = {
|
|
|
59
70
|
|
|
60
71
|
"jsx-a11y/click-events-have-key-events": "off",
|
|
61
72
|
"jsx-a11y/no-autofocus": "off",
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* settings for unused-imports
|
|
76
|
+
*/
|
|
77
|
+
"@typescript-eslint/no-unused-vars": "off",
|
|
78
|
+
"unused-imports/no-unused-imports": "error",
|
|
79
|
+
"unused-imports/no-unused-vars": [
|
|
80
|
+
"warn",
|
|
81
|
+
{
|
|
82
|
+
vars: "all",
|
|
83
|
+
varsIgnorePattern: "^_",
|
|
84
|
+
args: "after-used",
|
|
85
|
+
argsIgnorePattern: "^_",
|
|
86
|
+
},
|
|
87
|
+
],
|
|
62
88
|
},
|
|
63
89
|
},
|
|
64
90
|
],
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-matsuri",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.1.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,20 +18,22 @@
|
|
|
15
18
|
"eslint": ">= 8"
|
|
16
19
|
},
|
|
17
20
|
"devDependencies": {
|
|
18
|
-
"@
|
|
21
|
+
"@emotion/react": "11.9.3",
|
|
22
|
+
"@types/react": "18.0.14",
|
|
19
23
|
"eslint": "8.18.0",
|
|
20
|
-
"react": "
|
|
21
|
-
"typescript": "
|
|
24
|
+
"react": "18.2.0",
|
|
25
|
+
"typescript": "4.7.4"
|
|
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
|
-
"eslint-import-resolver-typescript": "
|
|
31
|
+
"eslint-import-resolver-typescript": "3.2.4",
|
|
28
32
|
"eslint-plugin-css-reorder": "0.5.1",
|
|
29
|
-
"eslint-plugin-import": "
|
|
30
|
-
"eslint-plugin-jsx-a11y": "
|
|
33
|
+
"eslint-plugin-import": "2.26.0",
|
|
34
|
+
"eslint-plugin-jsx-a11y": "6.6.0",
|
|
31
35
|
"eslint-plugin-react": "7.30.1",
|
|
32
|
-
"eslint-plugin-react-hooks": "4.6.0"
|
|
36
|
+
"eslint-plugin-react-hooks": "4.6.0",
|
|
37
|
+
"eslint-plugin-unused-imports": "2.0.0"
|
|
33
38
|
}
|
|
34
39
|
}
|
package/.eslintrc.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require("./index");
|
package/.github/dependabot.yml
DELETED
|
@@ -1,34 +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
|
-
- name: Use Node.js ${{ matrix.node-version }}
|
|
20
|
-
uses: actions/setup-node@v3
|
|
21
|
-
with:
|
|
22
|
-
node-version: ${{ matrix.node-version }}
|
|
23
|
-
- name: Cache node_modules
|
|
24
|
-
id: node_modules_cache_id
|
|
25
|
-
uses: actions/cache@v2
|
|
26
|
-
with:
|
|
27
|
-
key: node-${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
|
|
28
|
-
path: |
|
|
29
|
-
node_modules
|
|
30
|
-
- name: Install dependencies
|
|
31
|
-
run: yarn install --frozen-lockfile
|
|
32
|
-
env:
|
|
33
|
-
CI: true
|
|
34
|
-
- run: yarn 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
|
-
};
|