@sequencemedia/eslint-config-standard 0.1.0 → 0.1.1

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 (2) hide show
  1. package/common/merge.mjs +21 -1
  2. package/package.json +1 -1
package/common/merge.mjs CHANGED
@@ -1,5 +1,23 @@
1
+ function hasLanguageOptionsParser ({ languageOptions: { parser = null } = {} }) {
2
+ return Boolean(parser)
3
+ }
4
+
5
+ function getLanguageOptionsParser ({ languageOptions: { parser = null } = {} }) {
6
+ return parser
7
+ }
8
+
9
+ function filterLanguageOptionsEntriesbyKey ([key]) {
10
+ return key !== 'parser'
11
+ }
12
+
1
13
  export function getLanguageOptions ({ languageOptions = {} }) {
2
- return languageOptions
14
+ const entries = Object.entries(languageOptions)
15
+
16
+ return (
17
+ Object.fromEntries(
18
+ entries.filter(filterLanguageOptionsEntriesbyKey)
19
+ )
20
+ )
3
21
  }
4
22
 
5
23
  export function getLinterOptions ({ linterOptions = {} }) {
@@ -22,7 +40,9 @@ export function mergeLanguageOptions (alpha = {}, omega = {}) {
22
40
  return (
23
41
  Object
24
42
  .assign(
43
+ hasLanguageOptionsParser(alpha) ? { parser: getLanguageOptionsParser(alpha) } : {},
25
44
  structuredClone(getLanguageOptions(alpha)),
45
+ hasLanguageOptionsParser(omega) ? { parser: getLanguageOptionsParser(omega) } : {},
26
46
  getLanguageOptions(omega)
27
47
  )
28
48
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sequencemedia/eslint-config-standard",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Standard configuration for ESLint 9",
5
5
  "keywords": [
6
6
  "JavaScript Standard Style",