@yoshinani/style-guide 0.1.8 → 0.2.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 +2 -0
- package/eslint/next.mjs +4 -0
- package/eslint/react-internal.mjs +5 -7
- package/eslint/rules/react-hooks.mjs +13 -0
- package/eslint/rules/react.mjs +20 -0
- package/package.json +55 -59
package/README.md
CHANGED
package/eslint/next.mjs
CHANGED
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
import base from "./base.mjs";
|
|
4
4
|
import globals from "globals";
|
|
5
|
+
import react from "./rules/react.mjs";
|
|
6
|
+
import reactHooks from "./rules/react-hooks.mjs";
|
|
5
7
|
|
|
6
8
|
const eslintConfig = [
|
|
7
9
|
...base,
|
|
10
|
+
react,
|
|
11
|
+
reactHooks,
|
|
8
12
|
{
|
|
9
13
|
languageOptions: {
|
|
10
14
|
globals: {
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
|
|
3
3
|
import base from "./base.mjs";
|
|
4
|
+
import react from "./rules/react.mjs";
|
|
5
|
+
import reactHooks from "./rules/react-hooks.mjs";
|
|
4
6
|
import globals from "globals";
|
|
5
|
-
import react from "eslint-plugin-react";
|
|
6
|
-
import reactHooks from "eslint-plugin-react-hooks";
|
|
7
7
|
|
|
8
8
|
const eslintConfig = [
|
|
9
9
|
...base,
|
|
10
|
+
react,
|
|
11
|
+
reactHooks,
|
|
10
12
|
{
|
|
13
|
+
name: "global-definitions",
|
|
11
14
|
languageOptions: {
|
|
12
15
|
globals: {
|
|
13
16
|
...globals.serviceworker,
|
|
@@ -16,11 +19,6 @@ const eslintConfig = [
|
|
|
16
19
|
},
|
|
17
20
|
ignores: ["node_modules/", "dist/", "*.js"],
|
|
18
21
|
},
|
|
19
|
-
{
|
|
20
|
-
files: ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"],
|
|
21
|
-
...react.configs.flat.recommended,
|
|
22
|
-
...reactHooks.configs["recommended-latest"],
|
|
23
|
-
},
|
|
24
22
|
];
|
|
25
23
|
|
|
26
24
|
export default eslintConfig;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
import react from "eslint-plugin-react";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: "react",
|
|
7
|
+
files: ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"],
|
|
8
|
+
plugins: {
|
|
9
|
+
react,
|
|
10
|
+
},
|
|
11
|
+
rules: {
|
|
12
|
+
...react.configs.flat.recommended.rules,
|
|
13
|
+
// コンポーネント名はPascalCaseで記載する
|
|
14
|
+
"react/jsx-pascal-case": "error",
|
|
15
|
+
// 論理値はtrue/falseで記載する
|
|
16
|
+
"react/jsx-boolean-value": ["error", "always"],
|
|
17
|
+
// 空のFragmentは記載しない
|
|
18
|
+
"react/jsx-no-useless-fragment": "error",
|
|
19
|
+
},
|
|
20
|
+
};
|
package/package.json
CHANGED
|
@@ -1,60 +1,56 @@
|
|
|
1
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
|
-
"publishConfig": {
|
|
58
|
-
"access": "public"
|
|
59
|
-
}
|
|
60
|
-
}
|
|
2
|
+
"name": "@yoshinani/style-guide",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Yoshinani's Style Guide",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://github.com/yoshinani-dev/style-guide#readme",
|
|
7
|
+
"bugs": {
|
|
8
|
+
"url": "https://github.com/yoshinani-dev/style-guide/issues"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/yoshinani-dev/style-guide.git"
|
|
13
|
+
},
|
|
14
|
+
"exports": {
|
|
15
|
+
"./typescript": "./typescript/base.json",
|
|
16
|
+
"./typescript/nextjs": "./typescript/nextjs.json",
|
|
17
|
+
"./typescript/react-library": "./typescript/react-library.json",
|
|
18
|
+
"./eslint/*": "./eslint/*.mjs",
|
|
19
|
+
"./commitlint": "./commitlint/commitlint.config.mjs",
|
|
20
|
+
"./prettier": "./prettier/prettier.config.cjs"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"typescript",
|
|
24
|
+
"eslint",
|
|
25
|
+
"commitlint",
|
|
26
|
+
"prettier",
|
|
27
|
+
"cspell"
|
|
28
|
+
],
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
31
|
+
"@commitlint/config-conventional": "^19",
|
|
32
|
+
"@eslint/js": "^9.25.1",
|
|
33
|
+
"eslint-config-prettier": "^10.1.2",
|
|
34
|
+
"eslint-plugin-functional": "^9.0.1",
|
|
35
|
+
"eslint-plugin-import": "^2.31.0",
|
|
36
|
+
"eslint-plugin-react": "^7.37.5",
|
|
37
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
38
|
+
"eslint-plugin-tailwindcss": "^3.18.0",
|
|
39
|
+
"globals": "^16.0.0",
|
|
40
|
+
"typescript-eslint": "^8.31.0"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@commitlint/cli": "^19.8.0",
|
|
44
|
+
"husky": "^9.1.7"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"eslint": "^9",
|
|
48
|
+
"prettier": "^3",
|
|
49
|
+
"typescript": "^5",
|
|
50
|
+
"@commitlint/cli": "^19"
|
|
51
|
+
},
|
|
52
|
+
"publishConfig": {
|
|
53
|
+
"access": "public"
|
|
54
|
+
},
|
|
55
|
+
"scripts": {}
|
|
56
|
+
}
|