@scayle/eslint-config-storefront 4.2.0 → 4.3.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/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @aboutyou/eslint-config-sfc
2
2
 
3
+ ## 4.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - add explicit rule handling for test files and allow 'console.logs' within tests
8
+
9
+ ### Patch Changes
10
+
11
+ - disable eslint rules 'sonarjs/no-duplicate-string' and 'yaml/plain-scalar'
12
+
3
13
  ## 4.2.0
4
14
 
5
15
  ### Minor Changes
@@ -25,18 +35,18 @@
25
35
 
26
36
  ```js
27
37
  // eslint.config.mjs
28
- import eslintConfigStorefront from "@scayle/eslint-config-storefront";
38
+ import eslintConfigStorefront from '@scayle/eslint-config-storefront'
29
39
 
30
- export default eslintConfigStorefront();
40
+ export default eslintConfigStorefront()
31
41
  ```
32
42
 
33
43
  For Nuxt projects using `@nuxt/eslint` module:
34
44
 
35
45
  ```js
36
- import withNuxt from "./.nuxt/eslint.config.mjs";
37
- import eslintConfigStorefront from "@scayle/eslint-config-storefront";
46
+ import withNuxt from './.nuxt/eslint.config.mjs'
47
+ import eslintConfigStorefront from '@scayle/eslint-config-storefront'
38
48
 
39
- export default withNuxt(eslintConfigStorefront());
49
+ export default withNuxt(eslintConfigStorefront())
40
50
  ```
41
51
 
42
52
  The `@scayle/eslint-config-storefront` package exports a factory function `eslintConfigStorefront()`. The factory function is able to automatically detect if a project is using the `@nuxt/eslint` package and automatically disables certain duplicate rules that are provided by `@nuxt/eslint`. This can also manually be adjusted by passing `{ isNuxt: true }` as parameter to `eslintConfigStorefront()`.
@@ -1,6 +1,7 @@
1
1
  import { FlatConfigComposer } from 'eslint-flat-config-utils'
2
2
  import { isPackageExists } from 'local-pkg'
3
3
  import {
4
+ GLOB_TESTS,
4
5
  combine,
5
6
  comments,
6
7
  ignores,
@@ -69,10 +70,18 @@ export const eslintConfigStorefront = function(config = {
69
70
  // Disable default rules by imported @antfu/eslint-config
70
71
  rules: {
71
72
  'node/prefer-global/process': 'off',
72
- 'yaml/plain-scalar': 'warn',
73
+ 'yaml/plain-scalar': 'off',
73
74
  },
74
75
  ignores: ['**/fixtures/**/*'],
75
76
  },
77
+ // Specific rules handling for test files
78
+ {
79
+ // See https://github.com/antfu/eslint-config/blob/main/src/globs.ts#L34
80
+ files: GLOB_TESTS,
81
+ rules: {
82
+ 'no-console': 'off',
83
+ },
84
+ },
76
85
  ]
77
86
 
78
87
  return flatConfigComposer.append(
@@ -13,7 +13,7 @@ export function sonarjs() {
13
13
  pluginSonarjs,
14
14
  },
15
15
  rules: {
16
- 'sonarjs/no-duplicate-string': 'warn',
16
+ 'sonarjs/no-duplicate-string': 'off',
17
17
  },
18
18
  },
19
19
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scayle/eslint-config-storefront",
3
- "version": "4.2.0",
3
+ "version": "4.3.0",
4
4
  "description": "SCAYLE Commerce Engine specific eslint configuration",
5
5
  "author": "SCAYLE Commerce Engine",
6
6
  "license": "MIT",
@@ -35,19 +35,19 @@
35
35
  "typescript": "^5.4.0"
36
36
  },
37
37
  "dependencies": {
38
- "local-pkg": "0.5.0",
39
- "@antfu/eslint-config": "2.18.0",
40
- "@eslint/eslintrc": "3.0.2",
41
- "eslint-flat-config-utils": "0.2.4",
42
- "eslint-config-flat-gitignore": "0.1.5",
43
- "eslint-plugin-no-unsanitized": "4.0.2",
44
- "eslint-plugin-promise": "6.1.1",
45
- "eslint-plugin-sonarjs": "1.0.3"
38
+ "local-pkg": "^0.5.0",
39
+ "@antfu/eslint-config": "^2.21.3",
40
+ "@eslint/eslintrc": "^3.1.0",
41
+ "eslint-flat-config-utils": "^0.3.0",
42
+ "eslint-config-flat-gitignore": "^0.1.6",
43
+ "eslint-plugin-no-unsanitized": "^4.0.2",
44
+ "eslint-plugin-promise": "^7.0.0",
45
+ "eslint-plugin-sonarjs": "^1.0.3"
46
46
  },
47
47
  "devDependencies": {
48
- "dprint": "0.45.1",
49
- "eslint": "9.2.0",
48
+ "dprint": "0.47.2",
49
+ "eslint": "9.8.0",
50
50
  "eslint-formatter-gitlab": "5.1.0",
51
- "publint": "0.2.7"
51
+ "publint": "0.2.9"
52
52
  }
53
53
  }