Skip to content

Commit

Permalink
Fixed converting Stylint option files
Browse files Browse the repository at this point in the history
  • Loading branch information
ThisIsManta committed Oct 20, 2022
1 parent bf000be commit ad1921d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions edge/createFormattingOptionsFromStylint.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const isObject = require('lodash/isObject')
const difference = require('lodash/difference')
const omitBy = require('lodash/omitBy')
const chunk = require('lodash/chunk')
const identity = require('lodash/identity')

Expand Down Expand Up @@ -42,8 +41,9 @@ const universalOptionMap = {
}

function createFormattingOptionsFromStylint(stylintOptions = {}) {
return omitBy(stylintOptions, (rule, name) => universalOptionMap[name] === undefined)
.reduce((hash, rule, name) => {
return Object.entries(stylintOptions)
.filter(([name]) => universalOptionMap[name] !== undefined)
.reduce((hash, [name, rule]) => {
const value = isObject(rule) && rule.expect !== undefined ? rule.expect : rule

chunk(universalOptionMap[name], 2).forEach(([name, convert]) => {
Expand Down

0 comments on commit ad1921d

Please sign in to comment.