@guardian/eslint-config 13.0.2 → 13.0.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @guardian/eslint-config
2
2
 
3
+ ## 13.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - accf6d8: update deps: `eslint-plugin-storybook` from 10.1.10 to 10.2.0, `globals` from 17.0.0 to 17.1.0
8
+
9
+ ## 13.0.3
10
+
11
+ ### Patch Changes
12
+
13
+ - a79dc08: Fix ERR_MODULE_NOT_FOUND when importing @guardian/eslint-config in a project that does not have Storybook.
14
+
3
15
  ## 13.0.2
4
16
 
5
17
  ### Patch Changes
@@ -1,9 +1,21 @@
1
- import storybook from 'eslint-plugin-storybook';
1
+ // eslint-plugin-storybook has a dependency on on Storybook which causes it
2
+ // to crash eslint when it is imported if Storybook is not installed.
3
+ const loadStorybookRecommended = async () => {
4
+ try {
5
+ // eslint-disable-next-line import/no-unresolved -- We're checking if Storybook is resolveable
6
+ await import('storybook');
7
+ } catch {
8
+ return [];
9
+ }
10
+
11
+ const storybook = await import('eslint-plugin-storybook');
12
+ return storybook.configs['flat/recommended'];
13
+ };
2
14
 
3
15
  export default [
4
16
  {
5
17
  name: '@guardian/storybook',
6
18
  files: ['**/*.stories.{js,mjs,cjs,jsx,mjsx,ts,mts,cts,tsx,mtsx,mdx}'],
7
19
  },
8
- ...storybook.configs['flat/recommended'],
20
+ ...(await loadStorybookRecommended()),
9
21
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guardian/eslint-config",
3
- "version": "13.0.2",
3
+ "version": "13.0.4",
4
4
  "description": "ESLint config for Guardian JavaScript projects",
5
5
  "repository": {
6
6
  "url": "https://github.com/guardian/csnx",
@@ -9,7 +9,7 @@
9
9
  "type": "module",
10
10
  "main": "index.js",
11
11
  "dependencies": {
12
- "@eslint-community/eslint-plugin-eslint-comments": "4.5.0",
12
+ "@eslint-community/eslint-plugin-eslint-comments": "4.6.0",
13
13
  "@eslint/js": "9.39.1",
14
14
  "@stylistic/eslint-plugin": "5.7.0",
15
15
  "eslint-config-prettier": "10.1.8",
@@ -18,10 +18,10 @@
18
18
  "eslint-plugin-jsx-a11y": "6.10.2",
19
19
  "eslint-plugin-react": "7.37.5",
20
20
  "eslint-plugin-react-hooks": "7.0.1",
21
- "eslint-plugin-storybook": "10.1.10",
22
- "globals": "17.0.0",
21
+ "eslint-plugin-storybook": "10.2.0",
22
+ "globals": "17.1.0",
23
23
  "read-package-up": "12.0.0",
24
- "typescript-eslint": "8.52.0"
24
+ "typescript-eslint": "8.53.0"
25
25
  },
26
26
  "devDependencies": {
27
27
  "eslint": "9.39.1",