wbuchwalter / tslint-loader

tslint loader for webpack
192 stars 65 forks source link

Fix merge function #24

Closed sshev closed 8 years ago

sshev commented 8 years ago

Addresses https://github.com/wbuchwalter/tslint-loader/issues/21

In our project we need to define rulesDirectory option as array of directories in webpack configuration:

tslint: {
  rulesDirectory: ['path_1', 'path_2'],
  configuration: {...}
}

After merge into internal tslint options object array turns to weird object:

rulesDirectory: {
  '0': 'path_1',
  '1': 'path_2'
},

Tslint fails to load rules with this configuration as it expects array or string. This PR fixes merge issue via ES6 Object.assign() polyfill that features merging objects functionality out of the box.