eslint-config-matsuri 3.0.0 → 3.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.
Files changed (3) hide show
  1. package/README.md +10 -0
  2. package/index.js +43 -1
  3. package/package.json +3 -1
package/README.md CHANGED
@@ -18,6 +18,8 @@ ESLintを除く依存関係を別途インストールする必要はありま
18
18
  yarn add eslint eslint-config-matsuri
19
19
  ```
20
20
 
21
+ ## Usage
22
+
21
23
  Flat configをv3からサポートしています。eslint.config.jsに次のように記述します。
22
24
 
23
25
  ```js
@@ -39,6 +41,14 @@ export default [
39
41
  ]
40
42
  ```
41
43
 
44
+ VSCodeでFlag configを利用する場合は、`.vscode/settings.json`に次の設定を追加する必要があります。
45
+
46
+ ```json
47
+ {
48
+ "eslint.experimental.useFlatConfig": true
49
+ }
50
+ ```
51
+
42
52
 
43
53
  ## Contributing
44
54
 
package/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { FlatCompat } from "@eslint/eslintrc";
1
2
  import globals from "globals";
2
3
  import js from "@eslint/js";
3
4
  import pluginCssReorder from "eslint-plugin-css-reorder";
@@ -5,13 +6,40 @@ import pluginJsxA11y from "eslint-plugin-jsx-a11y";
5
6
  import pluginPrettier from "eslint-config-prettier";
6
7
  import pluginReact from "eslint-plugin-react";
7
8
  import pluginReactHooks from "eslint-plugin-react-hooks";
9
+ import pluginReactRefresh from "eslint-plugin-react-refresh";
8
10
  import pluginSortImports from "eslint-plugin-sort-imports-es6-autofix";
9
11
  import pluginUnusedImport from "eslint-plugin-unused-imports";
10
12
  import ts from "@typescript-eslint/eslint-plugin";
11
13
  import tsParser from "@typescript-eslint/parser";
12
14
 
15
+ /**
16
+ * @see https://github.com/storybookjs/eslint-plugin-storybook/issues/135
17
+ */
18
+ const compat = new FlatCompat();
19
+ const pluginStorybookRecommended = compat.extends(
20
+ "plugin:storybook/recommended"
21
+ );
22
+
13
23
  /** @type { import("eslint").Linter.FlatConfig[] } */
14
24
  const config = [
25
+ {
26
+ ignores: [
27
+ "**/node_modules",
28
+ "**/public",
29
+ // Webpack
30
+ "**/build",
31
+ // Vite
32
+ "**/dist",
33
+ // Next.js
34
+ "**/.next",
35
+ // Nuxt.js
36
+ "**/.nuxt",
37
+ // endpoints-sdk-cli
38
+ "**/endpoints",
39
+ // Storybook
40
+ "**/storybook-static",
41
+ ],
42
+ },
15
43
  {
16
44
  linterOptions: {
17
45
  reportUnusedDisableDirectives: true,
@@ -30,7 +58,7 @@ const config = [
30
58
  },
31
59
  rules: {
32
60
  ...js.configs.recommended.rules,
33
- "no-console": ["error", { allow: ["error"] }],
61
+ "no-console": ["error", { allow: ["error", "warn"] }],
34
62
  eqeqeq: ["error", "always"],
35
63
 
36
64
  /**
@@ -71,6 +99,7 @@ const config = [
71
99
  "jsx-a11y": pluginJsxA11y,
72
100
  react: pluginReact,
73
101
  "react-hooks": pluginReactHooks,
102
+ "react-refresh": pluginReactRefresh,
74
103
  },
75
104
  rules: {
76
105
  ...pluginReact.configs.recommended.rules,
@@ -163,8 +192,21 @@ const config = [
163
192
  argsIgnorePattern: "^_",
164
193
  },
165
194
  ],
195
+ "react-refresh/only-export-components": [
196
+ "warn",
197
+ { allowConstantExport: true },
198
+ ],
199
+ },
200
+ },
201
+ {
202
+ files: ["**/*.test.ts", "**/*.test.tsx", "**/*.test.js", "**/*.test.jsx"],
203
+ languageOptions: {
204
+ globals: {
205
+ ...globals.jest,
206
+ },
166
207
  },
167
208
  },
209
+ ...pluginStorybookRecommended,
168
210
  ];
169
211
 
170
212
  export default config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-matsuri",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "main": "index.js",
@@ -36,7 +36,9 @@
36
36
  "eslint-plugin-jsx-a11y": "6.7.1",
37
37
  "eslint-plugin-react": "7.33.1",
38
38
  "eslint-plugin-react-hooks": "4.6.0",
39
+ "eslint-plugin-react-refresh": "0.4.4",
39
40
  "eslint-plugin-sort-imports-es6-autofix": "0.6.0",
41
+ "eslint-plugin-storybook": "0.6.15",
40
42
  "eslint-plugin-unused-imports": "2.0.0"
41
43
  }
42
44
  }